Bug 47280 - [4.6 Regression] ICE: verify_stmts failed: statement marked for throw, but doesn't with -fnon-call-exceptions -ftrapv
Summary: [4.6 Regression] ICE: verify_stmts failed: statement marked for throw, but do...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.0
Assignee: Richard Biener
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2011-01-13 16:41 UTC by Zdenek Sojka
Modified: 2011-01-14 13:20 UTC (History)
2 users (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build:
Known to work:
Known to fail: 4.6.0
Last reconfirmed: 2011-01-13 18:22:46


Attachments
reduced testcase (from g++.dg/tree-ssa/pr38632.C) (101 bytes, text/plain)
2011-01-13 16:41 UTC, Zdenek Sojka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2011-01-13 16:41:20 UTC
Created attachment 22960 [details]
reduced testcase (from g++.dg/tree-ssa/pr38632.C)

Compiler output:
$ gcc -O -fnon-call-exceptions -ftrapv pr47280.C  
pr47280.C: In function 'void bar(int, char*)':
pr47280.C:1:6: error: statement marked for throw, but doesn't
D.2075_6 = n_2(D);

pr47280.C:1:6: internal compiler error: verify_stmts failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


(gdb) bt
#0  error (gmsgid=0x12a8c48 "statement marked for throw, but doesn%'t") at /mnt/svn/gcc-trunk/gcc/diagnostic.c:747
#1  0x0000000000a31d6d in verify_stmt () at /mnt/svn/gcc-trunk/gcc/tree-cfg.c:4175
#2  verify_stmts () at /mnt/svn/gcc-trunk/gcc/tree-cfg.c:4382
#3  0x0000000000b4551d in verify_ssa (check_modified_stmt=1 '\001') at /mnt/svn/gcc-trunk/gcc/tree-ssa.c:878
#4  0x0000000000934939 in execute_function_todo (data=<value optimized out>) at /mnt/svn/gcc-trunk/gcc/passes.c:1245
#5  0x000000000093502d in execute_todo (flags=2055) at /mnt/svn/gcc-trunk/gcc/passes.c:1276
#6  0x000000000093760f in execute_one_pass (pass=0x18dec40) at /mnt/svn/gcc-trunk/gcc/passes.c:1584
#7  0x00000000009378c5 in execute_pass_list (pass=0x18dec40) at /mnt/svn/gcc-trunk/gcc/passes.c:1616
#8  0x00000000009378d7 in execute_pass_list (pass=0x17869e0) at /mnt/svn/gcc-trunk/gcc/passes.c:1617
#9  0x0000000000a77a46 in tree_rest_of_compilation (fndecl=0x7ffff5d86100) at /mnt/svn/gcc-trunk/gcc/tree-optimize.c:422
#10 0x0000000000c3cf92 in cgraph_expand_function (node=0x7ffff5d93000) at /mnt/svn/gcc-trunk/gcc/cgraphunit.c:1522
#11 0x0000000000c3f65a in cgraph_expand_all_functions () at /mnt/svn/gcc-trunk/gcc/cgraphunit.c:1581
#12 cgraph_optimize () at /mnt/svn/gcc-trunk/gcc/cgraphunit.c:1841
#13 0x0000000000c3fbda in cgraph_finalize_compilation_unit () at /mnt/svn/gcc-trunk/gcc/cgraphunit.c:1042
#14 0x00000000005b3a8d in cp_write_global_declarations () at /mnt/svn/gcc-trunk/gcc/cp/decl2.c:3974
#15 0x0000000000a21214 in compile_file (argc=16, argv=0x7fffffffdaa8) at /mnt/svn/gcc-trunk/gcc/toplev.c:591
#16 do_compile (argc=16, argv=0x7fffffffdaa8) at /mnt/svn/gcc-trunk/gcc/toplev.c:1874
#17 toplev_main (argc=16, argv=0x7fffffffdaa8) at /mnt/svn/gcc-trunk/gcc/toplev.c:1937
#18 0x00007ffff65f1bbd in __libc_start_main () from /lib/libc.so.6
#19 0x00000000004fa9d1 in _start ()


Tested revisions:
r168743 - fail
Comment 1 H.J. Lu 2011-01-13 18:22:46 UTC
It is caused by revision 163192:

http://gcc.gnu.org/ml/gcc-cvs/2010-08/msg00403.html
Comment 2 H.J. Lu 2011-01-13 18:38:46 UTC
This is introduced between revision 163188 and 163192.
Revision 163192 may not be the caused.
Comment 3 H.J. Lu 2011-01-13 18:42:34 UTC
It is very likely caused by revision 163190:

http://gcc.gnu.org/ml/gcc-cvs/2010-08/msg00401.html
Comment 4 H.J. Lu 2011-01-13 19:10:47 UTC
(In reply to comment #3)
> It is very likely caused by revision 163190:
> 
> http://gcc.gnu.org/ml/gcc-cvs/2010-08/msg00401.html

It is caused by revision 163190:
Comment 5 Richard Biener 2011-01-14 11:07:15 UTC
Mine.
Comment 6 Richard Biener 2011-01-14 13:20:28 UTC
Author: rguenth
Date: Fri Jan 14 13:20:22 2011
New Revision: 168784

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=168784
Log:
2011-01-14  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/47280
	* tree-ssa-forwprop.c (associate_plusminus): Cleanup EH and
	return CFG changes.
	(tree_ssa_forward_propagate_single_use_vars): Deal with
	CFG changes from associate_plusminus.

	* g++.dg/opt/pr47280.C: New testcase.

Added:
    trunk/gcc/testsuite/g++.dg/opt/pr47280.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-forwprop.c
Comment 7 Richard Biener 2011-01-14 13:20:59 UTC
Fixed.