public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/25186]  New: (short)(((int)short_var) <<1) should be done in short
@ 2005-11-30 18:21 pinskia at gcc dot gnu dot org
  2005-11-30 18:32 ` [Bug middle-end/25186] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-30 18:21 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 11+ messages in thread
[parent not found: <bug-25186-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2023-04-22  8:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-30 18:21 [Bug middle-end/25186] New: (short)(((int)short_var) <<1) should be done in short pinskia at gcc dot gnu dot org
2005-11-30 18:32 ` [Bug middle-end/25186] " pinskia at gcc dot gnu dot org
2005-12-01 10:53 ` [Bug middle-end/25186] (short)(((int)short_var) <<1) should be folded so that the shift is done in the short type rguenth at gcc dot gnu dot org
2005-12-01 11:01 ` rguenth at gcc dot gnu dot org
2005-12-01 12:28 ` rguenth at gcc dot gnu dot org
2005-12-01 12:46 ` rguenth at gcc dot gnu dot org
2005-12-01 14:17 ` rguenth at gcc dot gnu dot org
2006-04-05 13:49 ` rguenth at gcc dot gnu dot org
     [not found] <bug-25186-4@http.gcc.gnu.org/bugzilla/>
2021-09-02  2:03 ` gabravier at gmail dot com
2021-09-02  7:15 ` rguenth at gcc dot gnu.org
2023-04-22  8:06 ` roger at nextmovesoftware dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).