]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* c-cppbuiltin.c (cb_register_builtins): Define LP64 builtins for
authoraj <aj@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 12 Mar 2003 20:30:06 +0000 (20:30 +0000)
committeraj <aj@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 12 Mar 2003 20:30:06 +0000 (20:30 +0000)
        LP64 targets.

        * doc/cpp.texi (Common Predefined Macros): Document __LP64__ and
        _LP64.

        * config/ia64/ia64.h (TARGET_CPU_CPP_BUILTINS): Do not define
        _LP64 macros here.
        * config/pa/pa.h (TARGET_CPU_CPP_BUILTINS): Likewise.

        * config/alpha/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove call to
        NETBSD_OS_CPP_BUILTINS_LP64.
        * config/sh/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Likewise.
        * config/sparc/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Likewise.

        * config/netbsd.h (NETBSD_OS_CPP_BUILTINS_LP64): Remove.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64259 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-cppbuiltin.c
gcc/config/alpha/netbsd.h
gcc/config/ia64/ia64.h
gcc/config/netbsd.h
gcc/config/pa/pa.h
gcc/config/sh/netbsd-elf.h
gcc/config/sparc/netbsd-elf.h
gcc/doc/cpp.texi

index f7a12d4a0e84b1bafba2922ac9f0c5243954fd63..6a235c941cb563cb7134911d1e45ed132043f19b 100644 (file)
@@ -1,3 +1,22 @@
+2003-03-12  Andreas Jaeger  <aj@suse.de>
+
+        * c-cppbuiltin.c (cb_register_builtins): Define LP64 builtins for
+        LP64 targets.
+
+        * doc/cpp.texi (Common Predefined Macros): Document __LP64__ and
+        _LP64.
+
+        * config/ia64/ia64.h (TARGET_CPU_CPP_BUILTINS): Do not define
+        _LP64 macros here.
+        * config/pa/pa.h (TARGET_CPU_CPP_BUILTINS): Likewise.
+
+        * config/alpha/netbsd.h (TARGET_OS_CPP_BUILTINS): Remove call to
+        NETBSD_OS_CPP_BUILTINS_LP64.
+        * config/sh/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Likewise.
+        * config/sparc/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Likewise.
+
+        * config/netbsd.h (NETBSD_OS_CPP_BUILTINS_LP64): Remove.
+
 Wed Mar 12 19:04:39 CET 2003  Jan Hubicka  <jh@suse.cz>
 
        * i386.c (ix86_setup_incoming_varargs): Set stack_alignment_needed to 128.
index 35c1645e6dab5d3652fee01c8afd7d9e9a4d140d..a396b6b668d2de2b19141d735aceb61eccd6a698 100644 (file)
@@ -339,6 +339,15 @@ cb_register_builtins (pfile)
   /* Misc.  */
   builtin_define_with_value ("__VERSION__", version_string, 1);
 
+  /* Definitions for LP64 model.  */
+  if (TYPE_PRECISION (long_integer_type_node) == 64
+      && POINTER_SIZE == 64
+      && TYPE_PRECISION (integer_type_node) == 32)
+    {
+      cpp_define (pfile, "_LP64");
+      cpp_define (pfile, "__LP64__");
+    }
+  
   /* Other target-independent built-ins determined by command-line
      options.  */
   if (optimize_size)
index e1da9cfe188aa627aeb8b86a357704cf25cbf69e..117ce3dcf501333a8ab918bdaefa8eb27b127b39 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions of target machine for GNU compiler,
    for Alpha NetBSD systems.
-   Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2002, 2003 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -25,7 +25,6 @@ Boston, MA 02111-1307, USA.  */
 #define TARGET_OS_CPP_BUILTINS()               \
     do {                                       \
        NETBSD_OS_CPP_BUILTINS_ELF();           \
-       NETBSD_OS_CPP_BUILTINS_LP64();          \
     } while (0)
 
 
index a94fbf8de085f411187eec5f8e60caa0c6a492d5..116aec4dd163a2cae711bc3832573eabdc4667a5 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions of target machine GNU compiler.  IA-64 version.
-   Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    Contributed by James E. Wilson <wilson@cygnus.com> and
                  David Mosberger <davidm@hpl.hp.com>.
 
@@ -40,11 +40,6 @@ do {                                         \
        builtin_define("__ia64__");             \
        builtin_define("__itanium__");          \
        builtin_define("__ELF__");              \
-       if (!TARGET_ILP32)                      \
-         {                                     \
-           builtin_define("_LP64");            \
-           builtin_define("__LP64__");         \
-         }                                     \
        if (TARGET_BIG_ENDIAN)                  \
          builtin_define("__BIG_ENDIAN__");     \
 } while (0)
index 0441389962128df9fb5b7eb59a4979bb720b90cb..602f8312b60ce497ba454c44cf7593b8d57b7ce5 100644 (file)
@@ -29,14 +29,6 @@ Boston, MA 02111-1307, USA.  */
     }                                          \
   while (0)
 
-/* TARGET_OS_CPP_BUILTINS() common to all LP64 NetBSD targets.  */
-#define NETBSD_OS_CPP_BUILTINS_LP64()          \
-  do                                           \
-    {                                          \
-      builtin_define ("_LP64");                        \
-    }                                          \
-  while (0)
-
 /* CPP_SPEC parts common to all NetBSD targets.  */
 #define NETBSD_CPP_SPEC                                \
   "%{posix:-D_POSIX_SOURCE} \
index ba533ff0d4d6b876a4ebde8fe38870a63dd704d7..86590583139037675592686cd0b311ea4f78efc6 100644 (file)
@@ -356,11 +356,6 @@ do {                                                               \
      builtin_assert("machine=hppa");                           \
      builtin_define("__hppa");                                 \
      builtin_define("__hppa__");                               \
-     if (TARGET_64BIT)                                         \
-       {                                                       \
-        builtin_define("_LP64");                               \
-        builtin_define("__LP64__");                            \
-       }                                                       \
      if (TARGET_PA_20)                                         \
        builtin_define("_PA_RISC2_0");                          \
      else if (TARGET_PA_11)                                    \
index 513b39f4704a751d774f0c48f52bc42b95301868..d6ccfe0a2040362fbc89a14de08f2a655a16000e 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions for SH running NetBSD using ELF
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
    Contributed by Wasabi Systems, Inc.
 
 This file is part of GNU CC.
@@ -52,8 +52,6 @@ Boston, MA 02111-1307, USA.  */
   do                                                                   \
     {                                                                  \
       NETBSD_OS_CPP_BUILTINS_ELF();                                    \
-      if (TARGET_SHMEDIA64)                                            \
-       NETBSD_OS_CPP_BUILTINS_LP64();                                  \
       builtin_define ("__NO_LEADING_UNDERSCORES__");                   \
     }                                                                  \
   while (0)
index 7e0d70d9e79ced4682265ffd6b6e5b8299ec3de9..65901c8bf0b748d3f0cc453b801090cc0de288ba 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions of target machine for GNU compiler, for ELF on NetBSD/sparc
    and NetBSD/sparc64.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
    Contributed by Matthew Green (mrg@eterna.com.au).
 
 This file is part of GNU CC.
@@ -26,7 +26,6 @@ Boston, MA 02111-1307, USA.  */
       NETBSD_OS_CPP_BUILTINS_ELF();                    \
       if (TARGET_ARCH64)                               \
        {                                               \
-         NETBSD_OS_CPP_BUILTINS_LP64();                \
          builtin_define ("__sparc64__");               \
          builtin_define ("__sparc_v9__");              \
        }                                               \
index a6d6fb0db9f2c21cc4d2846e8ba5e687e3f56fd6..cf962c4563a381f495d6d4a9315587d24bb52875 100644 (file)
@@ -2031,6 +2031,12 @@ This macro is defined, with value 1, if (and only if) the NeXT runtime
 (as in @option{-fnext-runtime}) is in use for Objective-C.  If the GNU
 runtime is used, this macro is not defined, so that you can use this
 macro to determine which runtime (NeXT or GNU) is being used.
+
+@item __LP64__
+@item _LP64
+These macros are defined, with value 1, if (and only if) the compilation
+is for a target where @code{long int} and pointer both use 64-bits and
+@code{int} uses 32-bit.
 @end table
 
 @node System-specific Predefined Macros