This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/25186] (short)(((int)short_var) <<1) should be done in short
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Nov 2005 18:32:29 -0000
- Subject: [Bug middle-end/25186] (short)(((int)short_var) <<1) should be done in short
- References: <bug-25186-6528@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2005-11-30 18:32 -------
It also should be done for:
int f1(void)
{
*a = (short)(((int)(unsigned short)*a) << 1);
}
Which is a little more complicated on the tree level than the RTL level:
tree level:
*a.1 = (short int) ((int) (short unsigned int) *a.1 << 1);
RTL level just has a zero_extend.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25186