optimization/10817: gcc does not optimize result=0;if(t!=0)result=t; to result=t;
pinskia@physics.uc.edu
pinskia@physics.uc.edu
Fri May 16 15:06:00 GMT 2003
>Number: 10817
>Category: optimization
>Synopsis: gcc does not optimize result=0;if(t!=0)result=t; to result=t;
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri May 16 14:16:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Andrew Pinski
>Release: GNU C version 3.4 20030516 (experimental) (powerpc-apple-darwin6.6)
>Organization:
>Environment:
powerpc-apple-darwin6.6
>Description:
gcc does not optimize
result=0;
if(t!=0)
result=t;
to
result=t;
or
if(!t)
result = t;
else
result = 0;
to result = 0;
>How-To-Repeat:
int h(int t)
{
if (!t)
return 0;
return t;
}
int h1(int t)
{
int result = 0;
if (t)
result = t;
return result;
}
>Fix:
Unknown.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list