diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2014-12-27 16:14:59 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2014-12-27 08:14:59 -0800 |
commit | c4575840086f29487a849aed0c680b2dcd51fc1f (patch) | |
tree | 738c3298e5c5ea10233b47b4f0b9954476c73da0 /gcc | |
parent | 982213b5ffeccdee4cb755d55009cc30aabd6016 (diff) | |
download | gcc-c4575840086f29487a849aed0c680b2dcd51fc1f.zip gcc-c4575840086f29487a849aed0c680b2dcd51fc1f.tar.gz gcc-c4575840086f29487a849aed0c680b2dcd51fc1f.tar.bz2 |
Issue an error for ms_abi attribute with x32
There is no counter part of x32 in MS ABI. Issue an error when ms_abi
attribute is used with x32.
gcc/
PR target/64409
* config/i386/i386.c (ix86_function_type_abi): Issue an error
when ms_abi attribute is used with x32.
gcc/testsuite/
PR target/64409
* gcc.target/i386/pr64409.c: New test.
From-SVN: r219081
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr64409.c | 6 |
4 files changed, 29 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4327061..ff8a5e6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-12-27 H.J. Lu <hongjiu.lu@intel.com> + + PR target/64409 + * config/i386/i386.c (ix86_function_type_abi): Issue an error + when ms_abi attribute is used with x32. + 2014-12-27 Anthony Green <green@moxielogic.com> * config/moxie/moxie-protos.h (moxie_offset_address_p): Define. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 122a350..d693fdb 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -6116,7 +6116,18 @@ ix86_function_type_abi (const_tree fntype) if (abi == SYSV_ABI) { if (lookup_attribute ("ms_abi", TYPE_ATTRIBUTES (fntype))) - abi = MS_ABI; + { + if (TARGET_X32) + { + static bool warned = false; + if (!warned) + { + error ("X32 does not support ms_abi attribute"); + warned = true; + } + } + abi = MS_ABI; + } } else if (lookup_attribute ("sysv_abi", TYPE_ATTRIBUTES (fntype))) abi = SYSV_ABI; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d0bee5d..3725770 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-12-26 H.J. Lu <hongjiu.lu@intel.com> + + PR target/64409 + * gcc.target/i386/pr64409.c: New test. + 2014-12-24 Segher Boessenkool <segher@kernel.crashing.org> * gcc.target/powerpc/405-dlmzb-strlen-1.c: Explicitly align arg. diff --git a/gcc/testsuite/gcc.target/i386/pr64409.c b/gcc/testsuite/gcc.target/i386/pr64409.c new file mode 100644 index 0000000..6a64b59 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr64409.c @@ -0,0 +1,6 @@ +/* { dg-do compile { target { ! { ia32 } } } } */ +/* { dg-require-effective-target maybe_x32 } */ +/* { dg-options "-O0 -mx32" } */ + +int a; +int* __attribute__ ((ms_abi)) fn1 () { return &a; } /* { dg-error "X32 does not support ms_abi attribute" } */ |