From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8870 invoked by alias); 10 Nov 2012 02:30:36 -0000 Received: (qmail 8828 invoked by uid 48); 10 Nov 2012 02:30:18 -0000 From: "hjl.tools at gmail dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg00891.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55247 --- Comment #6 from H.J. Lu 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;