aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/config/rs6000/rs6000.cc3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr115713-2.c22
2 files changed, 24 insertions, 1 deletions
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index ce888d3..8521156 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -24694,7 +24694,8 @@ rs6000_inner_target_options (tree args, bool attr_p)
if (strcmp (r, rs6000_opt_vars[i].name) == 0)
{
size_t j = rs6000_opt_vars[i].global_offset;
- *((int *) ((char *)&global_options + j)) = !invert;
+ *((int *) ((char *) &global_options + j)) = !invert;
+ *((int *) ((char *) &global_options_set + j)) = 1;
error_p = false;
not_valid_p = false;
break;
diff --git a/gcc/testsuite/gcc.target/powerpc/pr115713-2.c b/gcc/testsuite/gcc.target/powerpc/pr115713-2.c
new file mode 100644
index 0000000..47b39c0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr115713-2.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* Force power7 to avoid possible error message on AltiVec ABI change. */
+/* { dg-options "-mdejagnu-cpu=power7" } */
+
+/* Verify there is an error message for -mvsx incompatible with
+ -mavoid-indexed-addresses even when they are specified by
+ target attributes. */
+
+int __attribute__ ((target ("avoid-indexed-addresses,vsx")))
+test1 (void)
+{
+ /* { dg-error "'-mvsx' and '-mavoid-indexed-addresses' are incompatible" "" { target *-*-* } .-1 } */
+ return 0;
+}
+
+int __attribute__ ((target ("vsx,avoid-indexed-addresses")))
+test2 (void)
+{
+ /* { dg-error "'-mvsx' and '-mavoid-indexed-addresses' are incompatible" "" { target *-*-* } .-1 } */
+ return 0;
+}
+