[Bug target/19293] avr-gcc crashes when using shifts with negative shift count

schlie at comcast dot net gcc-bugzilla@gcc.gnu.org
Wed Jan 19 05:17:00 GMT 2005


------- Additional Comments From schlie at comcast dot net  2005-01-19 05:17 -------
Actually wonder if a better solutions would be to and (&) the rhs shift count by
Log2(rhs-mode-size) bit mask, thereby the resulting value will always be within
0 >= shift <= (N-1), resulting effectivly a shift modulo N, which is more similar
to what hardware and would guess most machines actually do, or am I mistaken?



-- 


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



More information about the Gcc-bugs mailing list