This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/25186] (short)(((int)short_var) <<1) should be folded so that the shift is done in the short type



------- Comment #3 from rguenth at gcc dot gnu dot org  2005-12-01 11:01 -------
Doh.  The C frontend _does_ the promotion (in the unsigned case):

 (intD.0) *aD.1296 << 1

just convert.c:convert_to_integer "folds" it to a shift on unsigned short
again.

This transformation should be moved to fold instead.


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]