This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

optimization/10817: gcc does not optimize result=0;if(t!=0)result=t; to result=t;


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]