This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/38052] genautomata segfaults when -O2 is enabled
- From: "r0bertz at gentoo dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Nov 2008 15:41:29 -0000
- Subject: [Bug c/38052] genautomata segfaults when -O2 is enabled
- References: <bug-38052-16496@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from r0bertz at gentoo dot org 2008-11-07 15:41 -------
(In reply to comment #0)
> The problem with output_translate_vect_name is this function has two calls to
> fprintf, and they are called for the first time in this program.
Another thing I don't understand is why fprintf elsewhere is replaced with
fwrite including in the output_range_type function, but it is still itself in
output_translate_vect_name.
I have done an experiment. Please take a look at the beginning of
output_translate_vect_name function:
0x0040647c <output_translate_vect_name+0>: addiu sp,sp,-8
0x00406480 <output_translate_vect_name+4>: lw v0,4(a1)
0x00406484 <output_translate_vect_name+8>: sw gp,4(sp)
0x00406488 <output_translate_vect_name+12>: lui gp,0x44
0x0040648c <output_translate_vect_name+16>: beqz v0,0x4064b0
<output_translate_vect_name+52>
0x00406490 <output_translate_vect_name+20>: addiu gp,gp,4240
0x00406494 <output_translate_vect_name+24>: lw t9,-32532(gp)
0x00406498 <output_translate_vect_name+28>: lui a1,0x42
0x0040649c <output_translate_vect_name+32>: lw gp,4(sp)
0x004064a0 <output_translate_vect_name+36>: lw a2,0(v0)
0x004064a4 <output_translate_vect_name+40>: addiu a1,a1,-8008
0x004064a8 <output_translate_vect_name+44>: jr t9
If I replace the following instruction with nop, then the genautomata will
succeed.
0x0040649c <output_translate_vect_name+32>: lw gp,4(sp)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38052