From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6836 invoked by alias); 24 Nov 2014 14:58:20 -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 6826 invoked by uid 89); 24 Nov 2014 14:58:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_STOCKGEN,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no 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; Mon, 24 Nov 2014 14:58:13 +0000 Received: by mail-ob0-f177.google.com with SMTP id va2so6983768obc.22 for ; Mon, 24 Nov 2014 06:58:11 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.182.213.72 with SMTP id nq8mr3458243obc.11.1416841091699; Mon, 24 Nov 2014 06:58:11 -0800 (PST) Received: by 10.76.185.7 with HTTP; Mon, 24 Nov 2014 06:58:11 -0800 (PST) In-Reply-To: <20141021160336.GZ10376@tucnak.redhat.com> References: <20140923135437.GD35262@msticlxl57.ims.intel.com> <20140923143419.GN17454@tucnak.redhat.com> <54219900.6060903@redhat.com> <20140923160302.GR17454@tucnak.redhat.com> <54219B76.3080607@redhat.com> <5422E2E3.807@redhat.com> <542335AC.9010707@redhat.com> <20140929110856.GD17454@tucnak.redhat.com> <20141021160336.GZ10376@tucnak.redhat.com> Date: Mon, 24 Nov 2014 15:57:00 -0000 Message-ID: Subject: Re: [PATCH] Improve i?86 address delegitimization after 32-bit pic changes (PR target/63542) From: "H.J. Lu" To: Jakub Jelinek Cc: Uros Bizjak , Jeff Law , Ilya Enkovich , Vladimir Makarov , gcc-patches , Evgeny Stupachenko , Richard Biener , Petr Machata Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-11/txt/msg03016.txt.bz2 On Tue, Oct 21, 2014 at 9:03 AM, Jakub Jelinek wrote: > On Mon, Sep 29, 2014 at 01:08:56PM +0200, Jakub Jelinek wrote: >> I wonder if during/after reload we just couldn't look at >> ORIGINAL_REGNO of hard regs if ix86_use_pseudo_pic_reg. Or is that >> the other case, where you don't have any PIC register replacement around, >> and want to subtract something? Perhaps in that case we could just >> subtract the value of _GLOBAL_OFFSET_TABLE_ symbol if we have nothing better >> around. > > Here is a patch that implements both of these ideas. > > The number of lines like: > note: non-delegitimized UNSPEC UNSPEC_GOT (0) found in variable location > note: non-delegitimized UNSPEC UNSPEC_GOTOFF (1) found in variable location > during i686-linux bootstrap (not including regtest) went down from > 14165 to 19. > > The patch trusts that a hard reg with ORIGINAL_REGNO containing the pic > pseudo contains the _GLOBAL_OFFSET_TABLE_ value of the current shared > library (or binary), I think that is reasonable assumption. > And for ELF for the UNSPEC_GOTOFF it worse case can subtract > _GLOBAL_OFFSET_TABLE_ symbol if it doesn't know what register to subtract. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > 2014-10-21 Jakub Jelinek > > PR target/63542 > * config/i386/i386.c (ix86_pic_register_p): Also return > true if x is a hard register with ORIGINAL_REGNO equal to > pic_offset_table_rtx pseudo REGNO. > (ix86_delegitimize_address): For ix86_use_pseudo_pic_reg () > after reload, subtract GOT_SYMBOL_NAME symbol if possible. > > * gcc.target/i386/pr63542-1.c: New test. > * gcc.target/i386/pr63542-2.c: New test. > This caused: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64025 -- H.J.