From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11584 invoked by alias); 1 Jan 2011 21:03:34 -0000 Received: (qmail 11574 invoked by uid 22791); 1 Jan 2011 21:03:33 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 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; Sat, 01 Jan 2011 21:03:29 +0000 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/47148] [4.6 Regression] likely wrong code bug 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: hjl.tools 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.6.0 X-Bugzilla-Changed-Fields: CC 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 Date: Sat, 01 Jan 2011 21:03:00 -0000 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: 2011-01/txt/msg00041.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47148 H.J. Lu changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hjl.tools at gmail dot com --- Comment #4 from H.J. Lu 2011-01-01 21:03:08 UTC --- (In reply to comment #3) > the caller indeed does the needed promotions, as CALL_EXPR's argument has int > type rather than unsigned char. But when calling the artificial foo.part.0, > the > argument passed to it is unsigned char 255 rather than int 255 and it sets a > QImode %rdi register to -1 (i.e. 255) instead of setting SImode %rdi register > to 255, which means it is incorrectly sign extended instead of zero extended. I proposed to update x86-64 psABI to --- When a value of type _Bool is returned in a register, bit 0 contains the truth value and bits 1 to 7 shall be zero. When an argument of type _Bool is passed in a register or on the stack, bit 0 contains the truth value and bits 1 to 31 shall be zero. When a value of type signed/unsigned char or short is returned in a register, bits 0 to 7 for char and bits 0 to 15 for short contain the value and other bits are left unspecified. When an argument of signed/unsigned type char or short is passed in a register or on the stack, it shall be sign/zero extended to signed/unsigned int. --- http://gcc.gnu.org/ml/gcc/2010-12/msg00525.html