This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
optimization/10817: gcc does not optimize result=0;if(t!=0)result=t; to result=t;
- From: pinskia at physics dot uc dot edu
- To: gcc-gnats at gcc dot gnu dot org
- Date: 16 May 2003 14:09:22 -0000
- Subject: optimization/10817: gcc does not optimize result=0;if(t!=0)result=t; to result=t;
- Reply-to: pinskia at physics dot uc dot edu
>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: