Bug 82264 - [6 Regression] ICE in vn_phi_lookup at gcc/tree-ssa-sccvn.c:3125
Summary: [6 Regression] ICE in vn_phi_lookup at gcc/tree-ssa-sccvn.c:3125
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 7.1.1
: P2 normal
Target Milestone: 6.5
Assignee: Richard Biener
URL:
Keywords: ice-on-valid-code
: 82492 82759 83482 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-09-19 22:12 UTC by etienne_lorrain
Modified: 2018-06-20 11:10 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.9.4, 5.4.0, 6.3.0, 6.4.1, 7.1.0, 7.2.1, 8.0
Known to fail: 6.4.0, 7.2.0
Last reconfirmed: 2017-09-20 00:00:00


Attachments
preprocessed source (60.08 KB, text/x-csrc)
2017-09-19 22:12 UTC, etienne_lorrain
Details

Note You need to log in before you can comment on or make changes to this bug.
Description etienne_lorrain 2017-09-19 22:12:48 UTC
Created attachment 42208 [details]
preprocessed source

Trying to update the gujin bootloader (compiling/working no problem with older gcc), contains a lot of inline assembler.
Got the fault by just:
/usr/libexec/gcc/x86_64-redhat-linux/7/cc1 -m32 -Os -fgnu89-inline  /tmp/cc9y7CiU.out
Default compiler Fedora26:
gcc version 7.1.1 20170622 (Red Hat 7.1.1-3) (GCC) 
Just got this message:
util.c: In function ‘detect_processor.constprop’:
util.c:531:1: internal compiler error: Segmentation fault
 detect_processor (struct processor_str *processor)
 ^~~~~~~~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.

Thanks, Etienne.
Comment 1 Martin Liška 2017-09-20 06:30:54 UTC
Confirmed. Started with r247024.

Reduced test-case:

$ cat pr82264-2.i
char a;
int c;
unsigned b ();
unsigned
setjmp ()
{
}
static void
d ()
{
  if (b ())
    c = 3;
}
void
e ()
{
  d ();
  a && ({ setjmp (); });
}

$ gcc pr82264-2.i  -Os 
pr82264-2.i: In function ‘e’:
pr82264-2.i:15:1: internal compiler error: Segmentation fault
 e ()
 ^
Comment 2 Richard Biener 2017-09-20 08:04:34 UTC
Mine.
Comment 3 Richard Biener 2017-09-20 11:09:07 UTC
Author: rguenth
Date: Wed Sep 20 11:08:35 2017
New Revision: 253005

URL: https://gcc.gnu.org/viewcvs?rev=253005&root=gcc&view=rev
Log:
2017-09-20  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82264
	* tree-ssa-sccvn.c (vn_phi_eq): Use safe_dyn_cast to check
	for GIMPLE_CONDs.
	(vn_phi_lookup): Likewise.
	(vn_phi_insert): Likewise.

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

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr82264.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-sccvn.c
Comment 4 Richard Biener 2017-09-26 10:17:13 UTC
Author: rguenth
Date: Tue Sep 26 10:16:40 2017
New Revision: 253190

URL: https://gcc.gnu.org/viewcvs?rev=253190&root=gcc&view=rev
Log:
2017-09-26  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2017-09-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82244
	* tree-vrp.c (remove_range_assertions): Do not propagate
	a constant to abnormals but replace the assert with a copy.

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

	2017-09-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82276
	PR tree-optimization/82244
	* tree-vrp.c (build_assert_expr_for): Set
	SSA_NAME_OCCURS_IN_ABNORMAL_PHI if the variable we assert on
	has it set.
	(remove_range_assertions): Revert earlier change.

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

	2017-09-20  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82264
	* tree-ssa-sccvn.c (vn_phi_eq): Use safe_dyn_cast to check
	for GIMPLE_CONDs.
	(vn_phi_lookup): Likewise.
	(vn_phi_insert): Likewise.
	* is-a.h (safe_dyn_cast): New.

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

	2017-09-25  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82285
	* tree-vect-patterns.c (vect_recog_bool_pattern): Also handle
	enumeral types.

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

	2017-09-22  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82291
	* tree-if-conv.c (predicate_mem_writes): Make sure to
	remove writes in blocks predicated with false.

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

Added:
    branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr82244.c
    branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr82264.c
    branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr82276.c
    branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr82285.c
    branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr82291.c
Modified:
    branches/gcc-7-branch/gcc/ChangeLog
    branches/gcc-7-branch/gcc/is-a.h
    branches/gcc-7-branch/gcc/testsuite/ChangeLog
    branches/gcc-7-branch/gcc/tree-if-conv.c
    branches/gcc-7-branch/gcc/tree-ssa-sccvn.c
    branches/gcc-7-branch/gcc/tree-vect-patterns.c
    branches/gcc-7-branch/gcc/tree-vrp.c
Comment 5 Richard Biener 2017-10-09 14:12:06 UTC
*** Bug 82492 has been marked as a duplicate of this bug. ***
Comment 6 etienne_lorrain 2017-10-18 15:59:39 UTC
fixed for my testcase (tested gcc version 7.2.1 20171012), can be closed.
Thanks, Etienne.
Comment 7 Markus Trippelsdorf 2017-10-28 15:17:09 UTC
*** Bug 82759 has been marked as a duplicate of this bug. ***
Comment 8 Marek Polacek 2017-12-19 10:14:04 UTC
*** Bug 83482 has been marked as a duplicate of this bug. ***
Comment 9 Richard Biener 2018-06-20 11:10:00 UTC
Author: rguenth
Date: Wed Jun 20 11:09:28 2018
New Revision: 261799

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

	Backport from mainline
	2018-01-01  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/83623
	* expmed.c (expand_shift_1): For 2-byte rotates by BITS_PER_UNIT,
	check for bswap in mode rather than HImode and use that in expand_unop
	too.

	* gcc.dg/pr83623.c: New test.

	2017-09-26  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2017-09-20  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82264
	* tree-ssa-sccvn.c (vn_phi_eq): Use safe_dyn_cast to check
	for GIMPLE_CONDs.
	(vn_phi_lookup): Likewise.
	(vn_phi_insert): Likewise.
	* is-a.h (safe_dyn_cast): New.

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

	2017-09-25  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82285
	* tree-vect-patterns.c (vect_recog_bool_pattern): Also handle
	enumeral types.

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

	2017-11-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82402
	* tree-vect-loop-manip.c (create_lcssa_for_virtual_phi): Properly
	set SSA_NAME_OCCURS_IN_ABNORMAL_PHI.

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

	2017-10-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82697
	* tree-ssa-phiopt.c (cond_store_replacement): Use alias-set
	zero for conditional load and unconditional store.

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

	2017-11-02  Richard Biener  <rguenther@suse.de>

	PR middle-end/82765
	* varasm.c (decode_addr_const): Make offset HOST_WIDE_INT.
	Truncate ARRAY_REF index and element size.

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

	2018-01-08  Richard Biener  <rguenther@suse.de>

	PR middle-end/83713
	* convert.c (do_narrow): Properly guard TYPE_OVERFLOW_WRAPS checks.

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

Added:
    branches/gcc-6-branch/gcc/testsuite/g++.dg/torture/pr83713.C
    branches/gcc-6-branch/gcc/testsuite/gcc.dg/pr82765.c
    branches/gcc-6-branch/gcc/testsuite/gcc.dg/pr83623.c
    branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr82264.c
    branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr82285.c
    branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr82402.c
    branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr82697.c
Modified:
    branches/gcc-6-branch/gcc/ChangeLog
    branches/gcc-6-branch/gcc/convert.c
    branches/gcc-6-branch/gcc/expmed.c
    branches/gcc-6-branch/gcc/is-a.h
    branches/gcc-6-branch/gcc/testsuite/ChangeLog
    branches/gcc-6-branch/gcc/tree-ssa-alias.c
    branches/gcc-6-branch/gcc/tree-ssa-phiopt.c
    branches/gcc-6-branch/gcc/tree-ssa-sccvn.c
    branches/gcc-6-branch/gcc/tree-vect-loop-manip.c
    branches/gcc-6-branch/gcc/tree-vect-patterns.c
    branches/gcc-6-branch/gcc/varasm.c
Comment 10 Richard Biener 2018-06-20 11:10:16 UTC
Fixed.