forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PowerPC] Diagnose invalid combination with Altivec, VSX and soft-flo…
…at (llvm#79109) Moved from https://reviews.llvm.org/D126302 The current behaviour with these three options is quite undesirable: -mno-altivec -mvsx allows VSX to override no Altivec, thereby turning on both -msoft-float -maltivec causes a crash if an actual Altivec instruction is required because soft float turns of Altivec -msoft-float -mvsx is also accepted with both Altivec and VSX turned off (potentially causing crashes as above) This patch diagnoses these impossible combinations in the driver so the user does not end up with surprises in terms of their options being ignored or silently overridden. Fixes llvm#55556 --------- Co-authored-by: Nemanja Ivanovic <nemanja.i.ibm@gmail.com>
- Loading branch information
1 parent
0a3b5ec
commit 4792f91
Showing
3 changed files
with
52 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
// RUN: not %clang_cc1 -triple powerpc64le-linux-gnu -emit-llvm %s -o - | ||
|
||
long __attribute__((target("power8-vector,no-vsx"))) foo (void) { return 0; } // expected-error {{option '-mpower8-vector' cannot be specified with '-mno-vsx'}} | ||
long __attribute__((target("no-altivec,vsx"))) foo2(void) { return 0; } // expected-error {{option '-mvsx' cannot be specified with '-mno-altivec'}} | ||
long __attribute__((target("no-hard-float,altivec"))) foo3(void) { return 0; } // expected-error {{option '-msoft-float' cannot be specified with '-maltivec'}} | ||
long __attribute__((target("no-hard-float,vsx"))) foo4(void) { return 0; } // expected-error {{option '-msoft-float' cannot be specified with '-mvsx'}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters