You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.9 KiB

# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../uclibc/pkg_patch/gcc-900-crt-align-1.patch
# Copyright (C) 2006 The OpenSDE Project
# Copyright (C) 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
2006-03-18 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/crtfastmath.c (set_fast_math): Align fxsave to
16byte by hand.
Reference:
http://gcc.gnu.org/ml/gcc-patches/2006-03/msg01179.html
--- ./gcc/config/i386/crtfastmath.c.align 2005-11-04 14:13:48.000000000 -0800
+++ ./gcc/config/i386/crtfastmath.c 2006-03-18 08:34:13.000000000 -0800
@@ -75,7 +75,7 @@ set_fast_math (void)
if (edx & FXSAVE)
{
/* Check if DAZ is available. */
- struct
+ struct fxsave
{
unsigned short int cwd;
unsigned short int swd;
@@ -90,13 +90,17 @@ set_fast_math (void)
long int st_space[32];
long int xmm_space[32];
long int padding[56];
- } __attribute__ ((aligned (16))) fxsave;
+ } *fxsave;
- __builtin_memset (&fxsave, 0, sizeof (fxsave));
+ fxsave = (struct fxsave *)
+ (((unsigned long) __builtin_alloca (sizeof (*fxsave) + 15))
+ & ~15L);
- asm volatile ("fxsave %0" : "=m" (fxsave) : "m" (fxsave));
+ __builtin_memset (fxsave, 0, sizeof (*fxsave));
- if (fxsave.mxcsr_mask & MXCSR_DAZ)
+ asm volatile ("fxsave %0" : "=m" (*fxsave) : "m" (*fxsave));
+
+ if (fxsave->mxcsr_mask & MXCSR_DAZ)
mxcsr |= MXCSR_DAZ;
}