diff mbox

[i386] : Fix PR 67484 (version 2)

Message ID 566A92F6.2060709@suse.cz
State New
Headers show

Commit Message

Martin Liška Dec. 11, 2015, 9:10 a.m. UTC
Hello.

I've just applied suggested change that Richi proposed.
The patch can bootstrap on x86_64-linux-gnu and survives regression tests. Moreover,
the memory leak/invalid read has gone.

Ready for trunk?
Thanks,
Martin

Comments

Richard Biener Dec. 11, 2015, 10:41 a.m. UTC | #1
On Fri, Dec 11, 2015 at 10:10 AM, Martin Liška <mliska@suse.cz> wrote:
> Hello.
>
> I've just applied suggested change that Richi proposed.
> The patch can bootstrap on x86_64-linux-gnu and survives regression tests. Moreover,
> the memory leak/invalid read has gone.
>
> Ready for trunk?

Ok.

Thanks,
Richard.

> Thanks,
> Martin
diff mbox

Patch

From f0eca2d3efd711498fbc8b7e8980fdf32f0abfd0 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Thu, 10 Dec 2015 14:02:13 +0100
Subject: [PATCH] Fix PR target/67484

gcc/ChangeLog:

2015-12-10  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.
---
 gcc/config/i386/i386.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index d30fbff..2eacea7 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -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;
 
-- 
2.6.3