Bug 40095 - [4.5 Regression] Revision 147342/147343 caused extra failures
Summary: [4.5 Regression] Revision 147342/147343 caused extra failures
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.5.0
: P2 normal
Target Milestone: 4.5.0
Assignee: Not yet assigned to anyone
URL:
Keywords: missed-optimization
Depends on:
Blocks:
 
Reported: 2009-05-10 19:10 UTC by H.J. Lu
Modified: 2009-06-22 00:25 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-05-10 19:51:04


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2009-05-10 19:10:21 UTC
Revision 147342/147343 caused:

FAIL: gcc.dg/Wunreachable-2.c (test for excess errors)
FAIL: gcc.dg/tree-ssa/flatten-2.c scan-assembler-not indirect[12][: \t\n]

on Linux/ia32 and Linux/x86-64.
Comment 1 Jan Hubicka 2009-05-10 19:51:04 UTC
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
Comment 2 Richard Biener 2009-05-10 20:39:07 UTC
-Wunreachable is completely bogus anyway, I suggest to XFAIL the testcase.
Comment 3 Hans-Peter Nilsson 2009-05-10 22:07:53 UTC
cris-elf too...
Comment 4 Michael Matz 2009-05-13 17:51:15 UTC
flatten-2.c is the more important one.  We leave the static function
doubleindirect1 in there, which we shouldn't.
Comment 5 Andrew Pinski 2009-06-22 00:25:57 UTC
Both of these have been fixed for a while now.