Bug 81799 - [8 Regression] ICE on valid code at -O3: verify_gimple failed
Summary: [8 Regression] ICE on valid code at -O3: verify_gimple failed
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 8.0
: P3 normal
Target Milestone: 8.0
Assignee: bin cheng
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2017-08-10 14:44 UTC by Zhendong Su
Modified: 2017-10-11 10:41 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2017-08-10 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zhendong Su 2017-08-10 14:44:35 UTC
$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto --prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 8.0.0 20170810 (experimental) [trunk revision 251019] (GCC)
$
$ gcc-trunk -O2 -c small.c
$
$ gcc-trunk -O3 -c small.c
small.c: In function ‘fn1’:
small.c:5:6: error: invalid argument to gimple call
 void fn1 (int h)
      ^~~
&e > 3B
_33 = LOOP_DIST_ALIAS (4, &e > 3B);
during GIMPLE pass: ldist
small.c:5:6: internal compiler error: verify_gimple failed
0xcb091b verify_gimple_in_cfg(function*, bool)
        ../../gcc-source-trunk/gcc/tree-cfg.c:5310
0xb75202 execute_function_todo
        ../../gcc-source-trunk/gcc/passes.c:1992
0xb75ba9 execute_todo
        ../../gcc-source-trunk/gcc/passes.c:2046
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
$


------------------------------------


int printf (const char *, ...);

int a, c[1], d, e, **f;

void fn1 (int h)
{ 
  int *i = 0;
  for (d = 0; d < 1; d++)
    { 
      if (d)
        continue;
      for (; e; e++)
        { 
          a = c[*i];
          if (h)
            printf ("0");
        }
      return;
    }
  f = &i;
}
Comment 1 Martin Liška 2017-08-10 19:32:29 UTC
Confirmed, started with -ftree-loop-distribution in r249994.
Comment 2 bin cheng 2017-08-11 08:17:32 UTC
Thanks for reporting, I will investigate.
Comment 3 Aldy Hernandez 2017-09-13 16:57:43 UTC
Author: aldyh
Date: Wed Sep 13 16:57:11 2017
New Revision: 252424

URL: https://gcc.gnu.org/viewcvs?rev=252424&root=gcc&view=rev
Log:
	PR tree-optimization/81799
	* tree-loop-distribution.c (version_loop_by_alias_check): Force
	cond_expr to simple gimple operand.

	gcc/testsuite
	* gcc.dg/tree-ssa/pr81799.c: New.

Added:
    branches/range-gen2/gcc/testsuite/gcc.dg/tree-ssa/pr81799.c
Modified:
    branches/range-gen2/gcc/ChangeLog
    branches/range-gen2/gcc/testsuite/ChangeLog
    branches/range-gen2/gcc/tree-loop-distribution.c
Comment 4 Jakub Jelinek 2017-10-11 10:41:12 UTC
Author: amker
Date: Mon Aug 14 11:46:03 2017
New Revision: 251088

URL: https://gcc.gnu.org/viewcvs?rev=251088&root=gcc&view=rev
Log:
	PR tree-optimization/81799
	* tree-loop-distribution.c (version_loop_by_alias_check): Force
	cond_expr to simple gimple operand.

	gcc/testsuite
	* gcc.dg/tree-ssa/pr81799.c: New.

Added:
    trunk/gcc/testsuite/gcc.dg/tree-ssa/pr81799.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-loop-distribution.c