From patchwork Fri Oct 31 15:34:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zamyatin, Igor" X-Patchwork-Id: 405354 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C2C7014007D for ; Sat, 1 Nov 2014 02:35:04 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:content-type :content-transfer-encoding:mime-version; q=dns; s=default; b=Ik3 2OL2/zqZRw8UpPWNEjz5I2Lmtmi6Sk9BIAnriMbLR0Khaq7NUnleJ36L2J/hueXs N638cC2f0AnvzeQ0by5LzWJgwPHHZR8CV36EafXddA4MOzHb1iA155DJTEfCcu4J BD11C97SgXbycWldJ0v2Ak3JPZpFVwZbEqRYg2jY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:content-type :content-transfer-encoding:mime-version; s=default; bh=dd4RKKTVW GyCTo49HpQdAKcT2sA=; b=ShrnncJJne5B+nhhAIIMeFgdhJ01+bN5Y/Zfc+Nwc H9gmuohqOMtRgvzIpukwuS6ZIXVLnQGk5vWoaoccGerXHMowbmbR6VxjmqVq0h/W dNoi4GSETavvXdgvxv/mP9Dvz9gnNWmQ04i9/XIRCs2LsInorD9VGBBPu7U/wx+t 18= Received: (qmail 23752 invoked by alias); 31 Oct 2014 15:34:37 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 23677 invoked by uid 89); 31 Oct 2014 15:34:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mga14.intel.com Received: from mga14.intel.com (HELO mga14.intel.com) (192.55.52.115) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 31 Oct 2014 15:34:35 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 31 Oct 2014 08:28:20 -0700 X-ExtLoop1: 1 Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga001.fm.intel.com with ESMTP; 31 Oct 2014 08:34:22 -0700 Received: from irsmsx153.ger.corp.intel.com (163.33.192.75) by IRSMSX103.ger.corp.intel.com (163.33.3.157) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 31 Oct 2014 15:34:22 +0000 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.144]) by IRSMSX153.ger.corp.intel.com ([169.254.9.23]) with mapi id 14.03.0195.001; Fri, 31 Oct 2014 15:34:22 +0000 From: "Zamyatin, Igor" To: "GCC Patches (gcc-patches@gcc.gnu.org)" Subject: [PATCH, i686] Fix for asan test failures with -m32 happened after EBX enabling in PIC mode Date: Fri, 31 Oct 2014 15:34:21 +0000 Message-ID: <0EFAB2BDD0F67E4FB6CCC8B9F87D756969C18BCF@IRSMSX101.ger.corp.intel.com> MIME-Version: 1.0 X-IsSubscribed: yes Hi! Following patch (moving initialization of pic_offset_table_rtx earlier) fixes failures for asan tests on 32 bits in PIC mode mentioned here - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63534#c48 Bootstrapped/regtested on x86_64, i686 Is it ok for trunk? ChangeLog: 2014-10-30 Igor Zamyatin * function.c (assign_parms): Move init of pic_offset_table_rtx from here to... * cfgexpand.c (expand_used_vars): ...here. diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 9bd6135..cf7d94a 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -1718,6 +1718,11 @@ expand_used_vars (void) init_vars_expansion (); + /* Initialize pic_offset_table_rtx with a pseudo register + if required. */ + if (targetm.use_pseudo_pic_reg ()) + pic_offset_table_rtx = gen_reg_rtx (Pmode); + hash_map ssa_name_decls; for (i = 0; i < SA.map->num_partitions; i++) { diff --git a/gcc/function.c b/gcc/function.c index 1ef43c4..0bbcbbb 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -3464,11 +3464,6 @@ assign_parms (tree fndecl) fnargs.release (); - /* Initialize pic_offset_table_rtx with a pseudo register - if required. */ - if (targetm.use_pseudo_pic_reg ()) - pic_offset_table_rtx = gen_reg_rtx (Pmode); - /* Output all parameter conversion instructions (possibly including calls) now that all parameters have been copied out of hard registers. */ emit_insn (all.first_conversion_insn);