http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46304
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code Status|NEW |ASSIGNED Known to work| |4.4.4, 4.6.0 AssignedTo|unassigned at gcc dot |rguenth at gcc dot gnu.org |gnu.org | Target Milestone|--- |4.5.2 Summary|g++ crashes with ICE in |[4.5 Regression] g++ |bitmap_first_set_bit, at |crashes with ICE in |bitmap.c:770 |bitmap_first_set_bit, at | |bitmap.c:770 Known to fail| |4.5.0, 4.5.1 --- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-05 10:48:55 UTC --- Confirmed. Happens as we go into SSA form. #2 0x00000000007ed310 in bitmap_first_set_bit (a=0x19c13e8) at /space/rguenther/src/svn/gcc-4_5-branch/gcc/bitmap.c:770 770 gcc_assert (elt); (gdb) #3 0x0000000000c61587 in set_livein_block (var=0x7ffff7ef3d20, bb=0x7ffff5b318f0) at /space/rguenther/src/svn/gcc-4_5-branch/gcc/tree-into-ssa.c:550 550 int def_block_index = bitmap_first_set_bit (db_p->def_blocks); when visiting (gdb) call debug_gimple_stmt (stmt) D.2447 = COMPLEX_EXPR <D.2444, 2.0e+0>; and the bitmap is empty. D.2444 is not set before. void ClassA<T>::setSize() [with T = __complex__ double] (struct ClassA * const this) { complex double D.2447; complex double * D.2446; <bb 2>: D.2446 = this->data; D.2447 = COMPLEX_EXPR <D.2444, 2.0e+0>; *D.2446 = D.2447; return; } it looks like this caller to bitmap_first_set_bit assumes it's ok to call it on an empty bitmap where it should return -1. It's interesting though that 4.6 for the above has void ClassA<T>::setSize() [with T = __complex__ double] (struct ClassA * this) { complex double D.2421; double D.2420; complex double * D.2419; <bb 2>: D.2419 = this->data; D.2420 = 1.0e+0 + 0.0; D.2421 = COMPLEX_EXPR <D.2420, 2.0e+0>; *D.2419 = D.2421; return; } which shows it's also really a wrong-code bug.