From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10535 invoked by alias); 13 Nov 2014 13:14:22 -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 10524 invoked by uid 89); 13 Nov 2014 13:14:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f177.google.com Received: from mail-ob0-f177.google.com (HELO mail-ob0-f177.google.com) (209.85.214.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 13 Nov 2014 13:14:19 +0000 Received: by mail-ob0-f177.google.com with SMTP id m8so10466646obr.22 for ; Thu, 13 Nov 2014 05:14:17 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.182.24.8 with SMTP id q8mr2059765obf.26.1415884457740; Thu, 13 Nov 2014 05:14:17 -0800 (PST) Received: by 10.76.84.102 with HTTP; Thu, 13 Nov 2014 05:14:17 -0800 (PST) In-Reply-To: <0EFAB2BDD0F67E4FB6CCC8B9F87D756969C25D63@IRSMSX101.ger.corp.intel.com> References: <0EFAB2BDD0F67E4FB6CCC8B9F87D756969C18BCF@IRSMSX101.ger.corp.intel.com> <5453D872.3070402@redhat.com> <0EFAB2BDD0F67E4FB6CCC8B9F87D756969C25D63@IRSMSX101.ger.corp.intel.com> Date: Thu, 13 Nov 2014 13:20:00 -0000 Message-ID: Subject: Re: [PATCH, i686] Fix for asan test failures with -m32 happened after EBX enabling in PIC mode From: "H.J. Lu" To: "Zamyatin, Igor" Cc: Jeff Law , "GCC Patches (gcc-patches@gcc.gnu.org)" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-11/txt/msg01469.txt.bz2 On Wed, Nov 5, 2014 at 7:17 AM, Zamyatin, Igor wrote: >> > 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. >> The patch is probably fine. However, it would be good to have the analysis >> why you want to move initialization of the PIC register earlier. > > Asan (and anybody else can) emits global variable(s) in expand_used_vars during function expanding while pic reg is currently initialized later, during expand_function_start in assign_parms thus to be late in asan case in PIC mode. > > So to avoid such cases we put pic reg initialization in the beginning of expand_used_vars. This seems to be early enough. > Please mention PR in ChangeLog and add a few testcases so that the fix will be tested on Linux. -- H.J.