* Mainline Regression in gcc.target/i386/pr32268.c @ 2008-02-16 18:07 Kaveh R. GHAZI 2008-02-16 18:39 ` Richard Guenther 0 siblings, 1 reply; 18+ messages in thread From: Kaveh R. GHAZI @ 2008-02-16 18:07 UTC (permalink / raw) To: ubizjak; +Cc: gcc, gcc-patches Hi Uros, This broke on x86_64 in the last day or so, I thought maybe you might know what happened. (You touched config/i386 FP stuff recently.) I'm seeing a regression in gcc.target/i386/pr32268.c as seen here: http://gcc.gnu.org/ml/gcc-testresults/2008-02/msg01108.html Right now the execute failures only appear with -fpic/-fPIC, however I believe this is because inlining is masking the problem and allowing things to get folded. With -fpic/-fPIC the inlining is disabled and the abort occurs. You can trigger the bug in a regular pass by applying the following noinline patch to the testcase. Thoughts? Thanks, --Kaveh diff -rup orig/egcc-SVN20080216/gcc/testsuite/gcc.target/i386/pr32268.c egcc-SVN20080216/gcc/testsuite/gcc.target/i386/pr32268.c --- orig/egcc-SVN20080216/gcc/testsuite/gcc.target/i386/pr32268.c 2007-12-31 19:11:58.000000000 +0100 +++ egcc-SVN20080216/gcc/testsuite/gcc.target/i386/pr32268.c 2008-02-16 18:34:04.000000000 +0100 @@ -4,12 +4,14 @@ extern void abort(void); -int test_lt(__float128 x, __float128 y) +int __attribute__ ((__noinline__)) +test_lt(__float128 x, __float128 y) { return x < y; } -int test_gt (__float128 x, __float128 y) +int __attribute__ ((__noinline__)) +test_gt (__float128 x, __float128 y) { return x > y; } ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Mainline Regression in gcc.target/i386/pr32268.c 2008-02-16 18:07 Mainline Regression in gcc.target/i386/pr32268.c Kaveh R. GHAZI @ 2008-02-16 18:39 ` Richard Guenther 2008-02-16 18:58 ` Uros Bizjak 2008-02-16 19:07 ` Kaveh R. Ghazi 0 siblings, 2 replies; 18+ messages in thread From: Richard Guenther @ 2008-02-16 18:39 UTC (permalink / raw) To: Kaveh R. GHAZI; +Cc: ubizjak, gcc, gcc-patches On Feb 16, 2008 6:50 PM, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> wrote: > Hi Uros, > > This broke on x86_64 in the last day or so, I thought maybe you might know > what happened. (You touched config/i386 FP stuff recently.) I'm seeing a > regression in gcc.target/i386/pr32268.c as seen here: > http://gcc.gnu.org/ml/gcc-testresults/2008-02/msg01108.html > > Right now the execute failures only appear with -fpic/-fPIC, however I > believe this is because inlining is masking the problem and allowing > things to get folded. With -fpic/-fPIC the inlining is disabled and the > abort occurs. > > You can trigger the bug in a regular pass by applying the following > noinline patch to the testcase. Thoughts? How does it break? It works for me with noinline and with -fPIC. Richard. > Thanks, > --Kaveh > > > diff -rup orig/egcc-SVN20080216/gcc/testsuite/gcc.target/i386/pr32268.c egcc-SVN20080216/gcc/testsuite/gcc.target/i386/pr32268.c > --- orig/egcc-SVN20080216/gcc/testsuite/gcc.target/i386/pr32268.c 2007-12-31 19:11:58.000000000 +0100 > +++ egcc-SVN20080216/gcc/testsuite/gcc.target/i386/pr32268.c 2008-02-16 18:34:04.000000000 +0100 > @@ -4,12 +4,14 @@ > > extern void abort(void); > > -int test_lt(__float128 x, __float128 y) > +int __attribute__ ((__noinline__)) > +test_lt(__float128 x, __float128 y) > { > return x < y; > } > > -int test_gt (__float128 x, __float128 y) > +int __attribute__ ((__noinline__)) > +test_gt (__float128 x, __float128 y) > { > return x > y; > } > ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Mainline Regression in gcc.target/i386/pr32268.c 2008-02-16 18:39 ` Richard Guenther @ 2008-02-16 18:58 ` Uros Bizjak 2008-02-16 19:00 ` Richard Guenther 2008-02-16 19:07 ` Kaveh R. Ghazi 1 sibling, 1 reply; 18+ messages in thread From: Uros Bizjak @ 2008-02-16 18:58 UTC (permalink / raw) To: Richard Guenther; +Cc: Kaveh R. GHAZI, gcc, gcc-patches Richard Guenther wrote: >> This broke on x86_64 in the last day or so, I thought maybe you might know >> what happened. (You touched config/i386 FP stuff recently.) I'm seeing a >> regression in gcc.target/i386/pr32268.c as seen here: >> http://gcc.gnu.org/ml/gcc-testresults/2008-02/msg01108.html >> >> Right now the execute failures only appear with -fpic/-fPIC, however I >> believe this is because inlining is masking the problem and allowing >> things to get folded. With -fpic/-fPIC the inlining is disabled and the >> abort occurs. >> >> You can trigger the bug in a regular pass by applying the following >> noinline patch to the testcase. Thoughts? >> > > How does it break? It works for me with noinline and with -fPIC. > You need to patch the testcase. The change was somehow trivial (effectively changed return mode of TFmode soft-fp compare from "long" into __libgcc_cmp_return__ mode, which should be the same). I'll look into it tomorrow. Thanks, Uros. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Mainline Regression in gcc.target/i386/pr32268.c 2008-02-16 18:58 ` Uros Bizjak @ 2008-02-16 19:00 ` Richard Guenther 2008-02-16 19:02 ` Andrew Pinski 0 siblings, 1 reply; 18+ messages in thread From: Richard Guenther @ 2008-02-16 19:00 UTC (permalink / raw) To: Uros Bizjak; +Cc: Kaveh R. GHAZI, gcc, gcc-patches On Feb 16, 2008 7:52 PM, Uros Bizjak <ubizjak@gmail.com> wrote: > Richard Guenther wrote: > > >> This broke on x86_64 in the last day or so, I thought maybe you might know > >> what happened. (You touched config/i386 FP stuff recently.) I'm seeing a > >> regression in gcc.target/i386/pr32268.c as seen here: > >> http://gcc.gnu.org/ml/gcc-testresults/2008-02/msg01108.html > >> > >> Right now the execute failures only appear with -fpic/-fPIC, however I > >> believe this is because inlining is masking the problem and allowing > >> things to get folded. With -fpic/-fPIC the inlining is disabled and the > >> abort occurs. > >> > >> You can trigger the bug in a regular pass by applying the following > >> noinline patch to the testcase. Thoughts? > >> > > > > How does it break? It works for me with noinline and with -fPIC. > > > You need to patch the testcase. The change was somehow trivial > (effectively changed return mode of TFmode soft-fp compare from "long" > into __libgcc_cmp_return__ mode, which should be the same). I'll look > into it tomorrow. I'm confused - I tested on updated trunk exactly as Kaveh reported - so you say I need additional patches to trigger the failure? Richard. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Mainline Regression in gcc.target/i386/pr32268.c 2008-02-16 19:00 ` Richard Guenther @ 2008-02-16 19:02 ` Andrew Pinski 0 siblings, 0 replies; 18+ messages in thread From: Andrew Pinski @ 2008-02-16 19:02 UTC (permalink / raw) To: Richard Guenther; +Cc: Uros Bizjak, Kaveh R. GHAZI, gcc, gcc-patches On Feb 16, 2008 10:57 AM, Richard Guenther <richard.guenther@gmail.com> wrote: > > You need to patch the testcase. The change was somehow trivial > > (effectively changed return mode of TFmode soft-fp compare from "long" > > into __libgcc_cmp_return__ mode, which should be the same). I'll look > > into it tomorrow. > > I'm confused - I tested on updated trunk exactly as Kaveh reported - so you > say I need additional patches to trigger the failure? No, Uros is saying that the fix will a change long to __libgcc_cmp_return__ . -- Pinski ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Mainline Regression in gcc.target/i386/pr32268.c 2008-02-16 18:39 ` Richard Guenther 2008-02-16 18:58 ` Uros Bizjak @ 2008-02-16 19:07 ` Kaveh R. Ghazi 2008-02-16 19:10 ` Richard Guenther 1 sibling, 1 reply; 18+ messages in thread From: Kaveh R. Ghazi @ 2008-02-16 19:07 UTC (permalink / raw) To: Richard Guenther; +Cc: ubizjak, gcc, gcc-patches From: "Richard Guenther" <richard.guenther@gmail.com> >> You can trigger the bug in a regular pass by applying the following >> noinline patch to the testcase. Thoughts? > > How does it break? It works for me with noinline and with -fPIC. > Richard. I'm running with mainline revision 132367 on x86_64-unknown-linux-gnu (i.e. lp64, not ilp32). When I run the failing testcase under gdb I get: (gdb) run Starting program: /tmp/kg/build/gcc/testsuite/gcc/pr32268.exe Program received signal SIGABRT, Aborted. 0x00002b2ae231d07b in raise () from /lib/libc.so.6 (gdb) up #1 0x00002b2ae231e84e in abort () from /lib/libc.so.6 (gdb) up #2 0x0000000000400575 in main () at /tmp/kg/egcc-SVN20080216/gcc/testsuite/gcc.target/i386/pr32268.c:32 32 abort(); (gdb) list 27 if (r != ((double) a < (double) b)) 28 abort(); 29 30 r = test_gt (a, b); 31 if (r != ((double) a > (double) b)) 32 abort(); 33 34 return 0; 35 } (gdb) p a $1 = 0 (gdb) p b $2 = 0 "b" should be 1.0. --Kaveh -- Kaveh R. Ghazi ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Mainline Regression in gcc.target/i386/pr32268.c 2008-02-16 19:07 ` Kaveh R. Ghazi @ 2008-02-16 19:10 ` Richard Guenther 2008-02-16 19:46 ` Kaveh R. Ghazi 0 siblings, 1 reply; 18+ messages in thread From: Richard Guenther @ 2008-02-16 19:10 UTC (permalink / raw) To: Kaveh R. Ghazi; +Cc: ubizjak, gcc, gcc-patches On Feb 16, 2008 8:01 PM, Kaveh R. Ghazi <ghazi@caip.rutgers.edu> wrote: > From: "Richard Guenther" <richard.guenther@gmail.com> > > >> You can trigger the bug in a regular pass by applying the following > >> noinline patch to the testcase. Thoughts? > > > > How does it break? It works for me with noinline and with -fPIC. > > Richard. > > I'm running with mainline revision 132367 on x86_64-unknown-linux-gnu (i.e. > lp64, not ilp32). When I run the failing testcase under gdb I get: > > (gdb) run > Starting program: /tmp/kg/build/gcc/testsuite/gcc/pr32268.exe > > Program received signal SIGABRT, Aborted. > 0x00002b2ae231d07b in raise () from /lib/libc.so.6 > (gdb) up > #1 0x00002b2ae231e84e in abort () from /lib/libc.so.6 > (gdb) up > #2 0x0000000000400575 in main () at > /tmp/kg/egcc-SVN20080216/gcc/testsuite/gcc.target/i386/pr32268.c:32 > 32 abort(); > (gdb) list > 27 if (r != ((double) a < (double) b)) > 28 abort(); > 29 > 30 r = test_gt (a, b); > 31 if (r != ((double) a > (double) b)) > 32 abort(); > 33 > 34 return 0; > 35 } > (gdb) p a > $1 = 0 > (gdb) p b > $2 = 0 > > > "b" should be 1.0. Ok. So this works for me with r132367, with the original testcase and flags, with the original testcase and -fPIC and with the modified testcase and both cases. Richard. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Mainline Regression in gcc.target/i386/pr32268.c 2008-02-16 19:10 ` Richard Guenther @ 2008-02-16 19:46 ` Kaveh R. Ghazi 2008-02-16 19:46 ` Richard Guenther 0 siblings, 1 reply; 18+ messages in thread From: Kaveh R. Ghazi @ 2008-02-16 19:46 UTC (permalink / raw) To: Richard Guenther; +Cc: ubizjak, gcc, gcc-patches From: "Richard Guenther" <richard.guenther@gmail.com> >> >> "b" should be 1.0. > > Ok. So this works for me with r132367, with the original testcase and > flags, > with the original testcase and -fPIC and with the modified testcase > and both cases. > Richard. I can't explain why it passes for you. (x86_64 lp64 mode, right?) I just redid the tests and I can trigger the failure with either the noinline patch or -fpic. I can also trigger it in the unpatched case by adding -O0 instead of -fpic which avoids the inline as well. Can anyone else reproduce it? Thanks, --Kaveh -- Kaveh R. Ghazi ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Mainline Regression in gcc.target/i386/pr32268.c 2008-02-16 19:46 ` Kaveh R. Ghazi @ 2008-02-16 19:46 ` Richard Guenther 2008-02-16 21:55 ` [PATCH] " Uros Bizjak 0 siblings, 1 reply; 18+ messages in thread From: Richard Guenther @ 2008-02-16 19:46 UTC (permalink / raw) To: Kaveh R. Ghazi; +Cc: ubizjak, gcc, gcc-patches On Feb 16, 2008 8:19 PM, Kaveh R. Ghazi <ghazi@caip.rutgers.edu> wrote: > From: "Richard Guenther" <richard.guenther@gmail.com> > > >> > >> "b" should be 1.0. > > > > Ok. So this works for me with r132367, with the original testcase and > > flags, > > with the original testcase and -fPIC and with the modified testcase > > and both cases. > > Richard. > > I can't explain why it passes for you. (x86_64 lp64 mode, right?) I just > redid the tests and I can trigger the failure with either the noinline patch > or -fpic. I can also trigger it in the unpatched case by adding -O0 instead > of -fpic which avoids the inline as well. > > Can anyone else reproduce it? Ok, if I rebuild libgcc I can reproduce the fail. Care to open a PR for this? Thanks, Richard. ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH] Re: Mainline Regression in gcc.target/i386/pr32268.c 2008-02-16 19:46 ` Richard Guenther @ 2008-02-16 21:55 ` Uros Bizjak 2008-02-16 23:29 ` Kaveh R. Ghazi 2008-02-16 23:44 ` Jakub Jelinek 0 siblings, 2 replies; 18+ messages in thread From: Uros Bizjak @ 2008-02-16 21:55 UTC (permalink / raw) To: Richard Guenther; +Cc: Kaveh R. Ghazi, Jakub Jelinek, gcc-patches Richard Guenther wrote: >> I can't explain why it passes for you. (x86_64 lp64 mode, right?) I just >> redid the tests and I can trigger the failure with either the noinline patch >> or -fpic. I can also trigger it in the unpatched case by adding -O0 instead >> of -fpic which avoids the inline as well. >> >> Can anyone else reproduce it? >> > > Ok, if I rebuild libgcc I can reproduce the fail. Care to open a PR for this? > Please don't. The fix is to change soft-float/soft-fp.h a bit. Jakub, is this change acceptable for glibc? Index: soft-fp.h =================================================================== --- soft-fp.h (revision 132367) +++ soft-fp.h (working copy) @@ -189,7 +189,7 @@ typedef USItype UHWtype; #endif -#ifndef CMPtype +#ifdef _LIBC #define CMPtype int #endif Uros. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] Re: Mainline Regression in gcc.target/i386/pr32268.c 2008-02-16 21:55 ` [PATCH] " Uros Bizjak @ 2008-02-16 23:29 ` Kaveh R. Ghazi 2008-02-16 23:44 ` Jakub Jelinek 1 sibling, 0 replies; 18+ messages in thread From: Kaveh R. Ghazi @ 2008-02-16 23:29 UTC (permalink / raw) To: Uros Bizjak, Richard Guenther; +Cc: Jakub Jelinek, gcc-patches From: "Uros Bizjak" <ubizjak@gmail.com> >> Ok, if I rebuild libgcc I can reproduce the fail. Care to open a PR for >> this? >> > > Please don't. The fix is to change soft-float/soft-fp.h a bit. Jakub, is > this change acceptable for glibc? > > Index: soft-fp.h > =================================================================== > --- soft-fp.h (revision 132367) > +++ soft-fp.h (working copy) > @@ -189,7 +189,7 @@ > typedef USItype UHWtype; > #endif > > -#ifndef CMPtype > +#ifdef _LIBC > #define CMPtype int > #endif > > Uros. If you install a fix, please consider also installing my noinline patch to the testcase so that problems are caught in the default scenario without -fpic/-fPIC. Thanks, --Kaveh -- Kaveh R. Ghazi ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] Re: Mainline Regression in gcc.target/i386/pr32268.c 2008-02-16 21:55 ` [PATCH] " Uros Bizjak 2008-02-16 23:29 ` Kaveh R. Ghazi @ 2008-02-16 23:44 ` Jakub Jelinek 2008-02-17 7:27 ` David Edelsohn 2008-02-17 10:08 ` Uros Bizjak 1 sibling, 2 replies; 18+ messages in thread From: Jakub Jelinek @ 2008-02-16 23:44 UTC (permalink / raw) To: Uros Bizjak; +Cc: Richard Guenther, Kaveh R. Ghazi, gcc-patches On Sat, Feb 16, 2008 at 10:46:15PM +0100, Uros Bizjak wrote: > Please don't. The fix is to change soft-float/soft-fp.h a bit. Jakub, is > this change acceptable for glibc? No. You should IMHO instead #define CMPtype int __attribute__ ((mode (__libgcc_cmp_return__))) in config/i386/sfp-machine.h. There is nothing libc specific on having a default CMPtype definition. > -#ifndef CMPtype > +#ifdef _LIBC > #define CMPtype int > #endif Jakub ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Re: [PATCH] Re: Mainline Regression in gcc.target/i386/pr32268.c 2008-02-16 23:44 ` Jakub Jelinek @ 2008-02-17 7:27 ` David Edelsohn 2008-02-17 10:08 ` Uros Bizjak 1 sibling, 0 replies; 18+ messages in thread From: David Edelsohn @ 2008-02-17 7:27 UTC (permalink / raw) To: Jakub Jelinek; +Cc: Uros Bizjak, Richard Guenther, Kaveh R. Ghazi, gcc-patches >>>>> Jakub Jelinek writes: > No. You should IMHO instead > #define CMPtype int __attribute__ ((mode (__libgcc_cmp_return__))) > in config/i386/sfp-machine.h. > There is nothing libc specific on having a default CMPtype definition. Does this imply that the same change should be made to sfp-machine.h for every target that supports soft-fp? If so, all targets should be fixed at the same time. Thanks, David ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] Re: Mainline Regression in gcc.target/i386/pr32268.c 2008-02-16 23:44 ` Jakub Jelinek 2008-02-17 7:27 ` David Edelsohn @ 2008-02-17 10:08 ` Uros Bizjak 2008-02-17 11:57 ` Jakub Jelinek 2008-02-19 1:33 ` David Edelsohn 1 sibling, 2 replies; 18+ messages in thread From: Uros Bizjak @ 2008-02-17 10:08 UTC (permalink / raw) To: Jakub Jelinek Cc: Richard Guenther, Kaveh R. Ghazi, gcc-patches, David Edelsohn [-- Attachment #1: Type: text/plain, Size: 1191 bytes --] Jakub Jelinek wrote: >> Please don't. The fix is to change soft-float/soft-fp.h a bit. Jakub, is >> this change acceptable for glibc? >> > > No. You should IMHO instead > #define CMPtype int __attribute__ ((mode (__libgcc_cmp_return__))) > in config/i386/sfp-machine.h. > There is nothing libc specific on having a default CMPtype definition. > Hm, this won't fly. But following will: typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__))); #define CMPtype __gcc_CMPtype Attached patch adds this construct to i386/sfp-machine.h and rs6000/sfp-machine.h. It also changes test as Kaveh suggested. 2008-02-17 Uros Bizjak <ubizjak@gmail.com> * config/i386/sfp-machine.h (__gcc_CPMtype): Rename from CMPtype. (CMPtype): Define as __gcc_CMPtype. * config/rs6000/sfp-machine.h (__gcc_CMPtype): New typedef. (CMPtype): Define as __gcc_CMPtype. testsuite/ChangeLog: 2008-02-17 Uros Bizjak <ubizjak@gmail.com> * gcc.target/i386/pr32268.c (test_lt): Add noinline attribute. (test_gt): Ditto. The patch was tested on x86_64-pc-linux-gnu. OK for mainline (patch needs rs6000 maintainer approval)? Thanks, Uros. [-- Attachment #2: p.diff.txt --] [-- Type: text/plain, Size: 1837 bytes --] Index: config/i386/sfp-machine.h =================================================================== --- config/i386/sfp-machine.h (revision 132376) +++ config/i386/sfp-machine.h (working copy) @@ -10,9 +10,9 @@ /* The type of the result of a floating point comparison. This must match `__libgcc_cmp_return__' in GCC for the target. */ +typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__))); +#define CMPtype __gcc_CMPtype -typedef int CMPtype __attribute__ ((mode (__libgcc_cmp_return__))); - #define _FP_MUL_MEAT_Q(R,X,Y) \ _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm) Index: config/rs6000/sfp-machine.h =================================================================== --- config/rs6000/sfp-machine.h (revision 132376) +++ config/rs6000/sfp-machine.h (working copy) @@ -3,6 +3,11 @@ #define _FP_WS_TYPE signed long #define _FP_I_TYPE long +/* The type of the result of a floating point comparison. This must + match `__libgcc_cmp_return__' in GCC for the target. */ +typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__))); +#define CMPtype __gcc_CMPtype + #define _FP_MUL_MEAT_S(R,X,Y) \ _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm) #define _FP_MUL_MEAT_D(R,X,Y) \ Index: testsuite/gcc.target/i386/pr32268.c =================================================================== --- testsuite/gcc.target/i386/pr32268.c (revision 132376) +++ testsuite/gcc.target/i386/pr32268.c (working copy) @@ -4,12 +4,14 @@ extern void abort(void); -int test_lt(__float128 x, __float128 y) +int __attribute__ ((__noinline__)) +test_lt(__float128 x, __float128 y) { return x < y; } -int test_gt (__float128 x, __float128 y) +int __attribute__ ((__noinline__)) +test_gt (__float128 x, __float128 y) { return x > y; } ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] Re: Mainline Regression in gcc.target/i386/pr32268.c 2008-02-17 10:08 ` Uros Bizjak @ 2008-02-17 11:57 ` Jakub Jelinek 2008-02-17 12:44 ` Uros Bizjak 2008-02-19 1:33 ` David Edelsohn 1 sibling, 1 reply; 18+ messages in thread From: Jakub Jelinek @ 2008-02-17 11:57 UTC (permalink / raw) To: Uros Bizjak; +Cc: Richard Guenther, Kaveh R. Ghazi, gcc-patches, David Edelsohn On Sun, Feb 17, 2008 at 08:27:03AM +0100, Uros Bizjak wrote: > Jakub Jelinek wrote: > > >>Please don't. The fix is to change soft-float/soft-fp.h a bit. Jakub, is > >>this change acceptable for glibc? > >> > > > >No. You should IMHO instead > >#define CMPtype int __attribute__ ((mode (__libgcc_cmp_return__))) > >in config/i386/sfp-machine.h. > >There is nothing libc specific on having a default CMPtype definition. > > > > Hm, this won't fly. Ok, you're right. Should have tried that in fn return value :( > But following will: > > typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__))); > #define CMPtype __gcc_CMPtype So would: typedef int CMPtype __attribute__ ((mode (__libgcc_cmp_return__))); #define CMPtype CMPtype > Attached patch adds this construct to i386/sfp-machine.h and > rs6000/sfp-machine.h. It also changes test as Kaveh suggested. Do we really need to change rs6000 before 4.3 release? AFAIK soft-fp is used there just for 32-bit stuff, and __libgcc_cmp_return__ will be there always int. All I'm saying is that in rs6000 case this isn't a regression bugfix of any kind (and I doubt http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132350 has been a regression bugfix either). I'd say that's just a cleanup we can do once 4.4 reopens (Monday). Jakub ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] Re: Mainline Regression in gcc.target/i386/pr32268.c 2008-02-17 11:57 ` Jakub Jelinek @ 2008-02-17 12:44 ` Uros Bizjak 0 siblings, 0 replies; 18+ messages in thread From: Uros Bizjak @ 2008-02-17 12:44 UTC (permalink / raw) To: Jakub Jelinek Cc: Richard Guenther, Kaveh R. Ghazi, gcc-patches, David Edelsohn [-- Attachment #1: Type: text/plain, Size: 991 bytes --] Jakub Jelinek wrote: > Do we really need to change rs6000 before 4.3 release? AFAIK soft-fp > is used there just for 32-bit stuff, and __libgcc_cmp_return__ will be there > always int. All I'm saying is that in rs6000 case this isn't a regression > bugfix of any kind (and I doubt > http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132350 > has been a regression bugfix either). I'd say that's just a cleanup > we can do once 4.4 reopens (Monday). > I have reverted mentioned change for now (and fixed pr32268.c): 2008-02-17 Uros Bizjak <ubizjak@gmail.com> Revert: 2008-02-15 Uros Bizjak <ubizjak@gmail.com> * config/i386/sfp-machine.h (CMPtype): Define as typedef using libgcc_cmp_return mode. testsuite/ChnageLog: 2008-02-17 Uros Bizjak <ubizjak@gmail.com> * gcc.target/i386/pr32268.c (test_lt): Add noinline attribute. (test_gt): Ditto. Patch was tested on x86_64-pc-linux-gnu, committed to mainline. Thanks, Uros. [-- Attachment #2: p.diff.txt --] [-- Type: text/plain, Size: 1148 bytes --] Index: testsuite/gcc.target/i386/pr32268.c =================================================================== --- testsuite/gcc.target/i386/pr32268.c (revision 132376) +++ testsuite/gcc.target/i386/pr32268.c (working copy) @@ -4,12 +4,14 @@ extern void abort(void); -int test_lt(__float128 x, __float128 y) +int __attribute__ ((__noinline__)) +test_lt(__float128 x, __float128 y) { return x < y; } -int test_gt (__float128 x, __float128 y) +int __attribute__ ((__noinline__)) +test_gt (__float128 x, __float128 y) { return x > y; } Index: config/i386/sfp-machine.h =================================================================== --- config/i386/sfp-machine.h (revision 132376) +++ config/i386/sfp-machine.h (working copy) @@ -10,8 +10,7 @@ typedef unsigned int UTItype __attribute /* The type of the result of a floating point comparison. This must match `__libgcc_cmp_return__' in GCC for the target. */ - -typedef int CMPtype __attribute__ ((mode (__libgcc_cmp_return__))); +#define CMPtype long #define _FP_MUL_MEAT_Q(R,X,Y) \ _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm) ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] Re: Mainline Regression in gcc.target/i386/pr32268.c 2008-02-17 10:08 ` Uros Bizjak 2008-02-17 11:57 ` Jakub Jelinek @ 2008-02-19 1:33 ` David Edelsohn 2008-02-19 7:48 ` Uros Bizjak 1 sibling, 1 reply; 18+ messages in thread From: David Edelsohn @ 2008-02-19 1:33 UTC (permalink / raw) To: Uros Bizjak; +Cc: Jakub Jelinek, Richard Guenther, Kaveh R. Ghazi, gcc-patches * config/rs6000/sfp-machine.h (__gcc_CMPtype): New typedef. (CMPtype): Define as __gcc_CMPtype. Yes, please go ahead and apply the equivalent of whatever fix you and Jakub decide to apply to i386. Thanks, David ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] Re: Mainline Regression in gcc.target/i386/pr32268.c 2008-02-19 1:33 ` David Edelsohn @ 2008-02-19 7:48 ` Uros Bizjak 0 siblings, 0 replies; 18+ messages in thread From: Uros Bizjak @ 2008-02-19 7:48 UTC (permalink / raw) To: David Edelsohn Cc: Jakub Jelinek, Richard Guenther, Kaveh R. Ghazi, gcc-patches On Feb 19, 2008 2:29 AM, David Edelsohn <dje@watson.ibm.com> wrote: > * config/rs6000/sfp-machine.h (__gcc_CMPtype): New typedef. > (CMPtype): Define as __gcc_CMPtype. > > Yes, please go ahead and apply the equivalent of whatever fix you and > Jakub decide to apply to i386. > > typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__))); > > #define CMPtype __gcc_CMPtype > So would: > typedef int CMPtype __attribute__ ((mode (__libgcc_cmp_return__))); > #define CMPtype CMPtype IMO, in the second version, the "#define X X" is a bit unusual. I think that the first version describes the intention and avoids unwanted cleanups in the future. 2008-02-19 Uros Bizjak <ubizjak@gmail.com> * config/i386/sfp-machine.h (__gcc_CMPtype): New typedef. (CMPtype): Define as __gcc_CMPtype. * config/rs6000/sfp-machine.h (__gcc_CMPtype): New typedef. (CMPtype): Define as __gcc_CMPtype. The patch was bootstrapped and regression tested on x86_64-pc-linux-gnu, committed to 4.4. Uros. Index: config/i386/sfp-machine.h =================================================================== --- config/i386/sfp-machine.h (revision 132412) +++ config/i386/sfp-machine.h (working copy) @@ -10,7 +10,8 @@ /* The type of the result of a floating point comparison. This must match `__libgcc_cmp_return__' in GCC for the target. */ -#define CMPtype long +typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__))); +#define CMPtype __gcc_CMPtype #define _FP_MUL_MEAT_Q(R,X,Y) \ _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm) Index: config/rs6000/sfp-machine.h =================================================================== --- config/rs6000/sfp-machine.h (revision 132412) +++ config/rs6000/sfp-machine.h (working copy) @@ -3,6 +3,11 @@ #define _FP_WS_TYPE signed long #define _FP_I_TYPE long +/* The type of the result of a floating point comparison. This must + match `__libgcc_cmp_return__' in GCC for the target. */ +typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__))); +#define CMPtype __gcc_CMPtype + #define _FP_MUL_MEAT_S(R,X,Y) \ _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm) #define _FP_MUL_MEAT_D(R,X,Y) \ ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2008-02-19 7:14 UTC | newest] Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2008-02-16 18:07 Mainline Regression in gcc.target/i386/pr32268.c Kaveh R. GHAZI 2008-02-16 18:39 ` Richard Guenther 2008-02-16 18:58 ` Uros Bizjak 2008-02-16 19:00 ` Richard Guenther 2008-02-16 19:02 ` Andrew Pinski 2008-02-16 19:07 ` Kaveh R. Ghazi 2008-02-16 19:10 ` Richard Guenther 2008-02-16 19:46 ` Kaveh R. Ghazi 2008-02-16 19:46 ` Richard Guenther 2008-02-16 21:55 ` [PATCH] " Uros Bizjak 2008-02-16 23:29 ` Kaveh R. Ghazi 2008-02-16 23:44 ` Jakub Jelinek 2008-02-17 7:27 ` David Edelsohn 2008-02-17 10:08 ` Uros Bizjak 2008-02-17 11:57 ` Jakub Jelinek 2008-02-17 12:44 ` Uros Bizjak 2008-02-19 1:33 ` David Edelsohn 2008-02-19 7:48 ` Uros Bizjak
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).