PR target/69180
authorchrbr <chrbr@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Jan 2016 15:01:12 +0000 (15:01 +0000)
committerchrbr <chrbr@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Jan 2016 15:01:12 +0000 (15:01 +0000)
* config/arm/arm-c.c (arm_pragma_target_parse): Set NODE_CONDITIONAL
for __ARM_NEON_FP, __ARM_FP, _ARM_FEATURE_LDREX.

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

gcc/ChangeLog
gcc/config/arm/arm-c.c
gcc/testsuite/ChangeLog

index 7af68e6..578717c 100644 (file)
@@ -1,3 +1,9 @@
+2016-01-12  Christian Bruel  <christian.bruel@st.com>
+
+       PR target/69180
+       * config/arm/arm-c.c (arm_pragma_target_parse): Set NODE_CONDITIONAL
+       for __ARM_NEON_FP, __ARM_FP, _ARM_FEATURE_LDREX.
+
 2016-01-12  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/69198
index a0195ce..5810608 100644 (file)
@@ -23,6 +23,7 @@
 #include "c-family/c-common.h"
 #include "tm_p.h"
 #include "c-family/c-pragma.h"
+#include "stringpool.h"
 
 /* Output C specific EABI object attributes.  These can not be done in
    arm.c because they require information from the C frontend.  */
@@ -245,8 +246,18 @@ arm_pragma_target_parse (tree args, tree pop_target)
 
       /* Update macros.  */
       gcc_assert (cur_opt->x_target_flags == target_flags);
-      /* This one can be redefined by the pragma without warning.  */
-      cpp_undef (parse_in, "__ARM_FP");
+
+      /* Don't warn for macros that have context sensitive values depending on
+        other attributes.
+        See warn_of_redefinition, Reset after cpp_create_definition.  */
+      tree acond_macro = get_identifier ("__ARM_NEON_FP");
+      C_CPP_HASHNODE (acond_macro)->flags |= NODE_CONDITIONAL ;
+
+      acond_macro = get_identifier ("__ARM_FP");
+      C_CPP_HASHNODE (acond_macro)->flags |= NODE_CONDITIONAL;
+
+      acond_macro = get_identifier ("__ARM_FEATURE_LDREX");
+      C_CPP_HASHNODE (acond_macro)->flags |= NODE_CONDITIONAL;
 
       arm_cpu_builtins (parse_in);
 
index 98ac650..e6e01c7 100644 (file)
@@ -1,3 +1,8 @@
+2016-01-12  Christian Bruel  <christian.bruel@st.com>
+
+       PR target/69180
+       * gcc.target/arm/pr69180.c: New test.
+
 2016-01-12  Richard Biener  <rguenther@suse.de>
 
        PR lto/69077