[Bug optimization/11263] New: [SPARC] wrong code with -O2 -fnew-ra : undefined content of output register o3 was used
heinrich dot brand at fujitsu-siemens dot com
gcc-bugzilla@gcc.gnu.org
Fri Jun 20 09:18:00 GMT 2003
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
More information about the Gcc-bugs
mailing list