diff mbox series

[Darwin,PPC,committed] Fix fail of cpp/assert4.c

Message ID 3B8B36F6-8E95-40FF-B174-D227A503B1E6@sandoe.co.uk
State New
Headers show
Series [Darwin,PPC,committed] Fix fail of cpp/assert4.c | expand

Commit Message

Iain Sandoe Aug. 18, 2019, 6:48 p.m. UTC
Despite that the cpp assert facility is deprecated, we do have a test
for it.

This test needs the cpu and machine asserts to be implemented
which hadn't been done for PPC Darwin.  Fixed thus.

tested on powerpc-darwin9,
applied to mainline,
Iain

gcc/

2019-08-18  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/darwin.h (TARGET_OS_CPP_BUILTINS): Add asserts
	for cpu and machine.  Factor 64/32b builtins.
diff mbox series

Patch

diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
index 150dc4f4cd..a626325c2d 100644
--- a/gcc/config/rs6000/darwin.h
+++ b/gcc/config/rs6000/darwin.h
@@ -52,11 +52,23 @@ 
 #define TARGET_OS_CPP_BUILTINS()                       \
   do                                                   \
     {                                                  \
-      if (!TARGET_64BIT) builtin_define ("__ppc__");   \
-      if (!TARGET_64BIT) builtin_define ("__PPC__");   \
-      if (TARGET_64BIT) builtin_define ("__ppc64__");  \
-      if (TARGET_64BIT) builtin_define ("__PPC64__");  \
       builtin_define ("__POWERPC__");                  \
+      builtin_define ("__PPC__");                      \
+      if (TARGET_64BIT)                                        \
+       {                                               \
+         builtin_define ("__ppc64__");                 \
+         builtin_define ("__PPC64__");                 \
+         builtin_define ("__powerpc64__");             \
+         builtin_assert ("cpu=powerpc64");             \
+         builtin_assert ("machine=powerpc64");         \
+       }                                               \
+      else                                             \
+       {                                               \
+         builtin_define ("__ppc__");                   \
+         builtin_define_std ("PPC");                   \
+         builtin_assert ("cpu=powerpc");               \
+         builtin_assert ("machine=powerpc");           \
+       }                                               \
       builtin_define ("__NATURAL_ALIGNMENT__");                \
       darwin_cpp_builtins (pfile);                     \
     }                                                  \