This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/15551] [3.4/3.5? Regression] -mtune=pentium4 -O2 with sjlj EH breaks stack probe worker on windows32 targets
- From: "kcook at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Jun 2004 20:01:00 -0000
- Subject: [Bug target/15551] [3.4/3.5? Regression] -mtune=pentium4 -O2 with sjlj EH breaks stack probe worker on windows32 targets
- References: <20040520075803.15551.dannysmith@users.sourceforge.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From kcook at gcc dot gnu dot org 2004-06-07 20:00 -------
Created an attachment (id=6488)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6488&action=view)
A potential more correct fix
After deciphering the twisty passages. I think this is a more correct fix.
The problem was not really a scheduling problem, it was that the Win32 alloca
routine was marking that it clobbered memory, so gcc felt free to move stuff
above the call to __alloca.
I still need to regtest it (as that is REALLY slow on cygwin), but it survived
a c,c++ bootstrap on i686-pc-cygwin and fixed the bug (writing to unalloca
memory) as evidenced by below:
$ diff -u pm-gcc_35_orig.s pm-p4new.s
--- pm-gcc_35_orig.s 2004-06-01 14:25:47.170950500 -0400
+++ pm-p4new.s 2004-06-07 15:26:04.193903000 -0400
@@ -23,26 +23,26 @@
movl %esp, %ebp
pushl %edi
pushl %esi
- movl $___gxx_personality_sj0, -20052(%ebp)
- movl $LLSDA1422, -20048(%ebp)
pushl %ebx
- movl $L4, -20040(%ebp)
call __alloca
movl $16, %eax
andl $-16, %esp
call __alloca
leal -24(%ebp), %eax
+ movl $___gxx_personality_sj0, -20052(%ebp)
movl %eax, -20044(%ebp)
leal -20076(%ebp), %eax
- movl %esp, -20036(%ebp)
+ movl $LLSDA1422, -20048(%ebp)
movl %eax, (%esp)
+ movl $L4, -20040(%ebp)
+ movl %esp, -20036(%ebp)
call __Unwind_SjLj_Register
call ___main
movl $256, (%esp)
movl $-1, -20072(%ebp)
call __Znwj
- movl %eax, -20080(%ebp)
movl $16, 8(%esp)
+ movl %eax, -20080(%ebp)
movl $LC0, 4(%esp)
movl %eax, (%esp)
movl $1, -20072(%ebp)
This patch was against mainline, OK if it passes a complete regtest?
The patch also applies to 3.4 and I'll also regtest it there.
Mark, OK for 3.4.1 assuming that passes?
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |kcook at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15551