public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/17078] New: Jump into if(0)-substatement fails
@ 2004-08-18 11:05 paul dot woegerer at nsc dot com
  2004-08-18 12:00 ` [Bug rtl-optimization/17078] " reichelt at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: paul dot woegerer at nsc dot com @ 2004-08-18 11:05 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-08-24  4:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-18 11:05 [Bug rtl-optimization/17078] New: Jump into if(0)-substatement fails paul dot woegerer at nsc dot com
2004-08-18 12:00 ` [Bug rtl-optimization/17078] " reichelt at gcc dot gnu dot org
2004-08-19  7:27 ` [Bug rtl-optimization/17078] [3.4 regression] " paul dot woegerer at nsc dot com
2004-08-19  7:54 ` paul dot woegerer at nsc dot com
2004-08-19 10:21 ` reichelt at gcc dot gnu dot org
2004-08-22 23:50 ` mmitchel at gcc dot gnu dot org
2004-08-24  4:03 ` cvs-commit at gcc dot gnu dot org
2004-08-24  4:09 ` pinskia at gcc dot gnu dot org
2004-08-24  4:23 ` cvs-commit at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).