Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ./configure
Thread model: posix
gcc version 4.5.0 (GCC) 

Using C++, shifting unsigned integers
uint64_t x;
x=x>>65;   //produces same result as x=x>>1
uint32_t y;
y=y>>34;   //produces same result as y=y>>2
If the shift is a literal, the compiler warns, otherwise there is no warning.
------------
I don't know if this is actually a bug, or if it's acceptable behavior. If
it's acceptable, I'd like to see a compiler command-line option or some other
way to make shifts >= the data size return zero.


-- 
           Summary: shift is modulo data size
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: chrismaple at mcttelecom dot com


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

Reply via email to