[Bug c/28195] New: << (shift operator) does rotate operation

2006-06-28 Thread tetsuji dot rai at gmail dot com
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



[Bug c/28195] << (shift operator) does rotate operation

2006-06-29 Thread tetsuji dot rai at gmail dot com


--- Comment #2 from tetsuji dot rai at gmail dot com  2006-06-29 07:30 
---
sorry and thanks.  my mistake.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28195