With Optimization -O3 wrong code is generated for function c5p. #define COMPLEX struct CS COMPLEX { long x; long y; }; static COMPLEX CCID (COMPLEX x){ COMPLEX a; a.x = x.x; a.y = x.y; return a; } static COMPLEX CPOW (COMPLEX x, int y){ COMPLEX a; a = x; while (--y > 0) a=CCID(a); return a; } int c5p (COMPLEX x){ COMPLEX a,b; a = CPOW (x, 2); b = CCID( CPOW(a,2) ); return (b.x == b.y); } int main () { COMPLEX x; x.x = -7; x.y = -7; if(c5p (x))printf("PASSED\n");else printf("FAILED\n"); return 0; }
Subject: Re: [Bug optimization/10955] New: wrong code for structure argument in context of structure return with -O3 What platform was this on? What OS was this on? Thanks, Andrew Pinski
Subject: AW: wrong code for structure argument in context of structure return with -O3 Sorry, that I forgot this Information: What platform was this on? Fujitsu GP700F-600 What OS was this on? Solaris 8.1 Heinrich Brand -----Ursprüngliche Nachricht----- Von: pinskia@physics.uc.edu [mailto:gcc-bugzilla@gcc.gnu.org] Gesendet: Freitag, 23. Mai 2003 18:28 An: Brand, Heinrich Betreff: [Bug optimization/10955] wrong code for structure argument in context of structure return with -O3 PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10955 ------- Additional Comments From pinskia@physics.uc.edu 2003-05-23 16:27 ------- Subject: Re: [Bug optimization/10955] New: wrong code for structure argument in context of structure return with -O3 What platform was this on? What OS was this on? Thanks, Andrew Pinski ------- You are receiving this mail because: ------- You reported the bug, or are watching the reporter.
Feedback recieved changing title so someone else can look into the bug to see if it is fixed.
Regression from GCC 3.2.3 confirmed on 3.3 branch but not on mainline.
Subject: Bug 10955 CVSROOT: /cvs/gcc Module name: gcc Changes by: ebotcazou@gcc.gnu.org 2003-06-13 03:34:04 Modified files: gcc : ChangeLog unroll.c gcc/testsuite : ChangeLog Log message: PR optimization/10955 * unroll.c (unroll_loop): Fix off-by-one bug. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.18181&r2=1.18182 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/unroll.c.diff?cvsroot=gcc&r1=1.192&r2=1.193 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2765&r2=1.2766
Subject: Bug 10955 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: ebotcazou@gcc.gnu.org 2003-06-13 03:45:33 Modified files: gcc : ChangeLog unroll.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.c-torture/execute: 20030613-1.c Log message: PR optimization/10955 * unroll.c (unroll_loop): Fix off-by-one bug. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.575&r2=1.16114.2.576 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/unroll.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.184.2.2&r2=1.184.2.3 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.185&r2=1.2261.2.186 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/20030613-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1
See http://gcc.gnu.org/ml/gcc-patches/2003-06/msg01061.html