Bug 58492 - [4.9 Regression] ICE: verify_flow_info failed
Summary: [4.9 Regression] ICE: verify_flow_info failed
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ipa (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: 4.9.0
Assignee: Richard Biener
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-21 14:49 UTC by Antoine Balestrat
Modified: 2013-11-05 15:09 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2013-09-23 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Balestrat 2013-09-21 14:49:32 UTC
Hello ! The following testcase makes GCC 4.9.0 as of 20130921 crash.

$ cat vfi.c
void f(int p, short q)
{
   f(0, 0);
}

$ xgcc -O3 -fipa-pta vfi.c
vfi.c: In function ‘f’:
vfi.c:1:6: error: control flow in the middle of basic block 2
 void f(int p, short q)
      ^
vfi.c:1:6: internal compiler error: verify_flow_info failed
0x617352 verify_flow_info()
        ../../srcdir/gcc/cfghooks.c:260
0x958d3a cleanup_tree_cfg_noloop
        ../../srcdir/gcc/tree-cfgcleanup.c:696
0x958d3a cleanup_tree_cfg()
        ../../srcdir/gcc/tree-cfgcleanup.c:745
0x87f724 execute_function_todo
        ../../srcdir/gcc/passes.c:1791
0x87fe17 execute_todo
        ../../srcdir/gcc/passes.c:1866
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Richard Biener 2013-09-23 09:31:25 UTC
Results in

<bb2>
f.constprop ();
return;

and f.constprop is stmt_ends_bb_p () now, the original recursion isn't.
That's because it's likely got an endless loop and noreturn?

calling out IPA-PTA is probably bogus.

f is found const by IPA pure const (but f.constprop isn't updated via
clone hook?) and ends up const looping.  IPA-PTA doesn't do anything
and copyprop simply first triggers verification.
Comment 2 Richard Biener 2013-11-05 14:23:36 UTC
With -fipa-pta at t.c.054t.copyrename2 we have

f.constprop ()
{
  <bb 2>:
  f.constprop ();
  return;

}

f (int p, short int q)
{
  <bb 2>:
  f.constprop ();
  return;

}

but without -fipa-pta we get

f (int p, short int q)
{
  <bb 2>:
  f.constprop ();

}

appearantly

  /* SIPLE IPA passes do not handle callgraphs with IPA transforms in it.
     Apply all trnasforms first.  */
  if (pass->type == SIMPLE_IPA_PASS)
    {
      bool applied = false;
      do_per_function (apply_ipa_transforms, (void *)&applied);
      if (applied)
        symtab_remove_unreachable_nodes (true, dump_file);
      /* Restore current_pass.  */
      current_pass = pass;
    }

breaks things because we instantiate the clone before executing late
local-pure-const for f.constprop () this way and thus miss the state
change in the caller and the fixup-cfg required by it.  In 4.8 we had
as first pass in all_passes a pass_fixup_cfg but appearantly I removed
that(?) ...

Mine.
Comment 3 Richard Biener 2013-11-05 15:09:42 UTC
Author: rguenth
Date: Tue Nov  5 15:09:40 2013
New Revision: 204399

URL: http://gcc.gnu.org/viewcvs?rev=204399&root=gcc&view=rev
Log:
2013-11-05  Richard Biener  <rguenther@suse.de>

	PR ipa/58492
	* passes.def (all_passes): Start with pass_fixup_cfg again.

	* gcc.dg/ipa/pr58492.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/ipa/pr58492.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/passes.def
    trunk/gcc/testsuite/ChangeLog
Comment 4 Richard Biener 2013-11-05 15:09:57 UTC
Fixed.