[Bug tree-optimization/15547] New: [tree-ssa] don't generate if (a != 0) for if (a)

dann at godzilla dot ics dot uci dot edu gcc-bugzilla@gcc.gnu.org
Fri May 21 00:23:00 GMT 2004


For the function 
int foo (int a)
{
   if (a) return 1;
   else return 0;  
}

the .original dump is: 
{
   if (a != 0)
      return <return-value> = 1;
   else
       return <return-value> = 0;
   
}

It is more space efficient to translate the "if" to "if (a) "

It might even be a good idea to fold if (a != 0) to if (a) during optimization.

-- 
           Summary: [tree-ssa] don't generate if (a != 0) for if (a)
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dann at godzilla dot ics dot uci dot edu
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15547



More information about the Gcc-bugs mailing list