------- Comment #1 from hubicka at gcc dot gnu dot org  2009-05-10 19:51 -------
This is latent problem in -Wunreachable.
We now unroll the loop:

void bar (void)
{
  int i;

  for (i = 0; i < 2; i++)
    if (! foo (a[i]))
      return;

  baz ();       /* { dg-bogus "will never be executed" } */
  baz ();
  baz ();

and last iteration of the loop gets copied including the i<2 test and thus the
following code is rendered dead.
I guess we can either
  1) Fix testcase so it is no longer unrolled again :) (or XFAIL it)
  2) Mark duplicated statements in some way and suppress unreachable warning on
them
  3) Teach unroller to not copy the last iteration including the code after
exit condition.

Honza


-- 

hubicka at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-05-10 19:51:04
               date|                            |


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

Reply via email to