From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10769 invoked by alias); 6 Dec 2012 20:14:35 -0000 Received: (qmail 10714 invoked by uid 48); 6 Dec 2012 20:14:09 -0000 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/55597] [4.8 Regression] internal compiler error: in plus_constant, at explow.c:88 Date: Thu, 06 Dec 2012 20:14:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: NEW 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-12/txt/msg00599.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55597 --- Comment #12 from Uros Bizjak 2012-12-06 20:14:06 UTC --- (In reply to comment #11) > It works. Thanks. > > Unfortunately it creates GC garbage often unnecessary, when it won't be used at > all. I agree. Let's keep zext together with their users: --cut here-- Index: i386.c =================================================================== --- i386.c (revision 194263) +++ i386.c (working copy) @@ -12785,6 +12785,9 @@ tp = get_thread_pointer (Pmode, true); dest = force_reg (Pmode, gen_rtx_PLUS (Pmode, tp, dest)); + if (GET_MODE (x) != Pmode) + x = gen_rtx_ZERO_EXTEND (Pmode, x); + set_unique_reg_note (get_last_insn (), REG_EQUAL, x); } else @@ -12793,15 +12796,20 @@ if (TARGET_64BIT) { - rtx rax = gen_rtx_REG (Pmode, AX_REG), insns; + rtx rax = gen_rtx_REG (Pmode, AX_REG); + rtx insns; start_sequence (); - emit_call_insn (ix86_gen_tls_global_dynamic_64 (rax, x, - caddr)); + emit_call_insn + (ix86_gen_tls_global_dynamic_64 (rax, x, caddr)); insns = get_insns (); end_sequence (); RTL_CONST_CALL_P (insns) = 1; + + if (GET_MODE (x) != Pmode) + x = gen_rtx_ZERO_EXTEND (Pmode, x); + emit_libcall_block (insns, dest, rax, x); } else @@ -12842,11 +12850,12 @@ if (TARGET_64BIT) { - rtx rax = gen_rtx_REG (Pmode, AX_REG), insns, eqv; + rtx rax = gen_rtx_REG (Pmode, AX_REG); + rtx insns, eqv; start_sequence (); - emit_call_insn (ix86_gen_tls_local_dynamic_base_64 (rax, - caddr)); + emit_call_insn + (ix86_gen_tls_local_dynamic_base_64 (rax, caddr)); insns = get_insns (); end_sequence (); @@ -12871,6 +12880,9 @@ { dest = force_reg (Pmode, gen_rtx_PLUS (Pmode, dest, tp)); + if (GET_MODE (x) != Pmode) + x = gen_rtx_ZERO_EXTEND (Pmode, x); + set_unique_reg_note (get_last_insn (), REG_EQUAL, x); } break; --cut here--