This is the mail archive of the gcc-bugs@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]

[Bug rtl-optimization/17078] New: Jump into if(0)-substatement fails


On GCC 3.4.1 the following goto example generates wrong code.

On GCC 3.3.3 the return vale of this example is 1 as it should
be according to ANSI C "... If the first substatement is reached
via a label, the second substatment is not executed ..."
(see 6.6.4.1).

It looks to me that cfg_cleanup or some reachability test is not
taking into account that the if(0)-basic-block is entered via the
label and behaves too optimistic in elimiating it.

int main(int argc, char **argv)
{
  int i = 0;
  goto useless;
  if(0)
    {
      useless:
      i = 1;
    }
  else
    {
      i = 2;
    }
  return i;
}

-- 
           Summary: Jump into if(0)-substatement fails
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: paul dot woegerer at nsc dot com
                CC: gcc-bugs at gcc dot gnu dot org,tal dot agmon at nsc dot
                    com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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