From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22662 invoked by alias); 28 Aug 2014 08:28: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 22653 invoked by uid 89); 28 Aug 2014 08:28:21 -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,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ig0-f171.google.com Received: from mail-ig0-f171.google.com (HELO mail-ig0-f171.google.com) (209.85.213.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 28 Aug 2014 08:28:20 +0000 Received: by mail-ig0-f171.google.com with SMTP id l13so7647929iga.4 for ; Thu, 28 Aug 2014 01:28:18 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.42.60.211 with SMTP id r19mr2924383ich.64.1409214498398; Thu, 28 Aug 2014 01:28:18 -0700 (PDT) Received: by 10.64.143.5 with HTTP; Thu, 28 Aug 2014 01:28:18 -0700 (PDT) In-Reply-To: <53FE3D46.8050904@redhat.com> References: <20140707114750.GB31640@tucnak.redhat.com> <20140822121151.GA60032@msticlxl57.ims.intel.com> <53FB5184.3030500@redhat.com> <53FCA6F5.7020405@redhat.com> <20140826213712.GA39451@msticlxl57.ims.intel.com> <53FE3D46.8050904@redhat.com> Date: Thu, 28 Aug 2014 08:28:00 -0000 Message-ID: Subject: Re: Enable EBX for x86 in 32bits PIC code From: Ilya Enkovich To: Vladimir Makarov Cc: gcc@gnu.org, gcc-patches , Evgeny Stupachenko , Richard Biener , Uros Bizjak , Jeff Law Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg02547.txt.bz2 2014-08-28 0:19 GMT+04:00 Vladimir Makarov : > On 2014-08-26 5:42 PM, Ilya Enkovich wrote: >> >> Hi, >> >> Here is a patch I tried. I apply it over revision 214215. Unfortunately >> I do not have a small reproducer but the problem can be easily reproduced on >> SPEC2000 benchmark 175.vpr. The problem is in read_arch.c:701 where float >> value is compared with float constant 1.0. It is inlined into read_arch >> function and can be easily found in RTL dump of function read_arch as a >> float comparison with 1.0 after the first call to strtod function. >> >> Here is a compilation string I use: >> >> gcc -m32 -mno-movbe -g3 -fdump-rtl-all-details -O2 -ffast-math >> -mfpmath=sse -m32 -march=slm -fPIE -pie -c -o read_arch.o >> -DSPEC_CPU2000 read_arch.c >> >> In my final assembler comparison with 1.0 looks like: >> >> comiss .LC11@GOTOFF(%ebp), %xmm0 # 1101 *cmpisf_sse [length = >> 7] >> >> and %ebp here doesn't have a proper value. >> >> I'll try to make a smaller reproducer if these instructions don't help. > > > I've managed to reproduce it. Although it would be better to send the patch > as an attachment. > > The problem is actually in IRA not LRA. IRA splits pseudo used for PIC. > Then in a region when a *new* pseudo used as PIC we rematerialize a constant > which transformed in memory addressed through *original* PIC pseudo. > > To solve the problem we should prevent such splitting and guarantee that PIC > pseudo allocnos in different region gets the same hard reg. > > The following patch should solve the problem. > Thanks for the patch! I'll try it and be back with results. Ilya >