diff options
author | Daniel Santos <daniel.santos@pobox.com> | 2017-08-22 17:59:24 +0000 |
---|---|---|
committer | Daniel Santos <dansan@gcc.gnu.org> | 2017-08-22 17:59:24 +0000 |
commit | 4d68ff06e1072c26ad41d62d4789aff8180f151b (patch) | |
tree | 97e181e2b8433052176482e37cdb62bd87ca2c11 /gcc | |
parent | 65d3dce8e80d0a697d63c92abfde078a11e37e64 (diff) | |
download | gcc-4d68ff06e1072c26ad41d62d4789aff8180f151b.zip gcc-4d68ff06e1072c26ad41d62d4789aff8180f151b.tar.gz gcc-4d68ff06e1072c26ad41d62d4789aff8180f151b.tar.bz2 |
PR target/71958: Error on -mx32 with -mabi=ms
gcc/ChangeLog:
2017-08-11 Daniel Santos <daniel.santos@pobox.com>
* config/i386/i386.c (ix86_option_override_internal): Error when
-mx32 is combined with -mabi=ms.
(ix86_function_type_abi): Limit errors for mixing -mx32 with
attribute ms_abi.
gcc/testsuite/ChangeLog:
2017-08-11 Daniel Santos <daniel.santos@pobox.com>
* gcc.target/i386/pr71958.c: New test to verify error on -mx32
and -mabi=ms
* gcc.target/i386/pr64409.c: Modify to only run on x32.
* gcc.target/i386/pr46470.c: Modify to skip x32 target.
* gcc.target/i386/pr66275.c: Likewise.
* gcc.target/i386/pr68018.c: Likewise.
From-SVN: r251287
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 12 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr46470.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr64409.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr66275.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr68018.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr71958.c | 7 |
8 files changed, 37 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e7681ce..8a9da80 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-08-22 Daniel Santos <daniel.santos@pobox.com> + + * config/i386/i386.c (ix86_option_override_internal): Error when -mx32 + is combined with -mabi=ms. + (ix86_function_type_abi): Limit errors for mixing -mx32 with attribute + ms_abi. + 2017-08-22 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/81488 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 3c82ae6..650bcbc 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -5684,6 +5684,10 @@ ix86_option_override_internal (bool main_args_p, if (!opts_set->x_ix86_abi) opts->x_ix86_abi = DEFAULT_ABI; + if (opts->x_ix86_abi == MS_ABI && TARGET_X32_P (opts->x_ix86_isa_flags)) + error ("-mabi=ms not supported with X32 ABI"); + gcc_assert (opts->x_ix86_abi == SYSV_ABI || opts->x_ix86_abi == MS_ABI); + /* For targets using ms ABI enable ms-extensions, if not explicit turned off. For non-ms ABI we turn off this option. */ @@ -8777,8 +8781,12 @@ ix86_function_type_abi (const_tree fntype) if (abi == SYSV_ABI && lookup_attribute ("ms_abi", TYPE_ATTRIBUTES (fntype))) { - if (TARGET_X32) - error ("X32 does not support ms_abi attribute"); + static int warned; + if (TARGET_X32 && !warned) + { + error ("X32 does not support ms_abi attribute"); + warned = 1; + } abi = MS_ABI; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 45a2ac0..fe39455 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2017-08-22 Daniel Santos <daniel.santos@pobox.com> + + * gcc.target/i386/pr71958.c: New test to verify error on -mx32 and + -mabi=ms + * gcc.target/i386/pr64409.c: Modify to only run on x32. + * gcc.target/i386/pr46470.c: Modify to skip x32 target. + * gcc.target/i386/pr66275.c: Likewise. + * gcc.target/i386/pr68018.c: Likewise. + 2017-08-22 Will Schmidt <will_schmidt@vnet.ibm.com> * gcc.target/powerpc/fold-vec-sums-int.c: New. diff --git a/gcc/testsuite/gcc.target/i386/pr46470.c b/gcc/testsuite/gcc.target/i386/pr46470.c index 9e8e731..c66a378 100644 --- a/gcc/testsuite/gcc.target/i386/pr46470.c +++ b/gcc/testsuite/gcc.target/i386/pr46470.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target { ! x32 } } } */ /* The pic register save adds unavoidable stack pointer references. */ /* { dg-skip-if "" { ia32 && { ! nonpic } } } */ /* These options are selected to ensure 1 word needs to be allocated diff --git a/gcc/testsuite/gcc.target/i386/pr64409.c b/gcc/testsuite/gcc.target/i386/pr64409.c index 9174726..7bf9d1e 100644 --- a/gcc/testsuite/gcc.target/i386/pr64409.c +++ b/gcc/testsuite/gcc.target/i386/pr64409.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-do compile { target x32 } } */ /* { dg-require-effective-target maybe_x32 } */ /* { dg-options "-O0 -mx32" } */ diff --git a/gcc/testsuite/gcc.target/i386/pr66275.c b/gcc/testsuite/gcc.target/i386/pr66275.c index b8759ae..51ae1f6 100644 --- a/gcc/testsuite/gcc.target/i386/pr66275.c +++ b/gcc/testsuite/gcc.target/i386/pr66275.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { *-*-linux* && { ! ia32 } } } } */ +/* { dg-do compile { target { *-*-linux* && lp64 } } } */ /* { dg-options "-mabi=ms -fdump-rtl-dfinit" } */ void diff --git a/gcc/testsuite/gcc.target/i386/pr68018.c b/gcc/testsuite/gcc.target/i386/pr68018.c index a0fa21e..04929c6 100644 --- a/gcc/testsuite/gcc.target/i386/pr68018.c +++ b/gcc/testsuite/gcc.target/i386/pr68018.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { *-*-linux* && { ! ia32 } } } } */ +/* { dg-do compile { target { *-*-linux* && lp64 } } } */ /* { dg-options "-O -mabi=ms -mstackrealign" } */ typedef float V __attribute__ ((vector_size (16))); diff --git a/gcc/testsuite/gcc.target/i386/pr71958.c b/gcc/testsuite/gcc.target/i386/pr71958.c new file mode 100644 index 0000000..c5a1097 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr71958.c @@ -0,0 +1,7 @@ +/* { dg-do compile { target { x32 } } } */ +/* { dg-options "-mabi=ms" } */ +/* { dg-error "-mabi=ms not supported with X32 ABI" "" { target *-*-* } 0 } */ + +void main () +{ +} |