From: H.J. Lu Date: Sat, 27 Dec 2014 16:35:41 +0000 (+0000) Subject: Issue an error for ms_abi attribute with x32 X-Git-Tag: releases/gcc-4.8.5~353 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=499e1a5e36567edf5a7c012ed257b27499871600;p=thirdparty%2Fgcc.git 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: r219083 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 31cafd547818..484f0c9979ca 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2014-12-27 H.J. Lu + + Backport from mainline: + 2014-12-27 H.J. Lu + + PR target/64409 + * config/i386/i386.c (ix86_function_type_abi): Issue an error + when ms_abi attribute is used with x32. + 2014-12-19 H.J. Lu Backported from mainline diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 9b24efce9c2f..6872189a9efe 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -5539,7 +5539,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 60b2df80c694..c3d8e7721b6f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2014-12-27 H.J. Lu + + Backport from mainline: + 2014-12-26 H.J. Lu + + PR target/64409 + * gcc.target/i386/pr64409.c: New test. + 2014-12-23 Janus Weil Backport from mainline diff --git a/gcc/testsuite/gcc.target/i386/pr64409.c b/gcc/testsuite/gcc.target/i386/pr64409.c new file mode 100644 index 000000000000..6a64b5961de8 --- /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" } */