public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hjl.tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/47744] [x32] ICE: in reload_cse_simplify_operands, at postreload.c:403
Date: Tue, 15 Feb 2011 06:30:00 -0000	[thread overview]
Message-ID: <bug-47744-4-aF9zSJBONi@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-47744-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47744

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ubizjak at gmail dot com

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2011-02-15 06:26:32 UTC ---
A kludge:

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 98fa75d..290907d 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -11735,6 +11735,40 @@ ix86_decompose_address (rtx addr, struct ix86_address
*
out)
   if (disp == const0_rtx && (base || index))
     disp = NULL_RTX;

+  if (TARGET_X32
+      && base
+      && GET_MODE (base) == ptr_mode
+      && GET_CODE (base) == SUBREG
+      && (disp == NULL_RTX
+      || disp == const0_rtx
+      || CONST_INT_P (disp))
+      && GET_CODE (base_reg) == PLUS)
+    {
+      rtx op0 = XEXP (base_reg, 0);
+      rtx op1 = XEXP (base_reg, 1);
+      rtx c;
+      if (REG_P (op0) && CONST_INT_P (op1))
+    {
+      base_reg = op0;
+      c = op1;
+    }
+      else if (REG_P (op1) && CONST_INT_P (op0))
+    {
+      base_reg = op1;
+      c = op0;
+    }
+      else
+    return 0;
+
+      if (disp == NULL_RTX
+      || disp == const0_rtx)
+    disp = c;
+      else
+    disp = GEN_INT (INTVAL (disp) + INTVAL (c));
+
+      base = gen_rtx_REG (ptr_mode, REGNO (base_reg));
+    }
+
   /* Allow arg pointer and stack pointer as index if there is not scaling.  */
   if (base_reg && index_reg && scale == 1
       && (index_reg == arg_pointer_rtx


  reply	other threads:[~2011-02-15  6:26 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15  6:10 [Bug target/47744] New: " hjl.tools at gmail dot com
2011-02-15  6:30 ` hjl.tools at gmail dot com [this message]
2011-02-15 13:44 ` [Bug target/47744] " hjl at gcc dot gnu.org
2011-02-18 15:02 ` hjl.tools at gmail dot com
2011-02-18 19:38 ` hjl at gcc dot gnu.org
2011-03-01 17:27 ` hjl.tools at gmail dot com
2011-03-01 19:21 ` hjl at gcc dot gnu.org
2011-03-29  6:27 ` hjl.tools at gmail dot com
2011-04-02  5:31 ` hjl at gcc dot gnu.org
2011-04-02  5:50 ` hjl at gcc dot gnu.org
2011-07-17 17:26 ` ubizjak at gmail dot com
2011-07-17 17:27 ` ubizjak at gmail dot com
2011-07-17 18:29 ` hjl.tools at gmail dot com
2011-07-17 20:02 ` ubizjak at gmail dot com
2011-07-17 20:08 ` ubizjak at gmail dot com
2011-07-17 20:27 ` hjl.tools at gmail dot com
2011-07-17 21:14 ` ubizjak at gmail dot com
2011-07-17 21:21 ` hjl.tools at gmail dot com
2011-07-17 21:28 ` hjl.tools at gmail dot com
2011-07-17 22:04 ` ubizjak at gmail dot com
2011-07-17 22:12 ` hjl.tools at gmail dot com
2011-07-17 22:18 ` ubizjak at gmail dot com
2011-07-17 22:44 ` hjl.tools at gmail dot com
2011-07-17 22:48 ` ubizjak at gmail dot com
2011-07-17 22:55 ` hjl.tools at gmail dot com
2011-07-17 23:00 ` ubizjak at gmail dot com
2011-07-18  0:03 ` hjl.tools at gmail dot com
2011-07-18  4:18 ` hjl.tools at gmail dot com
2011-07-18  9:09 ` ubizjak at gmail dot com
2011-07-18 13:55 ` hjl.tools at gmail dot com
2011-07-18 14:01 ` ubizjak at gmail dot com
2011-07-18 14:04 ` hjl.tools at gmail dot com
2011-07-18 14:54 ` hjl.tools at gmail dot com
2011-07-18 16:54 ` ubizjak at gmail dot com
2011-07-18 16:56 ` hjl.tools at gmail dot com
2011-07-18 17:18 ` ubizjak at gmail dot com
2011-07-18 17:51 ` hjl at gcc dot gnu.org
2011-07-18 17:52 ` uros at gcc dot gnu.org
2011-07-18 17:54 ` hjl at gcc dot gnu.org
2011-07-18 18:30 ` ubizjak at gmail dot com
2011-08-03 14:08 ` hjl at gcc dot gnu.org

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=bug-47744-4-aF9zSJBONi@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).