[Bug tree-optimization/46352] ICE: division by zero with -fdump-tree-tracer

2021-08-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46352

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
  Known to work||4.7.0
 Resolution|--- |FIXED
   Target Milestone|--- |4.7.0

--- Comment #3 from Andrew Pinski  ---
This condition will never happen in 4.7.0+.
Because we will not have the case where we have one BB there:
  if (n_basic_blocks_for_fn (fun) <= NUM_FIXED_BLOCKS + 1)
return 0;

[Bug tree-optimization/46352] ICE: division by zero with -fdump-tree-tracer

2013-04-03 Thread mpolacek at gcc dot gnu.org


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



Marek Polacek mpolacek at gcc dot gnu.org changed:



   What|Removed |Added



 CC||mpolacek at gcc dot gnu.org



--- Comment #2 from Marek Polacek mpolacek at gcc dot gnu.org 2013-04-04 
05:37:59 UTC ---

Does not happen anymore, but the issue is maybe still latent; we'd need 3+ BBs

and the sum of insns in them would have to be 0.


[Bug tree-optimization/46352] ICE: division by zero with -fdump-tree-tracer

2010-12-20 Thread zsojka at seznam dot cz
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46352

--- Comment #1 from Zdenek Sojka zsojka at seznam dot cz 2010-12-20 14:12:19 
UTC ---
Backtrace for r165699:

The offending line is:
fprintf (dump_file, Duplicated %i insns (%i%%)\n, nduplicated,
 nduplicated * 100 / ninsns);


Program received signal SIGFPE, Arithmetic exception.
0x0088a835 in tail_duplicate () at /mnt/svn/gcc-trunk/gcc/tracer.c:338
338 fprintf (dump_file, Duplicated %i insns (%i%%)\n, nduplicated,
(gdb) bt
#0  0x0088a835 in tail_duplicate () at
/mnt/svn/gcc-trunk/gcc/tracer.c:338
#1  tracer () at /mnt/svn/gcc-trunk/gcc/tracer.c:364
#2  0x0079613f in execute_one_pass (pass=0x155f000) at
/mnt/svn/gcc-trunk/gcc/passes.c:1562
#3  0x007963d5 in execute_pass_list (pass=0x155f000) at
/mnt/svn/gcc-trunk/gcc/passes.c:1617
#4  0x007963e7 in execute_pass_list (pass=0x155fd80) at
/mnt/svn/gcc-trunk/gcc/passes.c:1618
#5  0x008e30f6 in tree_rest_of_compilation (fndecl=0x75aadf00) at
/mnt/svn/gcc-trunk/gcc/tree-optimize.c:419
#6  0x00aac342 in cgraph_expand_function (node=0x75acc000) at
/mnt/svn/gcc-trunk/gcc/cgraphunit.c:1494
#7  0x00aae90a in cgraph_expand_all_functions () at
/mnt/svn/gcc-trunk/gcc/cgraphunit.c:1553
#8  cgraph_optimize () at /mnt/svn/gcc-trunk/gcc/cgraphunit.c:1809
#9  0x00aaee6a in cgraph_finalize_compilation_unit () at
/mnt/svn/gcc-trunk/gcc/cgraphunit.c:1016
#10 0x004ab4b4 in c_write_global_declarations () at
/mnt/svn/gcc-trunk/gcc/c-decl.c:9822
#11 0x00889934 in compile_file (argc=16, argv=0x7fffdac8) at
/mnt/svn/gcc-trunk/gcc/toplev.c:931
#12 do_compile (argc=16, argv=0x7fffdac8) at
/mnt/svn/gcc-trunk/gcc/toplev.c:2363
#13 toplev_main (argc=16, argv=0x7fffdac8) at
/mnt/svn/gcc-trunk/gcc/toplev.c:2423
#14 0x76371bbd in __libc_start_main () from /lib/libc.so.6
#15 0x004920b9 in _start ()
(gdb) p nduplicated
$1 = 0
(gdb) p ninsns
$2 = value optimized out

I can't reproduce it in current trunk, but I don't know if it was fixed or just
hidden.