public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/43940]  New: DOM doesn't propagate constants properly
@ 2010-04-29 14:57 rguenth at gcc dot gnu dot org
  2010-07-24 21:45 ` [Bug tree-optimization/43940] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-04-29 14:57 UTC (permalink / raw)
  To: gcc-bugs

For

int main()
{
  void *p = __builtin_malloc (4);
  if (p)
    {
      __builtin_free (p);
      p = 0;
    }
  __builtin_free (p);
  return 0;
}

DOM does not propagate p == 0 on the else path leaving

<bb 2>:
  p_2 = __builtin_malloc (4);
  if (p_2 != 0B)
    goto <bb 3>;
  else
    goto <bb 4>;

<bb 3>:
  __builtin_free (p_2);

<bb 4>:
  # p_1 = PHI <p_2(2), 0B(3)>
  __builtin_free (p_1);


VRP can do this.


-- 
           Summary: DOM doesn't propagate constants properly
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43940


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

end of thread, other threads:[~2012-03-19  9:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-29 14:57 [Bug tree-optimization/43940] New: DOM doesn't propagate constants properly rguenth at gcc dot gnu dot org
2010-07-24 21:45 ` [Bug tree-optimization/43940] " pinskia at gcc dot gnu dot org
2010-07-24 22:05 ` steven at gcc dot gnu dot org
2010-07-25 10:29 ` steven at gcc dot gnu dot org
2010-07-25 16:25 ` steven at gcc dot gnu dot org
     [not found] <bug-43940-4@http.gcc.gnu.org/bugzilla/>
2012-03-18 23:08 ` steven at gcc dot gnu.org
2012-03-19  9:45 ` rguenth at gcc dot gnu.org
2012-03-19  9:55 ` stevenb.gcc at gmail 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).