From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83603 invoked by alias); 11 Dec 2015 09:10:21 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 83566 invoked by uid 89); 11 Dec 2015 09:10:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Fri, 11 Dec 2015 09:10:18 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 5D2A9ABBB for ; Fri, 11 Dec 2015 09:10:15 +0000 (UTC) Subject: [PATCH, i386]: Fix PR 67484 (version 2) To: gcc-patches@gcc.gnu.org References: From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <566A92F6.2060709@suse.cz> Date: Fri, 11 Dec 2015 09:10:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------030904090108050703070909" X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg01220.txt.bz2 This is a multi-part message in MIME format. --------------030904090108050703070909 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Content-length: 221 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 --------------030904090108050703070909 Content-Type: text/x-patch; name="0001-Fix-PR-target-67484.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Fix-PR-target-67484.patch" Content-length: 1496 >From f0eca2d3efd711498fbc8b7e8980fdf32f0abfd0 Mon Sep 17 00:00:00 2001 From: marxin Date: Thu, 10 Dec 2015 14:02:13 +0100 Subject: [PATCH] Fix PR target/67484 gcc/ChangeLog: 2015-12-10 Martin Liska Uros Bizjak 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 --------------030904090108050703070909--