Bug 90278 - ICE: verify_gimple failed (error: statement marked for throw, but doesn't)
Summary: ICE: verify_gimple failed (error: statement marked for throw, but doesn't)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: 7.5
Assignee: Richard Biener
URL:
Keywords: ice-checking, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2019-04-29 12:35 UTC by Arseny Solokha
Modified: 2019-09-03 11:56 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work: 10.0, 7.4.1, 8.3.1, 9.2.1
Known to fail: 6.3.0, 7.3.0, 7.4.0, 8.3.0, 9.2.0
Last reconfirmed: 2019-04-29 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arseny Solokha 2019-04-29 12:35:36 UTC
gcc-9.0.0-alpha20190428 snapshot (r270633), 8.3, 7.3, 6.3 all ICE when compiling the following testcase at any optimization level (except -Ofast) and w/ -fexceptions -fnon-call-exceptions:

double
hc (void)
{
  double dp = 0.0;
  double ek[1];

  ek[0] = 1.0 / dp < 0.0;

  return ek[0];
}

% gcc-9.0.0-alpha20190428 -O1 -fexceptions -fnon-call-exceptions -c dhh1zxr0.c
dhh1zxr0.c: In function 'hc':
dhh1zxr0.c:10:1: error: statement marked for throw, but doesn't
   10 | }
      | ^
_6 = 0;
during GIMPLE pass: forwprop
dhh1zxr0.c:10:1: internal compiler error: verify_gimple failed
0xd992ed verify_gimple_in_cfg(function*, bool)
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190428/work/gcc-9-20190428/gcc/tree-cfg.c:5386
0xc6c24f execute_function_todo
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190428/work/gcc-9-20190428/gcc/passes.c:1977
0xc6d16e execute_todo
	/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190428/work/gcc-9-20190428/gcc/passes.c:2031
Comment 1 Richard Biener 2019-04-29 12:44:48 UTC
Confirmed.  forward_propagate_into_comparison changes

_5 = 1.0/0.0;
_6 = _5 < 0.0;

into

_6 = false;

but fails to clear EH info.
Comment 2 Richard Biener 2019-04-29 17:54:07 UTC
Author: rguenth
Date: Mon Apr 29 17:53:36 2019
New Revision: 270657

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

	PR tree-optimization/90278
	* tree-ssa-forwprop.c (pass_forwprop::execute): Transfer/clean
	EH on comparison simplification.

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

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr90278.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-forwprop.c
Comment 3 Richard Biener 2019-04-29 17:54:18 UTC
Fixed on trunk sofar.
Comment 4 Richard Biener 2019-08-30 11:44:04 UTC
Author: rguenth
Date: Fri Aug 30 11:43:33 2019
New Revision: 275103

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

	Backport from mainline
	2019-06-18  Richard Biener  <rguenther@suse.de>

	PR debug/90900
	* cfgexpand.c (expand_debug_expr): Treat NOTE_P DECL_RTL
	as if optimized away.

	* gcc.dg/gomp/pr90900.c: New testcase.

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

	PR c/90474
	* c-common.c (c_common_mark_addressable_vec): Also mark
	a COMPOUND_LITERAL_EXPR_DECL addressable similar to
	c_mark_addressable.

	2019-04-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90278
	* tree-ssa-forwprop.c (pass_forwprop::execute): Transfer/clean
	EH on comparison simplification.

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

	2019-04-25  Richard Biener  <rguenther@suse.de>

	PR middle-end/90194
	* match.pd: Add pattern to simplify view-conversion of an
	empty constructor.

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

Added:
    branches/gcc-8-branch/gcc/testsuite/g++.dg/torture/pr90194.C
    branches/gcc-8-branch/gcc/testsuite/gcc.dg/gomp/pr90900.c
    branches/gcc-8-branch/gcc/testsuite/gcc.dg/torture/pr90278.c
Modified:
    branches/gcc-8-branch/gcc/ChangeLog
    branches/gcc-8-branch/gcc/c-family/ChangeLog
    branches/gcc-8-branch/gcc/c-family/c-common.c
    branches/gcc-8-branch/gcc/cfgexpand.c
    branches/gcc-8-branch/gcc/match.pd
    branches/gcc-8-branch/gcc/testsuite/ChangeLog
    branches/gcc-8-branch/gcc/tree-ssa-forwprop.c
Comment 5 Richard Biener 2019-08-30 13:15:30 UTC
Author: rguenth
Date: Fri Aug 30 13:14:59 2019
New Revision: 275167

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

	Backport from mainline
	2019-04-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90278
	* tree-ssa-forwprop.c (pass_forwprop::execute): Transfer/clean
	EH on comparison simplification.

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

Added:
    branches/gcc-9-branch/gcc/testsuite/gcc.dg/torture/pr90278.c
Modified:
    branches/gcc-9-branch/gcc/ChangeLog
    branches/gcc-9-branch/gcc/testsuite/ChangeLog
    branches/gcc-9-branch/gcc/tree-ssa-forwprop.c
Comment 6 Richard Biener 2019-09-02 12:56:55 UTC
Author: rguenth
Date: Mon Sep  2 12:56:24 2019
New Revision: 275317

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

	Backport from mainline
	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 (n_walk_cb_data::push_partial_def): Adjust
	native encoding offset for BYTES_BIG_ENDIAN.
	(vn_reference_lookup_3): Likewise.

	* gcc.dg/torture/pr91126.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.

	2019-04-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90278
	* tree-ssa-forwprop.c (pass_forwprop::execute): Transfer/clean
	EH on comparison simplification.

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

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

	PR tree-optimization/90020
	* tree-ssa-sccvn.c (vn_reference_may_trap): New function.
	* tree-ssa-sccvn.h (vn_reference_may_trap): Declare.
	* tree-ssa-pre.c (compute_avail): Use it to not put
	possibly trapping references after a call that might not
	return into EXP_GEN.
	* gcse.c (compute_hash_table_work): Do not elide
	marking a block containing a call if the call might not
	return.

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

Added:
    branches/gcc-7-branch/gcc/testsuite/gcc.dg/autopar/pr91162.c
    branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr90020.c
    branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr90278.c
    branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr91126.c
    branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr91200.c
    branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr91131.c
Modified:
    branches/gcc-7-branch/gcc/ChangeLog
    branches/gcc-7-branch/gcc/gcse.c
    branches/gcc-7-branch/gcc/gimplify.c
    branches/gcc-7-branch/gcc/testsuite/ChangeLog
    branches/gcc-7-branch/gcc/tree-cfg.c
    branches/gcc-7-branch/gcc/tree-ssa-forwprop.c
    branches/gcc-7-branch/gcc/tree-ssa-phiopt.c
    branches/gcc-7-branch/gcc/tree-ssa-pre.c
    branches/gcc-7-branch/gcc/tree-ssa-sccvn.c
    branches/gcc-7-branch/gcc/tree-ssa-sccvn.h
Comment 7 Richard Biener 2019-09-02 12:57:47 UTC
Fixed.
Comment 8 Richard Biener 2019-09-03 11:56:16 UTC
Really.