re PR target/67484 (options-save.c sanitizer asan detects freed storage referenced...
authorMartin Liska <mliska@suse.cz>
Fri, 11 Dec 2015 10:59:29 +0000 (11:59 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Fri, 11 Dec 2015 10:59:29 +0000 (10:59 +0000)
Fix PR target/67484

    Uros Bizjak  <ubizjak@gmail.com>

PR target/67484
* config/i386/i386.c (ix86_valid_target_attribute_tree):
Use ggc_strdup to copy option_strings to opts->x_ix86_arch_string and
opts->x_ix86_tune_string.

From-SVN: r231556

gcc/ChangeLog
gcc/config/i386/i386.c

index c150e00dc3ee568d61474ddda691af9fc6a8d4e8..de877d493c9d47cd8df1bcf5cd75b40345023c41 100644 (file)
@@ -1,3 +1,12 @@
+2015-12-11  Martin Liska  <mliska@suse.cz>
+
+           Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/67484
+       * config/i386/i386.c (ix86_valid_target_attribute_tree):
+       Use ggc_strdup to copy option_strings to opts->x_ix86_arch_string and
+       opts->x_ix86_tune_string.
+
 2015-12-11  Richard Biener  <rguenther@suse.de>
 
        * lto-streamer.h (lto_simple_header_with_strings): Remove
index e565c0bc643a13ba65f2c53843dc2486c519994e..cecea2496a960ed32bb2cdf6f4f3d53ec42cf655 100644 (file)
@@ -6152,7 +6152,7 @@ ix86_valid_target_attribute_tree (tree args,
       if (option_strings[IX86_FUNCTION_SPECIFIC_ARCH])
        {
          opts->x_ix86_arch_string
-           = option_strings[IX86_FUNCTION_SPECIFIC_ARCH];
+           = 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.  */
@@ -6166,7 +6166,8 @@ ix86_valid_target_attribute_tree (tree args,
        opts->x_ix86_arch_string = NULL;
 
       if (option_strings[IX86_FUNCTION_SPECIFIC_TUNE])
-       opts->x_ix86_tune_string = option_strings[IX86_FUNCTION_SPECIFIC_TUNE];
+       opts->x_ix86_tune_string
+         = ggc_strdup (option_strings[IX86_FUNCTION_SPECIFIC_TUNE]);
       else if (orig_tune_defaulted)
        opts->x_ix86_tune_string = NULL;