Bug 62070 - ICE: verify_ssa failed
Summary: ICE: verify_ssa failed
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 5.0
: P3 normal
Target Milestone: ---
Assignee: Richard Biener
URL:
Keywords: ice-checking, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2014-08-08 20:08 UTC by Sabrina Souto
Modified: 2014-08-11 10:55 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work: 4.10.0
Known to fail: 4.6.4, 4.7.4, 4.8.3, 4.9.1
Last reconfirmed: 2014-08-08 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sabrina Souto 2014-08-08 20:08:28 UTC
GCC-4.10.0 (trunk)
x86_64-apple-darwin11.4.2

Running the following test:
make -s -C gcc check-gcc RUNTESTFLAGS="dg.exp=pr47684.c --target_board=unix/-O3/-fno-tree-vectorize"

GCC throw an ICE:
------------------------------------------------------------------------
/Users/sabrinasouto/Downloads/gcc_trunk/trunk/gcc/testsuite/gcc.dg/pr47684.c: In function 'foo':
/Users/sabrinasouto/Downloads/gcc_trunk/trunk/gcc/testsuite/gcc.dg/pr47684.c:10:1: error: no immediate_use list
for SSA_NAME: _16 in statement:
_13 = PHI <pretmp_103(8), _16(4)>
PHI argument
_16
for PHI node
_13 = PHI <pretmp_103(8), _16(4)>
/Users/sabrinasouto/Downloads/gcc_trunk/trunk/gcc/testsuite/gcc.dg/pr47684.c:10:1: internal compiler error: verify_ssa failed

/Users/sabrinasouto/Downloads/gcc_trunk/trunk/gcc/testsuite/gcc.dg/pr47684.c:10:1: internal compiler error: Abort trap: 6
xgcc: internal compiler error: Abort trap: 6 (program cc1)
compiler exited with status 1
output is:
/Users/sabrinasouto/Downloads/gcc_trunk/trunk/gcc/testsuite/gcc.dg/pr47684.c: In function 'foo':
/Users/sabrinasouto/Downloads/gcc_trunk/trunk/gcc/testsuite/gcc.dg/pr47684.c:10:1: error: no immediate_use list
for SSA_NAME: _16 in statement:
_13 = PHI <pretmp_103(8), _16(4)>
PHI argument
_16
for PHI node
_13 = PHI <pretmp_103(8), _16(4)>
/Users/sabrinasouto/Downloads/gcc_trunk/trunk/gcc/testsuite/gcc.dg/pr47684.c:10:1: internal compiler error: verify_ssa failed

/Users/sabrinasouto/Downloads/gcc_trunk/trunk/gcc/testsuite/gcc.dg/pr47684.c:10:1: internal compiler error: Abort trap: 6
xgcc: internal compiler error: Abort trap: 6 (program cc1)

FAIL: gcc.dg/pr47684.c (internal compiler error)
FAIL: gcc.dg/pr47684.c (test for excess errors)
Excess errors:
/Users/sabrinasouto/Downloads/gcc_trunk/trunk/gcc/testsuite/gcc.dg/pr47684.c:10:1: error: no immediate_use list
for SSA_NAME: _16 in statement:
_13 = PHI <pretmp_103(8), _16(4)>
PHI argument
_16
for PHI node
_13 = PHI <pretmp_103(8), _16(4)>
/Users/sabrinasouto/Downloads/gcc_trunk/trunk/gcc/testsuite/gcc.dg/pr47684.c:10:1: internal compiler error: verify_ssa failed
/Users/sabrinasouto/Downloads/gcc_trunk/trunk/gcc/testsuite/gcc.dg/pr47684.c:10:1: internal compiler error: Abort trap: 6
xgcc: internal compiler error: Abort trap: 6 (program cc1)
------------------------------------------------------------------------

Can anyone confirm this bug?


Thanks,
Sabrina Souto.
Comment 1 Dominique d'Humieres 2014-08-08 20:55:32 UTC
Confirmed on x86_64-apple-darwin13 at revision r213759, revision r213645 is OK.
Comment 2 Dominique d'Humieres 2014-08-08 20:57:04 UTC
Marked as a regression.
Comment 3 Richard Biener 2014-08-11 10:49:51 UTC
Fails since 4.6 at least.  Predictive commoning gets confused.  Not sure if really a regression.  Note that you need checking enabled.

We end up here

static void
execute_pred_commoning_chain (struct loop *loop, chain_p chain,
                             bitmap tmp_vars)
{
  unsigned i;
  dref a;
  tree var;

  if (chain->combined)
    {
      /* For combined chains, just remove the statements that are used to
         compute the values of the expression (except for the root one).  */
      for (i = 1; chain->refs.iterate (i, &a); i++)
        remove_stmt (a->stmt);

failing to realize that unrolling may end up creating new PHIs.

Note that predcom does just fine in the end - it just is "broken" by
the intermittent verification in gimple_duplicate_loop_to_header_edge.
That is already skipped in some cases so just remove it completely now.
Comment 4 Richard Biener 2014-08-11 10:55:38 UTC
Fixed on trunk.
Comment 5 Richard Biener 2014-08-11 10:55:44 UTC
Author: rguenth
Date: Mon Aug 11 10:55:10 2014
New Revision: 213810

URL: https://gcc.gnu.org/viewcvs?rev=213810&root=gcc&view=rev
Log:
2014-08-11  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/62070
	* tree-ssa-loop-manip.c (gimple_duplicate_loop_to_header_edge):
	Remove SSA checking.

	* gcc.dg/pr62070.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/pr62070.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-loop-manip.c