This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/25186] New: (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:20:59 -0000
- Subject: [Bug middle-end/25186] New: (short)(((int)short_var) <<1) should be done in short
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Take the following example:
short *a;
int f(void)
{
*a = (short)(((int)*a) << 1);
}
the Shift should be done in the same type as *a.
This is done in simplify_subreg on the RTL level but we really should be able
to do it in fold also.
--
Summary: (short)(((int)short_var) <<1) should be done in short
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: missed-optimization, TREE
Severity: enhancement
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25186