public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/36602]  New: memset should be optimized into an empty CONSTRUCTOR
@ 2008-06-22 21:06 pinskia at gcc dot gnu dot org
  2008-06-22 21:26 ` [Bug tree-optimization/36602] " rguenth at gcc dot gnu dot org
  2010-03-02 18:52 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-06-22 21:06 UTC (permalink / raw)
  To: gcc-bugs

I noticed this while looking into tree-ssa-sccvn.c sources (though I doubt it
helps in general really).  But anyways we should optimize the following code
into just a "return 0;":
struct f
{
  int t, k;
  int g[1024];
};


int g(void)
{
  struct f a;
  __builtin_memset(&a, 0, sizeof(a));
  return a.t;
}

-- CUT ---
You can see that with the above code we get a zeroing for the struct still.


-- 
           Summary: memset should be optimized into an empty CONSTRUCTOR
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, TREE
          Severity: enhancement
          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=36602


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

end of thread, other threads:[~2024-06-27  6:09 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-36602-4@http.gcc.gnu.org/bugzilla/>
2011-06-22 20:31 ` [Bug tree-optimization/36602] memset should be optimized into an empty CONSTRUCTOR ak at gcc dot gnu.org
2012-06-06 10:20 ` rguenth at gcc dot gnu.org
2012-06-06 14:11 ` rguenth at gcc dot gnu.org
2012-06-06 14:13 ` rguenth at gcc dot gnu.org
2012-06-06 16:36 ` jason at gcc dot gnu.org
2012-06-11 10:58 ` rguenth at gcc dot gnu.org
2014-09-28 17:19 ` andi-gcc at firstfloor dot org
2014-09-29 10:34 ` rguenth at gcc dot gnu.org
2021-01-08 16:37 ` jamborm at gcc dot gnu.org
2021-01-11  7:12 ` rguenth at gcc dot gnu.org
2024-06-26 17:29 ` crrodriguez at opensuse dot org
2024-06-27  6:09 ` rguenth at gcc dot gnu.org
2008-06-22 21:06 [Bug tree-optimization/36602] New: " pinskia at gcc dot gnu dot org
2008-06-22 21:26 ` [Bug tree-optimization/36602] " rguenth at gcc dot gnu dot org
2010-03-02 18:52 ` 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).