Bug 91280 - [8 Regression] ICE in get_constraint_for_component_ref, at tree-ssa-structalias.c:3259 since r260354
Summary: [8 Regression] ICE in get_constraint_for_component_ref, at tree-ssa-structali...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: 8.4
Assignee: Richard Biener
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2019-07-28 06:44 UTC by Martin Liška
Modified: 2019-08-30 11:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 10.0, 8.3.1, 9.1.1
Known to fail: 8.3.0, 9.1.0
Last reconfirmed: 2019-07-28 00:00:00


Attachments
test-case (1.79 KB, text/plain)
2019-07-28 06:44 UTC, Martin Liška
Details
Reduced test-case w/o errors (1.75 KB, text/plain)
2019-07-30 06:34 UTC, Martin Liška
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2019-07-28 06:44:21 UTC
Created attachment 46632 [details]
test-case

Following test-case causes ICE:

$ gcc-9 -O2 batch.ii -c
batch.ii: In lambda function:
batch.ii:246:54: warning: no return statement in function returning non-void [-Wreturn-type]
  246 | I registrar__body__1__object([](int *) -> A * { K(); });
      |                                                      ^
during GIMPLE pass: alias
batch.ii: In constructor ‘K::K()’:
batch.ii:233:3: internal compiler error: in get_constraint_for_component_ref, at tree-ssa-structalias.c:3259
  233 |   K() : A(&BatchMatMul_context) {
      |   ^
0x7f34ecbccbca __libc_start_main
	../csu/libc-start.c:308
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://bugs.opensuse.org/> for instructions.
Comment 1 Richard Biener 2019-07-29 09:19:04 UTC
Hmm, this has earlier errors:

t.ii:123:20: error: invalid use of incomplete type ‘class TensorMap<Trans_NS_Eigen_Tensor<int, 3, 0, int>, 0>’
  123 |   static const int NumInputDims = H<typename ArgType::Dimensions>::value;
      |                    ^~~~~~~~~~~~

so - too much testcase reduction?

But yeah, I can see what goes wrong - get_constraint_for_component_ref
doesn't expect get_constraint_for_1 on the base, here MEM[&decl + 16],
to return multiple constraints but when decl has subvars then if
&decl + 16 is not exactly at a subvar we'll include the next as well.
Comment 2 Martin Liška 2019-07-29 12:05:56 UTC
(In reply to Richard Biener from comment #1)
> Hmm, this has earlier errors:
> 
> t.ii:123:20: error: invalid use of incomplete type ‘class
> TensorMap<Trans_NS_Eigen_Tensor<int, 3, 0, int>, 0>’
>   123 |   static const int NumInputDims = H<typename
> ArgType::Dimensions>::value;
>       |                    ^~~~~~~~~~~~
> 
> so - too much testcase reduction?

Yep. It's interesting that I don't see the error when I configure a compiler with --enable-checking=release. Lemme investigate that.

> 
> But yeah, I can see what goes wrong - get_constraint_for_component_ref
> doesn't expect get_constraint_for_1 on the base, here MEM[&decl + 16],
> to return multiple constraints but when decl has subvars then if
> &decl + 16 is not exactly at a subvar we'll include the next as well.
Comment 3 Martin Liška 2019-07-30 06:34:23 UTC
Created attachment 46641 [details]
Reduced test-case w/o errors
Comment 4 Richard Biener 2019-07-31 14:38:53 UTC
Author: rguenth
Date: Wed Jul 31 14:38:21 2019
New Revision: 273936

URL: https://gcc.gnu.org/viewcvs?rev=273936&root=gcc&view=rev
Log:
2019-07-31  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91280
	* tree-ssa-structalias.c (get_constraint_for_component_ref):
	Decompose MEM_REF manually for offset handling.

	* g++.dg/torture/pr91280.C: New testcase.

Added:
    trunk/gcc/testsuite/g++.dg/torture/pr91280.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-structalias.c
Comment 5 Richard Biener 2019-07-31 14:39:01 UTC
Fixed on trunk.
Comment 6 Richard Biener 2019-08-02 12:08:05 UTC
Author: rguenth
Date: Fri Aug  2 12:07:33 2019
New Revision: 274007

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

	Backport from mainline
	2019-07-31  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91280
	* tree-ssa-structalias.c (get_constraint_for_component_ref):
	Decompose MEM_REF manually for offset handling.

	* g++.dg/torture/pr91280.C: New testcase.

	2019-07-31  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91293
	* tree-vect-slp.c (vect_build_slp_tree_2): Do not swap operands
	of reduction stmts.

	* gcc.dg/vect/pr91293-1.c: New testcase.
	* gcc.dg/vect/pr91293-2.c: Likewise.
	* gcc.dg/vect/pr91293-3.c: Likewise.

Added:
    branches/gcc-9-branch/gcc/testsuite/g++.dg/torture/pr91280.C
    branches/gcc-9-branch/gcc/testsuite/gcc.dg/vect/pr91293-1.c
    branches/gcc-9-branch/gcc/testsuite/gcc.dg/vect/pr91293-2.c
    branches/gcc-9-branch/gcc/testsuite/gcc.dg/vect/pr91293-3.c
Modified:
    branches/gcc-9-branch/gcc/ChangeLog
    branches/gcc-9-branch/gcc/testsuite/ChangeLog
    branches/gcc-9-branch/gcc/tree-ssa-structalias.c
    branches/gcc-9-branch/gcc/tree-vect-slp.c
Comment 7 Richard Biener 2019-08-30 11:39:50 UTC
Author: rguenth
Date: Fri Aug 30 11:39:19 2019
New Revision: 275100

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

	Backport from mainline
	2019-08-12  Richard Biener  <rguenther@suse.de>

	PR lto/91375
	* tree.c (free_lang_data_in_type): Do not free TYPE_BINFO dependent on
	flag_devirtualize.

	2019-07-31  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91293
	* tree-vect-slp.c (vect_build_slp_tree_2): Do not swap operands
	of reduction stmts.

	* gcc.dg/vect/pr91293-1.c: New testcase.
	* gcc.dg/vect/pr91293-2.c: Likewise.
	* gcc.dg/vect/pr91293-3.c: Likewise.

	2019-07-31  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91280
	* tree-ssa-structalias.c (get_constraint_for_component_ref):
	Decompose MEM_REF manually for offset handling.

	* g++.dg/torture/pr91280.C: New testcase.

	2019-07-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91200
	* tree-ssa-phiopt.c (cond_store_replacement): Check we have
	no PHI nodes in middle-bb.

	* gcc.dg/torture/pr91200.c: New testcase.

	2019-07-15  Richard Biener  <rguenther@suse.de>

	PR middle-end/91162
	* tree-cfg.c (move_block_to_fn): When releasing a virtual PHI
	node make sure to replace all uses with something valid.

	* gcc.dg/autopar/pr91162.c: New testcase.

	2019-07-11  Richard Biener  <rguenther@suse.de>

	PR middle-end/91131
	* gimplify.c (gimplify_compound_literal_expr): Force a temporary
	when the object is volatile and we have not cleared it even though
	there are no nonzero elements.

	* gcc.target/i386/pr91131.c: New testcase.

	2019-07-10  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91126
	* tree-ssa-sccvn.c (vn_reference_lookup_3): Adjust
	native encoding offset for BYTES_BIG_ENDIAN.

	* gcc.dg/torture/pr91126.c: New testcase.

Added:
    branches/gcc-8-branch/gcc/testsuite/g++.dg/torture/pr91280.C
    branches/gcc-8-branch/gcc/testsuite/gcc.dg/autopar/pr91162.c
    branches/gcc-8-branch/gcc/testsuite/gcc.dg/torture/pr91126.c
    branches/gcc-8-branch/gcc/testsuite/gcc.dg/torture/pr91200.c
    branches/gcc-8-branch/gcc/testsuite/gcc.dg/vect/pr91293-1.c
    branches/gcc-8-branch/gcc/testsuite/gcc.dg/vect/pr91293-2.c
    branches/gcc-8-branch/gcc/testsuite/gcc.dg/vect/pr91293-3.c
    branches/gcc-8-branch/gcc/testsuite/gcc.target/i386/pr91131.c
Modified:
    branches/gcc-8-branch/gcc/ChangeLog
    branches/gcc-8-branch/gcc/gimplify.c
    branches/gcc-8-branch/gcc/testsuite/ChangeLog
    branches/gcc-8-branch/gcc/tree-cfg.c
    branches/gcc-8-branch/gcc/tree-ssa-phiopt.c
    branches/gcc-8-branch/gcc/tree-ssa-sccvn.c
    branches/gcc-8-branch/gcc/tree-ssa-structalias.c
    branches/gcc-8-branch/gcc/tree-vect-slp.c
    branches/gcc-8-branch/gcc/tree.c
Comment 8 Richard Biener 2019-08-30 11:49:11 UTC
Fixed.