aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMichael Meissner <meissner@linux.vnet.ibm.com>2013-10-16 23:06:36 +0000
committerMichael Meissner <meissner@gcc.gnu.org>2013-10-16 23:06:36 +0000
commitd358fb9dae37dfe948ef87af4d8951dac4cd3646 (patch)
tree4fd1b471ea70ecad1296a167c84af47d24aa2b72 /gcc
parentc71aed477a177675e0887142a4a045c527860d51 (diff)
downloadgcc-d358fb9dae37dfe948ef87af4d8951dac4cd3646.zip
gcc-d358fb9dae37dfe948ef87af4d8951dac4cd3646.tar.gz
gcc-d358fb9dae37dfe948ef87af4d8951dac4cd3646.tar.bz2
re PR target/57756 (Function target attribute is retaining state of previously seen function)
2013-10-16 Michael Meissner <meissner@linux.vnet.ibm.com> PR target/57756 * config/rs6000/rs6000.opt (rs6000_isa_flags_explicit): Move the explicit isa flag to be an options variable, instead of using global_options_set. Remove define from rs6000.h. * config/rs6000/rs6000.h (rs6000_isa_flags_explicit): Likewise. * config/rs6000/rs6000.c (rs6000_option_override_internal): Initialize rs6000_isa_flags_explicit. (rs6000_function_specific_save): Add gcc_options* parameter, so that the powerpc builds after the 2013-10-15 changes. (rs6000_function_specific_restore): Likewise. From-SVN: r203734
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/config/rs6000/rs6000.c19
-rw-r--r--gcc/config/rs6000/rs6000.h3
-rw-r--r--gcc/config/rs6000/rs6000.opt3
4 files changed, 30 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 83541b2..de8bf88 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+2013-10-16 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/57756
+ * config/rs6000/rs6000.opt (rs6000_isa_flags_explicit): Move the
+ explicit isa flag to be an options variable, instead of using
+ global_options_set. Remove define from rs6000.h.
+ * config/rs6000/rs6000.h (rs6000_isa_flags_explicit): Likewise.
+
+ * config/rs6000/rs6000.c (rs6000_option_override_internal):
+ Initialize rs6000_isa_flags_explicit.
+ (rs6000_function_specific_save): Add gcc_options* parameter, so
+ that the powerpc builds after the 2013-10-15 changes.
+ (rs6000_function_specific_restore): Likewise.
+
2013-10-16 DJ Delorie <dj@redhat.com>
* config/rl78/rl78.c (rl78_alloc_address_registers_macax): Verify
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 1523816..63f68c4 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -2796,6 +2796,10 @@ rs6000_option_override_internal (bool global_init_p)
= ((global_init_p || target_option_default_node == NULL)
? NULL : TREE_TARGET_OPTION (target_option_default_node));
+ /* Remember the explicit arguments. */
+ if (global_init_p)
+ rs6000_isa_flags_explicit = global_options_set.x_rs6000_isa_flags;
+
/* On 64-bit Darwin, power alignment is ABI-incompatible with some C
library functions, so warn about it. The flag may be useful for
performance studies from time to time though, so don't disable it
@@ -29995,19 +29999,22 @@ rs6000_set_current_function (tree fndecl)
/* Save the current options */
static void
-rs6000_function_specific_save (struct cl_target_option *ptr)
+rs6000_function_specific_save (struct cl_target_option *ptr,
+ struct gcc_options *opts)
{
- ptr->x_rs6000_isa_flags = rs6000_isa_flags;
- ptr->x_rs6000_isa_flags_explicit = rs6000_isa_flags_explicit;
+ ptr->x_rs6000_isa_flags = opts->x_rs6000_isa_flags;
+ ptr->x_rs6000_isa_flags_explicit = opts->x_rs6000_isa_flags_explicit;
}
/* Restore the current options */
static void
-rs6000_function_specific_restore (struct cl_target_option *ptr)
+rs6000_function_specific_restore (struct gcc_options *opts,
+ struct cl_target_option *ptr)
+
{
- rs6000_isa_flags = ptr->x_rs6000_isa_flags;
- rs6000_isa_flags_explicit = ptr->x_rs6000_isa_flags_explicit;
+ opts->x_rs6000_isa_flags = ptr->x_rs6000_isa_flags;
+ opts->x_rs6000_isa_flags_explicit = ptr->x_rs6000_isa_flags_explicit;
(void) rs6000_option_override_internal (false);
}
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index c4d57d8..745437e 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -593,9 +593,6 @@ extern int rs6000_vector_align[];
#define MASK_PROTOTYPE OPTION_MASK_PROTOTYPE
#endif
-/* Explicit ISA options that were set. */
-#define rs6000_isa_flags_explicit global_options_set.x_rs6000_isa_flags
-
/* For power systems, we want to enable Altivec and VSX builtins even if the
user did not use -maltivec or -mvsx to allow the builtins to be used inside
of #pragma GCC target or the target attribute to change the code level for a
diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
index eae75f5..c3f9c2d 100644
--- a/gcc/config/rs6000/rs6000.opt
+++ b/gcc/config/rs6000/rs6000.opt
@@ -30,6 +30,9 @@ TargetSave
HOST_WIDE_INT x_rs6000_isa_flags
;; Miscellaneous flag bits that were set explicitly by the user
+Variable
+HOST_WIDE_INT rs6000_isa_flags_explicit
+
TargetSave
HOST_WIDE_INT x_rs6000_isa_flags_explicit