From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22757 invoked by alias); 22 Apr 2007 11:15:46 -0000 Received: (qmail 22730 invoked by uid 48); 22 Apr 2007 11:15:36 -0000 Date: Sun, 22 Apr 2007 11:15:00 -0000 Subject: [Bug c++/31656] New: Left shift error X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "myprasanna 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: 2007-04/txt/msg01605.txt.bz2 Left shift of width 32, 33, 64, 65 etc produces inconsistencies. const int j = 33; printf("%d\n", 1 << j); Output: 0 int j = 33; printf("%d\n", 1 << j); Output: 2 Same with C. Runtime shift instruction emmitted incorrectly. -- Summary: Left shift error Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: myprasanna at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31656