Bug 87785 - [9 Regression] ICE in dr_misalignment, at tree-vectorizer.h:1245 on 454.calculix with -Ofast and -flto
Summary: [9 Regression] ICE in dr_misalignment, at tree-vectorizer.h:1245 on 454.calcu...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: 9.0
Assignee: Richard Biener
URL:
Keywords:
: 87801 (view as bug list)
Depends on:
Blocks: spec
  Show dependency treegraph
 
Reported: 2018-10-29 08:28 UTC by Martin Liška
Modified: 2018-10-30 08:06 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 8.2.0
Known to fail: 9.0
Last reconfirmed: 2018-10-29 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2018-10-29 08:28:25 UTC
I see following ICE on a Haswell machine:

during GIMPLE pass: vect
SPOOLES/SubMtx/src/SubMtx_solve.c: In function 'SubMtx_solve':
SPOOLES/SubMtx/src/SubMtx_solve.c:45:1: internal compiler error: in dr_misalignment, at tree-vectorizer.h:1245
   45 | SubMtx_solve (
      | ^
0x783bf2 dr_misalignment(dr_vec_info*)
	/home/marxin/Programming/gcc/gcc/tree-vectorizer.h:1245
0x784cf4 dr_misalignment(dr_vec_info*)
	/home/marxin/Programming/gcc/gcc/tree.h:3232
0x784cf4 aligned_access_p
	/home/marxin/Programming/gcc/gcc/tree-vectorizer.h:1263
0x784cf4 vect_supportable_dr_alignment(dr_vec_info*, bool)
	/home/marxin/Programming/gcc/gcc/tree-vect-data-refs.c:6324
0xe85f6d vect_get_load_cost(_stmt_vec_info*, int, bool, unsigned int*, unsigned int*, vec<stmt_info_for_cost, va_heap, vl_ptr>*, vec<stmt_info_for_cost, va_heap, vl_ptr>*, bool)
	/home/marxin/Programming/gcc/gcc/tree-vect-stmts.c:1231
0xe9f21d vect_model_load_cost
	/home/marxin/Programming/gcc/gcc/tree-vect-stmts.c:1205
0xe9f21d vectorizable_load
	/home/marxin/Programming/gcc/gcc/tree-vect-stmts.c:7595
0xea3ab2 vect_analyze_stmt(_stmt_vec_info*, bool*, _slp_tree*, _slp_instance*, vec<stmt_info_for_cost, va_heap, vl_ptr>*)
	/home/marxin/Programming/gcc/gcc/tree-vect-stmts.c:9568
0xecc346 vect_slp_analyze_node_operations_1
	/home/marxin/Programming/gcc/gcc/tree-vect-slp.c:2457
0xecc346 vect_slp_analyze_node_operations
	/home/marxin/Programming/gcc/gcc/tree-vect-slp.c:2504
0xecc23d vect_slp_analyze_node_operations
	/home/marxin/Programming/gcc/gcc/tree-vect-slp.c:2495
0xecc23d vect_slp_analyze_node_operations
	/home/marxin/Programming/gcc/gcc/tree-vect-slp.c:2495
0xecc23d vect_slp_analyze_node_operations
	/home/marxin/Programming/gcc/gcc/tree-vect-slp.c:2495
0xecc23d vect_slp_analyze_node_operations
	/home/marxin/Programming/gcc/gcc/tree-vect-slp.c:2495
0xecc23d vect_slp_analyze_node_operations
	/home/marxin/Programming/gcc/gcc/tree-vect-slp.c:2495
0xecc23d vect_slp_analyze_node_operations
	/home/marxin/Programming/gcc/gcc/tree-vect-slp.c:2495
0xed09ae vect_slp_analyze_operations(vec_info*)
	/home/marxin/Programming/gcc/gcc/tree-vect-slp.c:2536
0xed3371 vect_slp_analyze_bb_1
	/home/marxin/Programming/gcc/gcc/tree-vect-slp.c:2844
0xed3371 vect_slp_bb(basic_block_def*)
	/home/marxin/Programming/gcc/gcc/tree-vect-slp.c:2931
0xed87c9 try_vectorize_loop_1
	/home/marxin/Programming/gcc/gcc/tree-vectorizer.c:926
Comment 1 Martin Liška 2018-10-29 08:35:45 UTC
Started with r265522.
Comment 2 Richard Biener 2018-10-29 09:25:00 UTC
Mine.
Comment 3 Richard Biener 2018-10-29 11:46:48 UTC
With the right set of caching/failing events we miss loads for slp_instance->loads.  I have a patch gathering loads after the fact which fixes the issue but I don't have a nice testcase.
Comment 4 Richard Biener 2018-10-29 13:32:01 UTC
Author: rguenth
Date: Mon Oct 29 13:31:28 2018
New Revision: 265588

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

	PR tree-optimization/87785
	* tree-vect-slp.c (vect_build_slp_tree_2): Remove loads argument
	and processing.
	(vect_build_slp_tree): Likewise.
	(vect_gather_slp_loads): New function.
	(vect_analyze_slp_instance): Gather loads separately from the
	SLP tree build.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-vect-slp.c
Comment 5 Richard Biener 2018-10-29 13:35:15 UTC
Fixed.
Comment 6 Richard Biener 2018-10-29 15:43:39 UTC
Author: rguenth
Date: Mon Oct 29 15:43:08 2018
New Revision: 265596

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

	PR tree-optimization/87785
	* tree-vect-slp.c (vect_gather_slp_loads): Only gather
	internal defs.

	* gcc.dg/torture/20181029-1.c: New testcase.
	* gcc.dg/torture/20181029-2.c: Likewise.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/20181029-1.c
    trunk/gcc/testsuite/gcc.dg/torture/20181029-2.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-slp.c
Comment 7 Martin Liška 2018-10-30 08:06:45 UTC
*** Bug 87801 has been marked as a duplicate of this bug. ***