summaryrefslogtreecommitdiff
path: root/libgcc/config
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-07 10:19:26 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-07 10:19:26 +0000
commit80879cf9009417726906a880af907e2de8683a84 (patch)
tree5d10fee949bcec7e27a86f73f02f55f09633b3d4 /libgcc/config
parentd42d3fad6998402ea943bc2a3159cad09eb288d5 (diff)
downloadgcc-80879cf9009417726906a880af907e2de8683a84.tar.gz
2012-11-07 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 193285 using svnmerge.py git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@193288 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc/config')
-rw-r--r--libgcc/config/i386/32/sfp-machine.h2
-rw-r--r--libgcc/config/i386/64/sfp-machine.h2
-rw-r--r--libgcc/config/i386/morestack.S37
-rw-r--r--libgcc/config/i386/sfp-exceptions.c2
-rw-r--r--libgcc/config/i386/sfp-machine.h2
-rw-r--r--libgcc/config/libbid/ChangeLog5
-rw-r--r--libgcc/config/libbid/bid_functions.h4
7 files changed, 42 insertions, 12 deletions
diff --git a/libgcc/config/i386/32/sfp-machine.h b/libgcc/config/i386/32/sfp-machine.h
index 474ade0d503..d81d9a366ca 100644
--- a/libgcc/config/i386/32/sfp-machine.h
+++ b/libgcc/config/i386/32/sfp-machine.h
@@ -77,6 +77,7 @@
#define _FP_NANFRAC_E _FP_QNANBIT_E, 0, 0, 0
#define _FP_NANFRAC_Q _FP_QNANBIT_Q, 0, 0, 0
+#ifndef _SOFT_FLOAT
#define FP_RND_NEAREST 0
#define FP_RND_ZERO 0xc00
#define FP_RND_PINF 0x800
@@ -91,3 +92,4 @@
do { \
__asm__ __volatile__ ("fnstcw\t%0" : "=m" (_fcw)); \
} while (0)
+#endif
diff --git a/libgcc/config/i386/64/sfp-machine.h b/libgcc/config/i386/64/sfp-machine.h
index fc9a38af696..21c9edc3808 100644
--- a/libgcc/config/i386/64/sfp-machine.h
+++ b/libgcc/config/i386/64/sfp-machine.h
@@ -18,6 +18,7 @@ typedef unsigned int UTItype __attribute__ ((mode (TI)));
#define _FP_NANFRAC_E _FP_QNANBIT_E, 0
#define _FP_NANFRAC_Q _FP_QNANBIT_Q, 0
+#ifndef _SOFT_FLOAT
#define FP_RND_NEAREST 0
#define FP_RND_ZERO 0x6000
#define FP_RND_PINF 0x4000
@@ -32,3 +33,4 @@ typedef unsigned int UTItype __attribute__ ((mode (TI)));
do { \
__asm__ __volatile__ ("%vstmxcsr\t%0" : "=m" (_fcw)); \
} while (0)
+#endif
diff --git a/libgcc/config/i386/morestack.S b/libgcc/config/i386/morestack.S
index 9528431f7e6..21c82415fe5 100644
--- a/libgcc/config/i386/morestack.S
+++ b/libgcc/config/i386/morestack.S
@@ -200,18 +200,19 @@ __morestack_non_split:
jb 2f # Get more space if we need it.
- # This breaks call/return prediction, as described above.
- incq 8(%rsp) # Increment the return address.
-
# If the instruction that we return to is
# leaq 24(%rbp), %r11n
# then we have been called by a varargs function that expects
# %ebp to hold a real value. That can only work if we do the
# full stack split routine. FIXME: This is fragile.
movq 8(%rsp),%rax
+ incq %rax # Skip ret instruction in caller.
cmpl $0x185d8d4c,(%rax)
je 2f
+ # This breaks call/return prediction, as described above.
+ incq 8(%rsp) # Increment the return address.
+
popq %rax # Restore register.
.cfi_adjust_cfa_offset -8 # Adjust for popped register.
@@ -296,9 +297,13 @@ __morestack:
# argument size is pushed then the new stack frame size is
# pushed.
- # Align stack to 16-byte boundary with enough space for saving
- # registers and passing parameters to functions we call.
- subl $40,%esp
+ # In the body of a non-leaf function, the stack pointer will
+ # be aligned to a 16-byte boundary. That is CFA + 12 in the
+ # stack picture above: (CFA + 12) % 16 == 0. At this point we
+ # have %esp == CFA - 8, so %esp % 16 == 12. We need some
+ # space for saving registers and passing parameters, and we
+ # need to wind up with %esp % 16 == 0.
+ subl $44,%esp
# Because our cleanup code may need to clobber %ebx, we need
# to save it here so the unwinder can restore the value used
@@ -393,13 +398,15 @@ __morestack:
movl %ebp,%esp # Restore stack pointer.
+ # As before, we now have %esp % 16 == 12.
+
pushl %eax # Push return value on old stack.
pushl %edx
- subl $8,%esp # Align stack to 16-byte boundary.
+ subl $4,%esp # Align stack to 16-byte boundary.
call __morestack_unblock_signals
- addl $8,%esp
+ addl $4,%esp
popl %edx # Restore return value.
popl %eax
@@ -485,15 +492,21 @@ __morestack:
pushq %r9
pushq %r11
- pushq $0 # For alignment.
+
+ # We entered morestack with the stack pointer aligned to a
+ # 16-byte boundary (the call to morestack's caller used 8
+ # bytes, and the call to morestack used 8 bytes). We have now
+ # pushed 10 registers, so we are still aligned to a 16-byte
+ # boundary.
call __morestack_block_signals
leaq -8(%rbp),%rdi # Address of new frame size.
leaq 24(%rbp),%rsi # The caller's parameters.
- addq $8,%rsp
popq %rdx # The size of the parameters.
+ subq $8,%rsp # Align stack.
+
call __generic_morestack
movq -8(%rbp),%r10 # Reload modified frame size
@@ -564,6 +577,9 @@ __morestack:
movq %rbp,%rsp # Restore stack pointer.
+ # Now (%rsp & 16) == 8.
+
+ subq $8,%rsp # For alignment.
pushq %rax # Push return value on old stack.
pushq %rdx
@@ -571,6 +587,7 @@ __morestack:
popq %rdx # Restore return value.
popq %rax
+ addq $8,%rsp
.cfi_remember_state
popq %rbp
diff --git a/libgcc/config/i386/sfp-exceptions.c b/libgcc/config/i386/sfp-exceptions.c
index 0d5c2e0e3f5..d7e2bf7d428 100644
--- a/libgcc/config/i386/sfp-exceptions.c
+++ b/libgcc/config/i386/sfp-exceptions.c
@@ -21,6 +21,7 @@
* <http://www.gnu.org/licenses/>.
*/
+#ifndef _SOFT_FLOAT
#include "sfp-machine.h"
struct fenv
@@ -88,3 +89,4 @@ __sfp_handle_exceptions (int _fex)
asm volatile ("fwait");
}
};
+#endif
diff --git a/libgcc/config/i386/sfp-machine.h b/libgcc/config/i386/sfp-machine.h
index 01bf14ffbb0..9afbbcbed03 100644
--- a/libgcc/config/i386/sfp-machine.h
+++ b/libgcc/config/i386/sfp-machine.h
@@ -40,6 +40,7 @@ typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__)));
R##_c = FP_CLS_NAN; \
} while (0)
+#ifndef _SOFT_FLOAT
#define FP_EX_INVALID 0x01
#define FP_EX_DENORM 0x02
#define FP_EX_DIVZERO 0x04
@@ -56,6 +57,7 @@ void __sfp_handle_exceptions (int);
} while (0);
#define FP_ROUNDMODE (_fcw & FP_RND_MASK)
+#endif
#define __LITTLE_ENDIAN 1234
#define __BIG_ENDIAN 4321
diff --git a/libgcc/config/libbid/ChangeLog b/libgcc/config/libbid/ChangeLog
index d7f52794859..3dc721b52a1 100644
--- a/libgcc/config/libbid/ChangeLog
+++ b/libgcc/config/libbid/ChangeLog
@@ -1,3 +1,8 @@
+2012-11-04 Thomas Schwinge <thomas@codesourcery.com>
+
+ * bid_functions.h: Check for __GLIBC__ additionally to LINUX when
+ defining format specifiers.
+
2007-09-27 H.J. Lu <hongjiu.lu@intel.com>
* bid128_fromstring.c: Removed.
diff --git a/libgcc/config/libbid/bid_functions.h b/libgcc/config/libbid/bid_functions.h
index 579370ae8db..6dd8e84e879 100644
--- a/libgcc/config/libbid/bid_functions.h
+++ b/libgcc/config/libbid/bid_functions.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2009, 2012 Free Software Foundation, Inc.
This file is part of GCC.
@@ -124,7 +124,7 @@ ALIGN (16)
#define DENORMAL_MODE 0x00000100
#define INVALID_MODE 0x00000080
-#if defined LINUX || defined SUNOS
+#if defined LINUX || defined __GLIBC__ || defined SUNOS
#define LX16 "%016llx"
#define LX "%llx"
#define LD4 "%4llu"