From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19833 invoked by alias); 9 Mar 2012 16:50:52 -0000 Received: (qmail 19817 invoked by uid 22791); 9 Mar 2012 16:50:49 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_ZJ X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Mar 2012 16:50:34 +0000 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/52530] [4.8 regression] Many 64-bit execution failures on Solaris 10/11 with Sun as Date: Fri, 09 Mar 2012 16:50:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: ASSIGNED 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: Status 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-03/txt/msg00750.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52530 Uros Bizjak changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |ASSIGNED --- Comment #7 from Uros Bizjak 2012-03-09 16:50:12 UTC --- (In reply to comment #6) > This patch works for me: > > --- > diff --git a/gcc/ChangeLog.addr32 b/gcc/ChangeLog.addr32 > index 066f1ec..a191e47 100644 > --- a/gcc/ChangeLog.addr32 > +++ b/gcc/ChangeLog.addr32 > @@ -1,3 +1,8 @@ > +2012-03-08 H.J. Lu > + > + * config/i386/i386.c (ix86_print_operand_address): Only handle > + zero-extended DImode addresses if Pmode == DImode. > + > 2012-03-06 Uros Bizjak > > * config/i386/i386.md (*zero_extendsidi2_rex64): Allow loading > diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c > index 69cb6ae..c2cad5a 100644 > --- a/gcc/config/i386/i386.c > +++ b/gcc/config/i386/i386.c > @@ -14548,7 +14548,7 @@ ix86_print_operand_address (FILE *file, rtx addr) > > /* Print SImode registers for zero-extended addresses to force > addr32 prefix. Otherwise print DImode registers to avoid it. */ > - if (TARGET_64BIT) > + if (Pmode == DImode) > code = ((GET_CODE (addr) == ZERO_EXTEND > || GET_CODE (addr) == AND) > ? 'l' > -- You will have addr32 added to all lea(%SImode),%SImode instructions. I have a patch in testing that emits addresses in their natural mode (SImode or DImode), forces 'l' override for the above RTXes and 'q' for all LEA insns. For LEAs, we introduce %E modifier that enables special handling: + case 'E': + /* Wrap address in an UNSPEC to declare special handling. */ + if (TARGET_64BIT) + x = gen_rtx_UNSPEC (DImode, gen_rtvec (1, x), UNSPEC_LEA_ADDR); + + output_address (x); + return; And in ix86_print_operand_address: + else if (GET_CODE (addr) == UNSPEC && XINT (addr, 1) == UNSPEC_LEA_ADDR) + { + gcc_assert (TARGET_64BIT); + ok = ix86_decompose_address (XVECEXP (addr, 0, 0), &parts); + code = 'q'; + }