]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorNo Author <no-author@gcc.gnu.org>
Tue, 23 Nov 2004 13:12:35 +0000 (13:12 +0000)
committerNo Author <no-author@gcc.gnu.org>
Tue, 23 Nov 2004 13:12:35 +0000 (13:12 +0000)
'gcc-3_4-branch'.

From-SVN: r91089

gcc/config/arm/t-rtems [new file with mode: 0644]
gcc/config/avr/rtems.h [new file with mode: 0644]
gcc/config/avr/t-rtems [new file with mode: 0644]
gcc/config/c4x/t-rtems [new file with mode: 0644]
gcc/testsuite/gcc.dg/setjmp-2.c [new file with mode: 0644]

diff --git a/gcc/config/arm/t-rtems b/gcc/config/arm/t-rtems
new file mode 100644 (file)
index 0000000..52d14ba
--- /dev/null
@@ -0,0 +1,10 @@
+# Custom rtems multilibs
+
+MULTILIB_OPTIONS     = marm/mthumb
+MULTILIB_DIRNAMES    = arm thumb
+MULTILIB_EXCEPTIONS  = 
+MULTILIB_MATCHES     = marm=mno-thumb
+
+MULTILIB_OPTIONS    += msoft-float/mhard-float
+MULTILIB_DIRNAMES   += soft fpu
+MULTILIB_EXCEPTIONS += *mthumb/*mhard-float*
diff --git a/gcc/config/avr/rtems.h b/gcc/config/avr/rtems.h
new file mode 100644 (file)
index 0000000..2371d52
--- /dev/null
@@ -0,0 +1,29 @@
+/* Definitions for rtems targeting a AVR using ELF.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+   Contributed by Ralf Corsepius (ralf.corsepius@rtems.org).
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Specify predefined symbols in preprocessor.  */
+
+#define TARGET_OS_CPP_BUILTINS()       \
+do {                                   \
+  builtin_define ("__rtems__");                \
+  builtin_define ("__USE_INIT_FINI__");        \
+  builtin_assert ("system=rtems");     \
+} while (0)
diff --git a/gcc/config/avr/t-rtems b/gcc/config/avr/t-rtems
new file mode 100644 (file)
index 0000000..a3ef8bd
--- /dev/null
@@ -0,0 +1,3 @@
+# Multilibs for avr RTEMS targets.
+
+# ATM, this is just a stub
diff --git a/gcc/config/c4x/t-rtems b/gcc/config/c4x/t-rtems
new file mode 100644 (file)
index 0000000..52dc7ea
--- /dev/null
@@ -0,0 +1,10 @@
+# Custom RTEMS multilibs
+
+# We'd actually want to support -msmall, but it trips a bug in gcc
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14436
+#
+# MULTILIB_OPTIONS = m30 msmall mmemparm
+# MULTILIB_DIRNAMES = c3x small mem
+
+MULTILIB_OPTIONS = m30 mmemparm
+MULTILIB_DIRNAMES = c3x mem
diff --git a/gcc/testsuite/gcc.dg/setjmp-2.c b/gcc/testsuite/gcc.dg/setjmp-2.c
new file mode 100644 (file)
index 0000000..6c89f8e
--- /dev/null
@@ -0,0 +1,48 @@
+/* PR middle-end/17813 */
+/* Origin: Tom Hughes <tom@compton.nu> */
+/* { dg-do run { target i?86-*-linux* x86_64-*-linux* } } */
+/* { dg-options "-O -fomit-frame-pointer -march=i386" { target i?86-*-linux* } } */
+/* { dg-options "-O -fomit-frame-pointer -m32 -march=i386" { target x86_64-*-linux* } } */
+
+#include <setjmp.h>
+#include <signal.h>
+#include <stdlib.h>
+
+static jmp_buf segv_jmpbuf;
+
+static void segv_handler(int seg)
+{
+   __builtin_longjmp(segv_jmpbuf, 1);
+}
+
+static int is_addressable(void *p, size_t size)
+{
+   volatile char * volatile cp = (volatile char *)p;
+   volatile int ret;
+   struct sigaction sa, origsa;
+   sigset_t mask;
+   
+   sa.sa_handler = segv_handler;
+   sa.sa_flags = 0;
+   sigfillset(&sa.sa_mask);
+   sigaction(SIGSEGV, &sa, &origsa);
+   sigprocmask(SIG_SETMASK, NULL, &mask);
+
+   if (__builtin_setjmp(segv_jmpbuf) == 0) {
+      while(size--)
+        *cp++;
+      ret = 1;
+    } else
+      ret = 0;
+
+   sigaction(SIGSEGV, &origsa, NULL);
+   sigprocmask(SIG_SETMASK, &mask, NULL);
+
+   return ret;
+}
+
+int main(int argc, char **argv)
+{
+   is_addressable(0x0, 1);
+   return 0;
+}