From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6903 invoked by alias); 28 Jun 2006 17:53:41 -0000 Received: (qmail 6767 invoked by uid 48); 28 Jun 2006 17:53:23 -0000 Date: Wed, 28 Jun 2006 17:57:00 -0000 Subject: [Bug c/28195] New: << (shift operator) does rotate operation X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "tetsuji dot rai at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-06/txt/msg02447.txt.bz2 List-Id: When shift count is the same as the length of a variable (eg, l << 32 where long int l;), this doesn't return 0, instead it returns a rotated value. Below is assumed to return 0, but actually returns 2468. ---t2.c---(test case) #include long long ll; long l; int main(){ l = 1234; ll = l << 33; printf("%lld\n", ll); return 0; } -------------------- -- Summary: << (shift operator) does rotate operation Product: gcc Version: 3.4.6 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tetsuji dot rai at gmail dot com GCC build triplet: ia32 Gentoo Linux GCC host triplet: ia32 Gentoo Linux GCC target triplet: ia32 Gentoo Linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28195