aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-11-20 09:31:43 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-11-20 09:31:43 +0100
commit94cdd3b7ceff688d039a9f134013ac9069df2e8c (patch)
tree9b47cc4a3c64711978a4c4b17f818b1d50168b66 /gcc/config
parent7313f6cf21109d6cea9f17e749ffbf8fc8d7febc (diff)
downloadgcc-94cdd3b7ceff688d039a9f134013ac9069df2e8c.zip
gcc-94cdd3b7ceff688d039a9f134013ac9069df2e8c.tar.gz
gcc-94cdd3b7ceff688d039a9f134013ac9069df2e8c.tar.bz2
re PR target/90867 (Multiplication or typecast of integer and double always zero when...)
PR target/90867 * config/i386/i386-options.c (ix86_valid_target_attribute_tree): Don't clear opts->x_ix86_isa_flags{,2} here... (ix86_valid_target_attribute_inner_p): ... but here when seeing arch=. Also clear opts->x_ix86_isa_flags{,2}_explicit. * gcc.target/i386/pr90867.c: New test. From-SVN: r278482
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/i386-options.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/gcc/config/i386/i386-options.c b/gcc/config/i386/i386-options.c
index 128511e..79ccc32 100644
--- a/gcc/config/i386/i386-options.c
+++ b/gcc/config/i386/i386-options.c
@@ -1147,7 +1147,25 @@ ix86_valid_target_attribute_inner_p (tree fndecl, tree args, char *p_strings[],
ret = false;
}
else
- p_strings[opt] = xstrdup (p + opt_len);
+ {
+ p_strings[opt] = xstrdup (p + opt_len);
+ if (opt == IX86_FUNCTION_SPECIFIC_ARCH)
+ {
+ /* If arch= is set, clear all bits in x_ix86_isa_flags,
+ except for ISA_64BIT, ABI_64, ABI_X32, and CODE16
+ and all bits in x_ix86_isa_flags2. */
+ opts->x_ix86_isa_flags &= (OPTION_MASK_ISA_64BIT
+ | OPTION_MASK_ABI_64
+ | OPTION_MASK_ABI_X32
+ | OPTION_MASK_CODE16);
+ opts->x_ix86_isa_flags_explicit &= (OPTION_MASK_ISA_64BIT
+ | OPTION_MASK_ABI_64
+ | OPTION_MASK_ABI_X32
+ | OPTION_MASK_CODE16);
+ opts->x_ix86_isa_flags2 = 0;
+ opts->x_ix86_isa_flags2_explicit = 0;
+ }
+ }
}
else if (type == ix86_opt_enum)
@@ -1225,18 +1243,8 @@ ix86_valid_target_attribute_tree (tree fndecl, tree args,
/* If we are using the default tune= or arch=, undo the string assigned,
and use the default. */
if (option_strings[IX86_FUNCTION_SPECIFIC_ARCH])
- {
- opts->x_ix86_arch_string
- = ggc_strdup (option_strings[IX86_FUNCTION_SPECIFIC_ARCH]);
-
- /* If arch= is set, clear all bits in x_ix86_isa_flags,
- except for ISA_64BIT, ABI_64, ABI_X32, and CODE16. */
- opts->x_ix86_isa_flags &= (OPTION_MASK_ISA_64BIT
- | OPTION_MASK_ABI_64
- | OPTION_MASK_ABI_X32
- | OPTION_MASK_CODE16);
- opts->x_ix86_isa_flags2 = 0;
- }
+ opts->x_ix86_arch_string
+ = ggc_strdup (option_strings[IX86_FUNCTION_SPECIFIC_ARCH]);
else if (!orig_arch_specified)
opts->x_ix86_arch_string = NULL;