This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[arm] __arm__/__thumb__ vs. #machine(arm)
- From: Paul Brook <paul at codesourcery dot com>
- To: Mark Mitchell <mark at codesourcery dot com>,Richard Earnshaw <rearnsha at arm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 30 Dec 2003 16:12:23 +0000
- Subject: [arm] __arm__/__thumb__ vs. #machine(arm)
- Organization: CodeSourcery
We're currently failing gcc.dg/cpp/assert4.c in thumb mode. The test assumes
that #machine (arm) == defined __arm__. However with -mthumb we only define
__thumb__.
The (trivial) below changes this so that __arm__ is also defined with -mthumb.
This is consistent with __ARMEL__ vs. __THUMBEL__.
Is this the correct solution?
The alterative solution is to fix the testcase to check for
defined __arm__ || defined __thumb__.
Paul
2003-30-12 Paul Brook <paul@codesourcery.com>
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Always define __arm__.
Index: gcc/config/arm/arm.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.h,v
retrieving revision 1.210.2.6
diff -u -p -r1.210.2.6 arm.h
--- gcc/config/arm/arm.h 29 Dec 2003 18:24:11 -0000 1.210.2.6
+++ gcc/config/arm/arm.h 30 Dec 2003 16:02:51 -0000
@@ -30,9 +30,8 @@
#define TARGET_CPU_CPP_BUILTINS() \
do \
{ \
- if (TARGET_ARM) \
- builtin_define ("__arm__"); \
- else \
+ builtin_define ("__arm__"); \
+ if (TARGET_THUMB) \
builtin_define ("__thumb__"); \
\
if (TARGET_BIG_END) \