public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Vladimir Makarov <vmakarov@redhat.com>
To: Ilya Enkovich <enkovich.gnu@gmail.com>
Cc: gcc@gnu.org, gcc-patches <gcc-patches@gcc.gnu.org>,
	       Evgeny Stupachenko <evstupac@gmail.com>,
	       Richard Biener <richard.guenther@gmail.com>,
	       Uros Bizjak <ubizjak@gmail.com>, Jeff Law <law@redhat.com>
Subject: Re: Enable EBX for x86 in 32bits PIC code
Date: Wed, 27 Aug 2014 20:19:00 -0000	[thread overview]
Message-ID: <53FE3D46.8050904@redhat.com> (raw)
In-Reply-To: <20140826213712.GA39451@msticlxl57.ims.intel.com>

[-- Attachment #1: Type: text/plain, Size: 1470 bytes --]

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.



[-- Attachment #2: z --]
[-- Type: text/plain, Size: 1281 bytes --]

Index: ira-color.c
===================================================================
--- ira-color.c	(revision 214576)
+++ ira-color.c	(working copy)
@@ -3239,9 +3239,10 @@
 	  ira_assert (ALLOCNO_CLASS (subloop_allocno) == rclass);
 	  ira_assert (bitmap_bit_p (subloop_node->all_allocnos,
 				    ALLOCNO_NUM (subloop_allocno)));
-	  if ((flag_ira_region == IRA_REGION_MIXED)
-	      && (loop_tree_node->reg_pressure[pclass]
-		  <= ira_class_hard_regs_num[pclass]))
+	  if ((flag_ira_region == IRA_REGION_MIXED
+	       && (loop_tree_node->reg_pressure[pclass]
+		   <= ira_class_hard_regs_num[pclass]))
+	      || regno == (int) REGNO (pic_offset_table_rtx))
 	    {
 	      if (! ALLOCNO_ASSIGNED_P (subloop_allocno))
 		{
Index: ira-emit.c
===================================================================
--- ira-emit.c	(revision 214576)
+++ ira-emit.c	(working copy)
@@ -620,7 +620,8 @@
 		  /* don't create copies because reload can spill an
 		     allocno set by copy although the allocno will not
 		     get memory slot.  */
-		  || ira_equiv_no_lvalue_p (regno)))
+		  || ira_equiv_no_lvalue_p (regno)
+		  || ALLOCNO_REGNO (allocno) == REGNO (pic_offset_table_rtx)))
 	    continue;
 	  original_reg = allocno_emit_reg (allocno);
 	  if (parent_allocno == NULL

  reply	other threads:[~2014-08-27 20:19 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAOvf_xxsQ_oYGqNAVQ1+BW+CuD3mzebZ2xma0jpF=WfyZMCRCA@mail.gmail.com>
     [not found] ` <CAFiYyc1mFtTezkTJORmJJq+yht=qPSwiN7KDn19+bSuSdaqvMQ@mail.gmail.com>
     [not found]   ` <CAOvf_xyeVeg2oB9Xxz8RMEQ6gyfJY5whd9s4ygoAAEaMU9efnA@mail.gmail.com>
     [not found]     ` <20140707114750.GB31640@tucnak.redhat.com>
     [not found]       ` <CAMbmDYZV_fx0jxmKHhLsC2pJ7pDzuu6toEAH72izOdpq6KGyfg@mail.gmail.com>
2014-08-22 12:21         ` Ilya Enkovich
2014-08-23  1:47           ` Hans-Peter Nilsson
2014-08-25  9:25             ` Ilya Enkovich
2014-08-25 11:24               ` Hans-Peter Nilsson
2014-08-25 11:43                 ` Ilya Enkovich
2014-08-25 15:09           ` Vladimir Makarov
2014-08-26  7:49             ` Ilya Enkovich
2014-08-26  8:57               ` Ilya Enkovich
2014-08-26 15:25                 ` Vladimir Makarov
2014-08-26 21:42                   ` Ilya Enkovich
2014-08-27 20:19                     ` Vladimir Makarov [this message]
2014-08-28  8:28                       ` Ilya Enkovich
2014-08-29  6:47                         ` Ilya Enkovich
2014-09-02 14:29                           ` Vladimir Makarov
2014-09-03 20:19                           ` Vladimir Makarov
     [not found]                             ` <0EFAB2BDD0F67E4FB6CCC8B9F87D756969B3A89D@IRSMSX101.ger.corp.intel.com>
2014-09-09 16:43                               ` Vladimir Makarov
2014-09-11 19:57                                 ` Jeff Law
2014-09-23 13:54                             ` Ilya Enkovich
2014-09-23 14:23                               ` Uros Bizjak
2014-09-23 15:59                                 ` Jeff Law
2014-09-23 14:34                               ` Jakub Jelinek
2014-09-23 15:59                                 ` Petr Machata
2014-09-23 16:00                                 ` Jeff Law
2014-09-23 16:03                                   ` Jakub Jelinek
2014-09-23 16:10                                     ` Jeff Law
2014-09-24  6:56                                       ` Ilya Enkovich
2014-09-24 15:27                                         ` Jeff Law
2014-09-24 20:32                                           ` Ilya Enkovich
2014-09-24 21:20                                             ` Jeff Law
2014-09-29 11:09                                               ` Jakub Jelinek
2014-10-21 16:05                                                 ` [PATCH] Improve i?86 address delegitimization after 32-bit pic changes (PR target/63542) Jakub Jelinek
2014-10-22  2:02                                                   ` Jeff Law
2014-11-24 15:57                                                   ` H.J. Lu
2014-08-27 21:39                     ` Enable EBX for x86 in 32bits PIC code Jeff Law
2014-08-28  8:37                       ` Ilya Enkovich
2014-08-28 12:43                         ` Uros Bizjak
2014-08-28 12:54                           ` Ilya Enkovich
2014-08-28 13:08                             ` Uros Bizjak
2014-08-28 13:29                               ` Ilya Enkovich
2014-08-28 16:25                                 ` Uros Bizjak
2014-08-29 18:56                         ` Jeff Law
2014-08-25 17:30           ` Jeff Law
2014-08-28 13:01           ` Uros Bizjak
2014-08-28 13:13             ` Ilya Enkovich
2014-08-28 18:30             ` Florian Weimer
2014-08-29 18:48             ` Jeff Law
2014-08-28 18:58           ` Uros Bizjak
2014-08-29  6:51             ` Ilya Enkovich
2014-08-29 18:45             ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53FE3D46.8050904@redhat.com \
    --to=vmakarov@redhat.com \
    --cc=enkovich.gnu@gmail.com \
    --cc=evstupac@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc@gnu.org \
    --cc=law@redhat.com \
    --cc=richard.guenther@gmail.com \
    --cc=ubizjak@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).