http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50682

--- Comment #4 from Zdenek Sojka <zsojka at seznam dot cz> 2011-11-27 13:13:45 
UTC ---
Created attachment 25919
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25919
another testcase

This testcase doesn't need any -fno-* flags. It might be the same problem (the
backtrace is the same).

$ gcc -O2 -fnon-call-exceptions -mfma4 testcase.C
==18808== Invalid read of size 4
==18808==    at 0xB961F3: main_block_label(tree_node*) (tree-cfg.c:1092)
==18808==    by 0xB9A56B: cleanup_dead_labels() (tree-cfg.c:1121)
==18808==    by 0xBEAB9C: execute_cleanup_cfg_post_optimizing()
(tree-optimize.c:162)
==18808==    by 0xA89CF4: execute_one_pass(opt_pass*) (passes.c:2074)
==18808==    by 0xA8A094: execute_pass_list(opt_pass*) (passes.c:2129)
==18808==    by 0xBEB5BD: tree_rest_of_compilation(tree_node*)
(tree-optimize.c:420)
==18808==    by 0x83F949: cgraph_expand_function(cgraph_node*)
(cgraphunit.c:1819)
==18808==    by 0x8416EB: cgraph_optimize() (cgraphunit.c:1886)
==18808==    by 0x841E59: cgraph_finalize_compilation_unit()
(cgraphunit.c:1327)
==18808==    by 0x6632EA: cp_write_global_declarations() (decl2.c:4050)
==18808==    by 0xB7EE43: toplev_main(int, char**) (toplev.c:581)
==18808==    by 0x674ED2C: (below main) (in /lib64/libc-2.12.2.so)
==18808==  Address 0x50 is not stack'd, malloc'd or (recently) free'd
==18808== 
testcase.C: In function 'void test01()':
testcase.C:21:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

However, when the code is modified a little (ternary operator is replaced by
if/else), the crash is different:
$ gcc -O2 -fnon-call-exceptions -mfma4 testcase.C                     
testcase.C: In function 'void test01()':
testcase.C:21:1: error: BB 2 can not throw but has an EH edge
testcase.C:21:1: internal compiler error: verify_flow_info failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Reply via email to