From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4166 invoked by alias); 6 Jul 2010 14:11:11 -0000 Received: (qmail 4062 invoked by uid 48); 6 Jul 2010 14:10:51 -0000 Date: Tue, 06 Jul 2010 14:11:00 -0000 Message-ID: <20100706141051.4061.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/44828] [4.3/4.4/4.5 Regression] possible integer wrong code bug In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "regehr at cs dot utah dot edu" 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-07/txt/msg00576.txt.bz2 ------- Comment #6 from regehr at cs dot utah dot edu 2010-07-06 14:10 ------- (In reply to comment #2) > Not sure whether the testcase is valid or not. The multiplication using char > variables on both sides (and likewise for result) is: -54 * -56 (= 3024), > but (char) 3024 is -48. For int that would be clear undefined behavior, but > for char the multiplication is promoted to int, so it is (char) (int * int). My students and I had to argue about this and read the standard before submitting this bug report. But I'm almost certain the testcase is valid. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44828