Message ID | 20200507225856.5279F33E40@hamza.pair.com |
---|---|
State | New |
Headers | show |
Series | i386: Define __ILP32__ and _ILP32 for all 32-bit targets | expand |
On Fri, May 8, 2020 at 12:58 AM Gerald Pfeifer <gerald@pfeifer.com> wrote: > > A user reported that gcc -m32 on x86-64 does not define __ILP32__ > and I found the same on i686 (with gcc -x c -dM -E /dev/null). > > The code has > > if (TARGET_X32) > { > cpp_define (parse_in, "_ILP32"); > cpp_define (parse_in, "__ILP32__"); > } > > so -mx32 does define __ILP32__. > > This patch does the same for all "regular" 32-bit x86 targets. > Tested on i386-unknown-freebsd11.3 so far. > > Okay? OK. Thanks, Uros. > Gerald > > > * config/i386/i386-c.c (ix86_target_macros): Define _ILP32 and > __ILP32__ for 32-bit targets. > --- > gcc/config/i386/i386-c.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c > index b46ebb289d2..891b2c68372 100644 > --- a/gcc/config/i386/i386-c.c > +++ b/gcc/config/i386/i386-c.c > @@ -701,6 +701,8 @@ ix86_target_macros (void) > cpp_assert (parse_in, "cpu=i386"); > cpp_assert (parse_in, "machine=i386"); > builtin_define_std ("i386"); > + cpp_define (parse_in, "_ILP32"); > + cpp_define (parse_in, "__ILP32__"); > } > > if (!TARGET_80387) > -- > 2.26.2
On Fri, 8 May 2020, Uros Bizjak wrote: >> A user reported that gcc -m32 on x86-64 does not define __ILP32__ >> and I found the same on i686 (with gcc -x c -dM -E /dev/null). : >> This patch does the same for all "regular" 32-bit x86 targets. >> Tested on i386-unknown-freebsd11.3 so far. > OK. Thank you, Uros. This is in mainline now. Okay to backport to the GCC 10 and ideally GCC 9 branches? (The latter is where the user report came from.) Gerald
On Sun, May 17, 2020 at 6:14 PM Gerald Pfeifer <gerald@pfeifer.com> wrote: > > On Fri, 8 May 2020, Uros Bizjak wrote: > >> A user reported that gcc -m32 on x86-64 does not define __ILP32__ > >> and I found the same on i686 (with gcc -x c -dM -E /dev/null). > : > >> This patch does the same for all "regular" 32-bit x86 targets. > >> Tested on i386-unknown-freebsd11.3 so far. > > OK. > > Thank you, Uros. > > This is in mainline now. Okay to backport to the GCC 10 and ideally > GCC 9 branches? (The latter is where the user report came from.) This is OK for all release branches. Thanks, Uros.
diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c index b46ebb289d2..891b2c68372 100644 --- a/gcc/config/i386/i386-c.c +++ b/gcc/config/i386/i386-c.c @@ -701,6 +701,8 @@ ix86_target_macros (void) cpp_assert (parse_in, "cpu=i386"); cpp_assert (parse_in, "machine=i386"); builtin_define_std ("i386"); + cpp_define (parse_in, "_ILP32"); + cpp_define (parse_in, "__ILP32__"); } if (!TARGET_80387)