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 rtl-optimization/55247] [4.8 Regression] internal compiler error: Max. number of generated reload insns per insn is achieved (90)
Date: Sat, 10 Nov 2012 02:30:00 -0000	[thread overview]
Message-ID: <bug-55247-4-JZbzUYecPZ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55247-4@http.gcc.gnu.org/bugzilla/>


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

--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> 2012-11-10 02:30:16 UTC ---
Something like this:

diff --git a/gcc/explow.c b/gcc/explow.c
index 6109832..9ec38f9 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -84,12 +84,22 @@ plus_constant (enum machine_mode mode, rtx x, HOST_WIDE_INT 
c)
   rtx y;
   rtx tem;
   int all_constant = 0;
+  enum machine_mode zero_extend_mode;

   gcc_assert (GET_MODE (x) == VOIDmode || GET_MODE (x) == mode);

   if (c == 0)
     return x;

+  if (GET_CODE (x) == ZERO_EXTEND)
+    {
+      zero_extend_mode = GET_MODE (x);
+      x = XEXP (x, 0);
+      mode = GET_MODE (x);
+    }
+  else
+    zero_extend_mode = VOIDmode;
+
  restart:

   code = GET_CODE (x);
@@ -195,7 +205,11 @@ plus_constant (enum machine_mode mode, rtx x,
HOST_WIDE_INT
 c)
   else if (all_constant)
     return gen_rtx_CONST (mode, x);
   else
-    return x;
+    {
+      if (zero_extend_mode != VOIDmode)
+    x = gen_rtx_ZERO_EXTEND (zero_extend_mode, x);
+      return x;
+    }
 }
 ^L
 /* If X is a sum, return a new sum like X but lacking any constant terms.
diff --git a/gcc/recog.c b/gcc/recog.c
index ee68e30..d3dd591 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -1934,15 +1934,21 @@ int
 offsettable_address_addr_space_p (int strictp, enum machine_mode mode, rtx y,
                   addr_space_t as)
 {
-  enum rtx_code ycode = GET_CODE (y);
+  enum rtx_code ycode;
   rtx z;
-  rtx y1 = y;
+  rtx y1;
   rtx *y2;
   int (*addressp) (enum machine_mode, rtx, addr_space_t) =
     (strictp ? strict_memory_address_addr_space_p
          : memory_address_addr_space_p);
   unsigned int mode_sz = GET_MODE_SIZE (mode);

+  if (GET_CODE (y) == ZERO_EXTEND)
+    y = XEXP (y, 0);
+
+  ycode = GET_CODE (y);
+  y1 = y;
+
   if (CONSTANT_ADDRESS_P (y))
     return 1;


  parent reply	other threads:[~2012-11-10  2:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-09  2:34 [Bug rtl-optimization/55247] New: " hjl.tools at gmail dot com
2012-11-09  2:34 ` [Bug rtl-optimization/55247] " hjl.tools at gmail dot com
2012-11-09  5:09 ` hjl.tools at gmail dot com
2012-11-09 19:42 ` vmakarov at redhat dot com
2012-11-10  1:32 ` hjl.tools at gmail dot com
2012-11-10  1:39 ` hjl.tools at gmail dot com
2012-11-10  1:58 ` hjl.tools at gmail dot com
2012-11-10  2:30 ` hjl.tools at gmail dot com [this message]
2012-11-10  9:15 ` ubizjak at gmail dot com
2012-11-10  9:22 ` ubizjak at gmail dot com
2012-11-10 11:28 ` uros at gcc dot gnu.org
2012-11-10 11:47 ` [Bug middle-end/55247] " ubizjak at gmail dot com
2012-11-10 11:56 ` ubizjak at gmail dot com
2012-11-10 19:02 ` [Bug rtl-optimization/55247] " hjl.tools at gmail dot com
2012-11-10 19:11 ` hjl.tools at gmail dot com
2012-11-10 19:41 ` ubizjak at gmail dot com
2012-11-11 21:53 ` ebotcazou at gcc dot gnu.org
2012-11-11 23:55 ` hjl.tools at gmail dot com

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-55247-4-JZbzUYecPZ@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).