From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27451 invoked by alias); 26 May 2010 13:23:08 -0000 Received: (qmail 27392 invoked by uid 48); 26 May 2010 13:22:49 -0000 Date: Wed, 26 May 2010 13:23:00 -0000 Message-ID: <20100526132249.27391.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/43249] unsigned int arg with no prototype gets full 64-bit reg In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "amodra at gmail dot com" 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: 2010-05/txt/msg02926.txt.bz2 ------- Comment #2 from amodra at gmail dot com 2010-05-26 13:22 ------- I think this testcase may invoke undefined behaviour. Section 6.5.2.2 of the ISO C spec says of function calls without a prototype that if "the types of the arguments after promotion are not compatible with those of the parameters after promotion, the behavior is undefined, except for the following cases" and the relevant case is "one promoted type is a signed integer type, the other promoted type is the corresponding unsigned integer type, and the value is representable in both types". The value you are passing, (int)4294967259U, is a negative number so not representable as an unsigned int. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43249