From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22599 invoked by alias); 10 Feb 2012 17:43:15 -0000 Received: (qmail 22589 invoked by uid 22791); 10 Feb 2012 17:43:14 -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, 10 Feb 2012 17:43:02 +0000 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/52146] [x32] - Wrong code to access addresses 0x80000000 to 0xFFFFFFFF Date: Fri, 10 Feb 2012 17:43: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: wrong-code 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: --- 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-02/txt/msg01088.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52146 --- Comment #11 from Uros Bizjak 2012-02-10 17:42:30 UTC --- (In reply to comment #9) > HJ, Steffen, can you please test following patch instead: val_signbit_known_set_p is a bit overkill, following patch works as well: --cut here-- Index: i386.c =================================================================== --- i386.c (revision 184096) +++ i386.c (working copy) @@ -11932,6 +11932,13 @@ ix86_legitimate_address_p (enum machine_mode mode rtx base, index, disp; HOST_WIDE_INT scale; + /* Since constant address in x32 is signed extended to 64bit, + we have to prevent addresses from 0x80000000 to 0xffffffff. */ + if (TARGET_X32 + && CONST_INT_P (addr) + && INTVAL (addr) < 0) + return false; + if (ix86_decompose_address (addr, &parts) <= 0) /* Decomposition failed. */ return false; --cut here--