This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/11263] New: [SPARC] wrong code with -O2 -fnew-ra : undefined content of output register o3 was used
- From: "heinrich dot brand at fujitsu-siemens dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Jun 2003 09:09:55 -0000
- Subject: [Bug optimization/11263] New: [SPARC] wrong code with -O2 -fnew-ra : undefined content of output register o3 was used
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11263
Summary: [SPARC] wrong code with -O2 -fnew-ra : undefined content
of output register o3 was used
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: heinrich.brand@fujitsu-siemens.com
CC: gcc-bugs@gcc.gnu.org
GCC build triplet: SunOS 5.8 sparc
GCC host triplet: Fujitsu GP700F-600
GCC target triplet: Fujitsu GP700F-600
A store double instruction to write an argument on the stack uses a source
register with undefined content.
int f4(int x1, double x2, double x3,double x4 , double x5){
return x1 + x2 + x3 + x4 + x5;}
int f5( int x1, double x2, double x3, double x4, double x5){
printf("x5: %lf\n",x5);
return x1 + x2 + x3 + x4 + x5;}
int sum(){
int s;
s = f4(1, 1., 1., 1., 1.) + f5(1, 1., 1., 1., 1.) ;
printf("sum: %d\n",s);
return s;}
main(){ return sum()!=10; }
wrong output with -O2 -fnew-ra is:
x5: 0.000000
sum: 9
1
right output is:
x5: 1.000000
sum: 10
0