Patchwork Backport fixes for PR36502, PR42313 and PR44651 to gcc 4.5.2

login
register
mail settings
Submitter Jack Howarth
Date Sept. 9, 2010, 6:46 p.m.
Message ID <20100909184615.GA11516@bromo.med.uc.edu>
Download mbox | patch
Permalink /patch/64317/
State New
Headers show

Comments

Jack Howarth - Sept. 9, 2010, 6:46 p.m.
The attached patch is a backport of the fixes for PR36502, PR42313
and PR44651 for gcc 4.5.2. Bootstrap and regression tested on both
i386-apple-darwin10 and x86_64-apple.darwin10. The testresults, showing
no regressions, can be found at...

http://gcc.gnu.org/ml/gcc-testresults/2010-09/msg00859.html
http://gcc.gnu.org/ml/gcc-testresults/2010-09/msg00761.html

Okay for gcc-4_5-branch?
         Jack


2010-09-09  Jack Howarth <howarth@bromo.med.uc.edu>

	Backport from mainline
	2010-09-07  H.J. Lu  <hjl.tools@gmail.com>
               	    Jack Howarth <howarth@bromo.med.uc.edu>

	PR target/36502
	PR target/42313
	PR target/44651
	* gcc/config/i386/darwin.h (STACK_BOUNDARY): Redefine as 128 for
	profiling or 64-bit MS_ABI and as BITS_PER_WORD otherwise.
	(PREFERRED_STACK_BOUNDARY): Replace STACK_BOUNDARY with 128 in
	MAX macro.

2010-09-09  Jack Howarth <howarth@bromo.med.uc.edu>

	Backport from mainline
	2010-09-07  Jack Howarth <howarth@bromo.med.uc.edu>

	PR target/36502
	* gcc.target/i386/pr36502.c: New test.

	PR target/42313
	PR target/44651
	* gcc.target/i386/builtin-unreachable.c: Don't skip on darwin.
Mike Stump - Sept. 10, 2010, 5 a.m.
On Sep 9, 2010, at 11:46 AM, Jack Howarth wrote:
>  The attached patch is a backport of the fixes for PR36502, PR42313
> and PR44651 for gcc 4.5.2.

> Okay for gcc-4_5-branch?

Ok.

Patch

Index: gcc/testsuite/gcc.target/i386/builtin-unreachable.c
===================================================================
--- gcc/testsuite/gcc.target/i386/builtin-unreachable.c	(revision 163986)
+++ gcc/testsuite/gcc.target/i386/builtin-unreachable.c	(working copy)
@@ -9,5 +9,5 @@ 
     __builtin_unreachable ();
   return p ? 1 : 0;
 }
-/* { dg-final { scan-assembler-not "%e\[bs\]p" { target { ! *-*-darwin* } } } } */
+/* { dg-final { scan-assembler-not "%e\[bs\]p" } } */
 /* { dg-final { scan-assembler-not "\[\\t \]+j" } } */
Index: gcc/config/i386/darwin.h
===================================================================
--- gcc/config/i386/darwin.h	(revision 163986)
+++ gcc/config/i386/darwin.h	(working copy)
@@ -73,7 +73,9 @@ 
    Failure to ensure this will lead to a crash in the system libraries
    or dynamic loader.  */
 #undef STACK_BOUNDARY
-#define STACK_BOUNDARY 128
+#define STACK_BOUNDARY \
+ ((profile_flag || (TARGET_64BIT && ix86_abi == MS_ABI)) \
+  ? 128 : BITS_PER_WORD)
 
 #undef MAIN_STACK_BOUNDARY
 #define MAIN_STACK_BOUNDARY 128
@@ -85,7 +87,7 @@ 
    it's below the minimum.  */
 #undef PREFERRED_STACK_BOUNDARY
 #define PREFERRED_STACK_BOUNDARY			\
-  MAX (STACK_BOUNDARY, ix86_preferred_stack_boundary)
+  MAX (128, ix86_preferred_stack_boundary)
 
 /* We want -fPIC by default, unless we're using -static to compile for
    the kernel or some such.  */
--- /dev/null	2010-09-01 11:08:32.000000000 -0400
+++ gcc/testsuite/gcc.target/i386/pr36502.c	2010-09-01 11:23:10.000000000 -0400
@@ -0,0 +1,7 @@ 
+/* PR target/36502 */
+/* { dg-do compile { target { *-*-darwin* && ilp32 } } } */
+/* { dg-options "-O -fomit-frame-pointer -fno-pic -S" } */
+int a;
+void f() {a++;}
+/* { dg-final { scan-assembler-not "esp" } } */
+