[arm] __arm__/__thumb__ vs. #machine(arm)
Paul Brook
paul@codesourcery.com
Tue Dec 30 17:58:00 GMT 2003
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) \
More information about the Gcc-patches
mailing list