This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/33374] GCC 4.1.2 produce wrong assembler code with -O2 option enabled.
- From: "_kirpichev_ at mail dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Sep 2007 07:53:40 -0000
- Subject: [Bug c/33374] GCC 4.1.2 produce wrong assembler code with -O2 option enabled.
- References: <bug-33374-15076@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from _kirpichev_ at mail dot ru 2007-09-10 07:53 -------
Created an attachment (id=14183)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14183&action=view)
Correct and incorrect assembler dumps.
>From incorrect dump we can see where segmentation fault heppens:
0x0804839e <testFunction+30>: mov DWORD PTR [ecx+4],0x0
0x080483a5 <testFunction+37>: mov DWORD PTR [eax+4],edx
0x080483a8 <testFunction+40>: mov edx,DWORD PTR [ecx+4]
0x080483ab <testFunction+43>: mov ecx,ebx
0x080483ad <testFunction+45>: mov DWORD PTR [edx],eax
Instruction 0x080483ad tries to dereferencing pointer in edx, but
in edx zero was put by 0x080483a8.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33374