http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51362
Bug #: 51362
Summary: [4.7 Regression ICE: SIGFPE (division by zero) in
good_cloning_opportunity_p at ipa-cp.c:2401
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: [email protected]
ReportedBy: [email protected]
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Created attachment 25957
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25957
reduced testcase
Compiler output:
$ gcc -O -fipa-cp -fipa-cp-clone testcase.c
(gdb) r
Starting program:
/mnt/svn/gcc-trunk/binary-181788-lto-fortran-checking-yes-rtl-df/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/cc1
-quiet testcase.c -quiet -dumpbase testcase.c -mtune=generic -march=x86-64
-auxbase testcase -O -fipa-cp -fipa-cp-clone -o /tmp/ccinm5Ix.s
Program received signal SIGFPE, Arithmetic exception.
0x0000000001125ed1 in good_cloning_opportunity_p (time_benefit=Unhandled dwarf
expression opcode 0xf3
) at /mnt/svn/gcc-trunk/gcc/ipa-cp.c:1233
1233 int evaluation = (time_benefit * freq_sum) / size_cost;
(gdb) bt
#0 0x0000000001125ed1 in good_cloning_opportunity_p (time_benefit=Unhandled
dwarf expression opcode 0xf3
) at /mnt/svn/gcc-trunk/gcc/ipa-cp.c:1233
#1 0x000000000112b335 in decide_whether_version_node () at
/mnt/svn/gcc-trunk/gcc/ipa-cp.c:2252
#2 ipcp_decision_stage () at /mnt/svn/gcc-trunk/gcc/ipa-cp.c:2401
#3 ipcp_driver () at /mnt/svn/gcc-trunk/gcc/ipa-cp.c:2441
#4 0x00000000008fa7e5 in execute_one_pass (pass=0x17c2180) at
/mnt/svn/gcc-trunk/gcc/passes.c:2074
#5 0x00000000008fafaa in execute_ipa_pass_list (pass=0x17c2180) at
/mnt/svn/gcc-trunk/gcc/passes.c:2441
#6 0x00000000006b1a50 in ipa_passes () at
/mnt/svn/gcc-trunk/gcc/cgraphunit.c:2076
#7 cgraph_optimize () at /mnt/svn/gcc-trunk/gcc/cgraphunit.c:2147
#8 0x00000000006b1e8a in cgraph_finalize_compilation_unit () at
/mnt/svn/gcc-trunk/gcc/cgraphunit.c:1327
#9 0x000000000058f970 in c_write_global_declarations () at
/mnt/svn/gcc-trunk/gcc/c-decl.c:10026
#10 0x00000000009efa94 in compile_file (argc=15, argv=0x7fffffffdad8) at
/mnt/svn/gcc-trunk/gcc/toplev.c:581
#11 do_compile (argc=15, argv=0x7fffffffdad8) at
/mnt/svn/gcc-trunk/gcc/toplev.c:1936
#12 toplev_main (argc=15, argv=0x7fffffffdad8) at
/mnt/svn/gcc-trunk/gcc/toplev.c:2012
#13 0x00007ffff6178d2d in __libc_start_main () from /lib64/libc.so.6
#14 0x00000000005731a9 in _start ()
Tested revisions:
r181788 - crash