[PATCH/4.4 Regression] Fix PR target/38952 (SjLj EH failure on i386)

H.J. Lu hjl.tools@gmail.com
Mon Jan 26 23:34:00 GMT 2009


On Sun, Jan 25, 2009 at 5:47 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sun, Jan 25, 2009 at 4:04 PM, Dave Korn
> <dave.korn.cygwin@googlemail.com> wrote:
>>    Hi all,
>>
>>  The attached patch fixes PR38952 for me, at least as far as my initial
>> testing (using pattern "old-deja.exp=eh*" in the G++ testsuite) shows, so I'm
>> now going for a full bootstrap and test on both Cygwin and Linux using both
>> SjLj and DW-2 EH.
>
> Here is the result on Linux/x86-64:
>
> http://gcc.gnu.org/ml/gcc-testresults/2009-01/msg02626.html
>
> Since --enable-sjlj-exceptions  isn't compatible on Linux, some
> unwind falures are expected.
>

Hi,

Here is a patch to disable unwind-[0-6].C tests when
__USING_SJLJ_EXCEPTIONS__ is defined since they
aren't compatible with SJLJ unwind.


-- 
H.J.
---
2009-01-26  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/38952
	* g++.dg/torture/stackalign/test-unwind.h (main): Also return 0
	if __USING_SJLJ_EXCEPTIONS__ is defined.

	* g++.dg/torture/stackalign/unwind-0.C (foo): Don't define if
	__USING_SJLJ_EXCEPTIONS__ is defined.
	* g++.dg/torture/stackalign/unwind-1.C (foo): Likewise.
	* g++.dg/torture/stackalign/unwind-2.C (foo): Likewise.
	* g++.dg/torture/stackalign/unwind-3.C (foo): Likewise.
	* g++.dg/torture/stackalign/unwind-4.C (foo): Likewise.
	* g++.dg/torture/stackalign/unwind-5.C (foo): Likewise.
	* g++.dg/torture/stackalign/unwind-6.C (foo): Likewise.
-------------- next part --------------
2009-01-26  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/38952
	* g++.dg/torture/stackalign/test-unwind.h (main): Also return 0
	if __USING_SJLJ_EXCEPTIONS__ is defined.

	* g++.dg/torture/stackalign/unwind-0.C (foo): Don't define if
	__USING_SJLJ_EXCEPTIONS__ is defined.
	* g++.dg/torture/stackalign/unwind-1.C (foo): Likewise.
	* g++.dg/torture/stackalign/unwind-2.C (foo): Likewise.
	* g++.dg/torture/stackalign/unwind-3.C (foo): Likewise.
	* g++.dg/torture/stackalign/unwind-4.C (foo): Likewise.
	* g++.dg/torture/stackalign/unwind-5.C (foo): Likewise.
	* g++.dg/torture/stackalign/unwind-6.C (foo): Likewise.

Index: g++.dg/torture/stackalign/unwind-0.C
===================================================================
--- g++.dg/torture/stackalign/unwind-0.C	(revision 5079)
+++ g++.dg/torture/stackalign/unwind-0.C	(working copy)
@@ -2,7 +2,7 @@
 
 #include "test-unwind.h"
 
-#ifndef __PIC__
+#if !defined __PIC__ && !defined __USING_SJLJ_EXCEPTIONS__
 void __attribute__ ((noinline)) foo()
 {
         ALTER_REGS();
Index: g++.dg/torture/stackalign/unwind-1.C
===================================================================
--- g++.dg/torture/stackalign/unwind-1.C	(revision 5079)
+++ g++.dg/torture/stackalign/unwind-1.C	(working copy)
@@ -2,7 +2,7 @@
 
 #include "test-unwind.h"
 
-#ifndef __PIC__
+#if !defined __PIC__ && !defined __USING_SJLJ_EXCEPTIONS__
 /* Test situation 1: Stack really realign without DRAP */
 void __attribute__ ((noinline))
 foo ()
Index: g++.dg/torture/stackalign/unwind-2.C
===================================================================
--- g++.dg/torture/stackalign/unwind-2.C	(revision 5079)
+++ g++.dg/torture/stackalign/unwind-2.C	(working copy)
@@ -2,7 +2,7 @@
 
 #include "test-unwind.h"
 
-#ifndef __PIC__
+#if !defined __PIC__ && !defined __USING_SJLJ_EXCEPTIONS__
 /* Test situation 2: stack really realign with DRAP reg CX */
 void __attribute__ ((noinline))
 foo ()
Index: g++.dg/torture/stackalign/unwind-3.C
===================================================================
--- g++.dg/torture/stackalign/unwind-3.C	(revision 5079)
+++ g++.dg/torture/stackalign/unwind-3.C	(working copy)
@@ -2,7 +2,7 @@
 
 #include "test-unwind.h"
 
-#ifndef __PIC__
+#if !defined __PIC__ && !defined __USING_SJLJ_EXCEPTIONS__
 /* Test situation 3: Stack realign really happen with DRAP reg DI */
 void __attribute__ ((noinline)) __attribute__ ((regparm(3))) 
 bar (int arg1, int arg2, int arg3)
Index: g++.dg/torture/stackalign/unwind-4.C
===================================================================
--- g++.dg/torture/stackalign/unwind-4.C	(revision 5079)
+++ g++.dg/torture/stackalign/unwind-4.C	(working copy)
@@ -2,7 +2,7 @@
 
 #include "test-unwind.h"
 
-#ifndef __PIC__
+#if !defined __PIC__ && !defined __USING_SJLJ_EXCEPTIONS__
 volatile int __attribute__ ((aligned(32))) g_a=1;
 /* Test situation 4: no Drap and stack realign doesn't really happen */
 void __attribute__ ((noinline))
Index: g++.dg/torture/stackalign/unwind-5.C
===================================================================
--- g++.dg/torture/stackalign/unwind-5.C	(revision 5079)
+++ g++.dg/torture/stackalign/unwind-5.C	(working copy)
@@ -2,7 +2,7 @@
 
 #include "test-unwind.h"
 
-#ifndef __PIC__
+#if !defined __PIC__ && !defined __USING_SJLJ_EXCEPTIONS__
 double g_f=1.0;
 /* Test situation 5: Stack realign dosn't really happen with DRAP reg CX */
 void __attribute__ ((noinline)) __attribute__ ((regparm(2))) 
Index: g++.dg/torture/stackalign/unwind-6.C
===================================================================
--- g++.dg/torture/stackalign/unwind-6.C	(revision 5079)
+++ g++.dg/torture/stackalign/unwind-6.C	(working copy)
@@ -2,7 +2,7 @@
 
 #include "test-unwind.h"
 
-#ifndef __PIC__
+#if !defined __PIC__ && !defined __USING_SJLJ_EXCEPTIONS__
 double g_f=1.0;
 /* Test situation 6: Stack realign dosn't really happen with DRAP reg DI */
 void __attribute__ ((noinline)) __attribute__ ((regparm(3))) 
Index: g++.dg/torture/stackalign/test-unwind.h
===================================================================
--- g++.dg/torture/stackalign/test-unwind.h	(revision 5079)
+++ g++.dg/torture/stackalign/test-unwind.h	(working copy)
@@ -29,7 +29,7 @@ extern void foo(void);
         );\
   }
 
-#ifdef __PIC__
+#if defined __PIC__ || defined __USING_SJLJ_EXCEPTIONS__
 int
 main ()
 {


More information about the Gcc-patches mailing list