This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/15551] [3.4/3.5? Regression] -mtune=pentium4 -O2 with sjlj EH breaks stack probe worker on windows32 targets


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]