Bug 10955 - [3.3 regression] [SPARC] wrong code at -O3 for structure argument in context of structure return
Summary: [3.3 regression] [SPARC] wrong code at -O3 for structure argument in context ...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.3
: P2 critical
Target Milestone: 3.3.1
Assignee: Eric Botcazou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-23 15:47 UTC by heinrich.brand
Modified: 2003-06-13 07:06 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-06-10 06:49:31


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description heinrich.brand 2003-05-23 15:47:50 UTC
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;


}
Comment 1 Andrew Pinski 2003-05-23 16:27:47 UTC
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

Comment 2 heinrich.brand 2003-05-30 08:45:12 UTC
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.
Comment 3 Andrew Pinski 2003-06-02 03:40:17 UTC
Feedback recieved changing title so someone else can look into the bug to see if it is 
fixed.
Comment 4 Eric Botcazou 2003-06-10 06:49:04 UTC
Regression from GCC 3.2.3 confirmed on 3.3 branch but not on mainline.
Comment 5 GCC Commits 2003-06-13 03:34:08 UTC
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

Comment 7 Eric Botcazou 2003-06-13 07:06:24 UTC
See http://gcc.gnu.org/ml/gcc-patches/2003-06/msg01061.html