Bug 84399 - [8 Regression] [graphite] ICE in set_codegen_error, at graphite-isl-ast-to-gimple.c:206
Summary: [8 Regression] [graphite] ICE in set_codegen_error, at graphite-isl-ast-to-gi...
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: Richard Biener
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2018-02-15 03:03 UTC by Arseny Solokha
Modified: 2018-02-16 08:16 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2018-02-15 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arseny Solokha 2018-02-15 03:03:55 UTC
scev-max-expr-size once again.

gcc-8.0.0-alpha20180211 snapshot (r257571) ICEs when compiling the following snippet w/ -O2 -floop-nest-optimize -fno-tree-loop-im --param scev-max-expr-size=1:

void
h8 (int cv, int od)
{
  for (;;)
    {
      int ih = &od;

      if (cv == 0)
        while (od < 1)
          {
            int lq;

            for (lq = 0; lq < 3; ++lq)
              for (ih = 0; ih < 4; ++ih)
                od += lq;
          }

      while (ih < 1)
        {
        }
    }
}

% gcc-8.0.0-alpha20180211 -O2 -floop-nest-optimize -fno-tree-loop-im --param scev-max-expr-size=1 -w -c wucxhfnm.c
during GIMPLE pass: graphite
wucxhfnm.c: In function 'h8':
wucxhfnm.c:2:1: internal compiler error: in set_codegen_error, at graphite-isl-ast-to-gimple.c:206
 h8 (int cv, int od)
 ^~
0x7244e2 translate_isl_ast_to_gimple::set_codegen_error()
	/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/graphite-isl-ast-to-gimple.c:205
0x724730 translate_isl_ast_to_gimple::set_codegen_error()
	/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/tree.h:3246
0x724730 translate_isl_ast_to_gimple::get_rename_from_scev(tree_node*, gimple**, loop*, vec<tree_node*, va_heap, vl_ptr>)
	/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/graphite-isl-ast-to-gimple.c:1102
0x1457d59 translate_isl_ast_to_gimple::graphite_copy_stmts_from_block(basic_block_def*, basic_block_def*, vec<tree_node*, va_heap, vl_ptr>)
	/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/graphite-isl-ast-to-gimple.c:1221
0x1458749 translate_isl_ast_to_gimple::copy_bb_and_scalar_dependences(basic_block_def*, edge_def*, vec<tree_node*, va_heap, vl_ptr>)
	/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/graphite-isl-ast-to-gimple.c:1270
0x1458ec1 translate_isl_ast_to_gimple::translate_isl_ast_node_user(isl_ast_node*, edge_def*, std::map<isl_id*, tree_node*, std::less<isl_id*>, std::allocator<std::pair<isl_id* const, tree_node*> > >&)
	/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/graphite-isl-ast-to-gimple.c:830
0x1459085 translate_isl_ast_to_gimple::translate_isl_ast_for_loop(loop*, isl_ast_node*, edge_def*, tree_node*, tree_node*, tree_node*, std::map<isl_id*, tree_node*, std::less<isl_id*>, std::allocator<std::pair<isl_id* const, tree_node*> > >&)
	/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/graphite-isl-ast-to-gimple.c:623
0x1459359 translate_isl_ast_to_gimple::translate_isl_ast_node_for(loop*, isl_ast_node*, edge_def*, std::map<isl_id*, tree_node*, std::less<isl_id*>, std::allocator<std::pair<isl_id* const, tree_node*> > >&)
	/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/graphite-isl-ast-to-gimple.c:751
0x1459584 translate_isl_ast_to_gimple::translate_isl_ast_node_block(loop*, isl_ast_node*, edge_def*, std::map<isl_id*, tree_node*, std::less<isl_id*>, std::allocator<std::pair<isl_id* const, tree_node*> > >&)
	/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/graphite-isl-ast-to-gimple.c:859
0x1459584 translate_isl_ast_to_gimple::translate_isl_ast_node_block(loop*, isl_ast_node*, edge_def*, std::map<isl_id*, tree_node*, std::less<isl_id*>, std::allocator<std::pair<isl_id* const, tree_node*> > >&)
	/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/graphite-isl-ast-to-gimple.c:859
0x1459584 translate_isl_ast_to_gimple::translate_isl_ast_node_block(loop*, isl_ast_node*, edge_def*, std::map<isl_id*, tree_node*, std::less<isl_id*>, std::allocator<std::pair<isl_id* const, tree_node*> > >&)
	/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/graphite-isl-ast-to-gimple.c:859
0x1459085 translate_isl_ast_to_gimple::translate_isl_ast_for_loop(loop*, isl_ast_node*, edge_def*, tree_node*, tree_node*, tree_node*, std::map<isl_id*, tree_node*, std::less<isl_id*>, std::allocator<std::pair<isl_id* const, tree_node*> > >&)
	/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/graphite-isl-ast-to-gimple.c:623
0x1459359 translate_isl_ast_to_gimple::translate_isl_ast_node_for(loop*, isl_ast_node*, edge_def*, std::map<isl_id*, tree_node*, std::less<isl_id*>, std::allocator<std::pair<isl_id* const, tree_node*> > >&)
	/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/graphite-isl-ast-to-gimple.c:751
0x1459584 translate_isl_ast_to_gimple::translate_isl_ast_node_block(loop*, isl_ast_node*, edge_def*, std::map<isl_id*, tree_node*, std::less<isl_id*>, std::allocator<std::pair<isl_id* const, tree_node*> > >&)
	/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/graphite-isl-ast-to-gimple.c:859
0x145996c graphite_regenerate_ast_isl(scop*)
	/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/graphite-isl-ast-to-gimple.c:1505
0x1455ac3 graphite_transform_loops()
	/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/graphite.c:413
0x1455fd0 graphite_transforms
	/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/graphite.c:475
0x1455fd0 execute
	/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180211/work/gcc-8-20180211/gcc/graphite.c:552
Comment 1 Richard Biener 2018-02-15 13:40:48 UTC
I have a patch.  We are failing to properly verify SCEV analyses we rely on later.
Comment 2 Richard Biener 2018-02-16 08:16:40 UTC
Fixed.
Comment 3 Richard Biener 2018-02-16 08:16:50 UTC
Author: rguenth
Date: Fri Feb 16 08:16:17 2018
New Revision: 257723

URL: https://gcc.gnu.org/viewcvs?rev=257723&root=gcc&view=rev
Log:
2018-02-16  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/84399
	* graphite-scop-detection.c (scop_detection::stmt_simple_for_scop_p):
	For operands we can analyze at their definition make sure we can
	analyze them at each use as well.

	* gcc.dg/graphite/pr84399.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/graphite/pr84399.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/graphite-scop-detection.c
    trunk/gcc/testsuite/ChangeLog