public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/38865]  New: missing FRE with VIEW_CONVERT_EXPR
@ 2009-01-15 23:38 pinskia at gcc dot gnu dot org
  2009-01-15 23:40 ` [Bug tree-optimization/38865] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-01-15 23:38 UTC (permalink / raw)
  To: gcc-bugs

Take:
struct s { int i; };
float a (struct s *sv)
{
  sv->i = 0;
  int d = sv->i;
  return *(float*)&d;
}


float a1 (struct s *sv)
{
  sv->i = 0;
  return *(float*)&sv->i;
}

We miss that we could constant prop 0 into the VIEW_CONVERT_EXPR.
Likewise for non aliasing issues but with vectors:
#define vector __attribute__((vector_size(16) ))
struct s { vector int i; };
vector float a (struct s *sv)
{
  sv->i = (vector int){0,0,0};
  vector int d = sv->i;
  return (vector float)(d);
}


vector float a1 (struct s *sv)
{
  sv->i = (vector int){0,0,0};
  return (vector float)sv->i;
}


-- 
           Summary: missing FRE with VIEW_CONVERT_EXPR
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        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=38865


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-06-12 19:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-15 23:38 [Bug tree-optimization/38865] New: missing FRE with VIEW_CONVERT_EXPR pinskia at gcc dot gnu dot org
2009-01-15 23:40 ` [Bug tree-optimization/38865] " pinskia at gcc dot gnu dot org
2009-01-16  2:33 ` pinskia at gcc dot gnu dot org
2009-01-16  9:27 ` rguenth at gcc dot gnu dot org
2009-01-16  9:36 ` rguenther at suse dot de
2009-01-16 18:55 ` pinskia at gcc dot gnu dot org
2009-01-16 18:59 ` pinskia at gcc dot gnu dot org
2009-06-12 19:01 ` pinskia at gcc dot gnu dot org
2009-06-12 19:01 ` pinskia at gcc dot gnu dot org

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).