public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/47575] New: store-motion removes global stores from endless loops
@ 2011-02-01 16:21 rguenth at gcc dot gnu.org
  2011-02-01 16:26 ` [Bug tree-optimization/47575] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-02-01 16:21 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: store-motion removes global stores from endless loops
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org


void foo (int *k) 
{
  for (;;)
    *k = 0;
}

is optimized to

foo (int * k)
{
  int k__lsm.2;

<bb 2>:
  k__lsm.2_4 = MEM[(int *)k_1(D)];

<bb 3>:
  k__lsm.2_6 = 0;

<bb 4>:
  goto <bb 3>;

}

by LIM, removing the global store.  We can use is_hidden_global_store
or friends and require at least one exit if that is true for a sm ref.


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

end of thread, other threads:[~2021-07-07 11:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-01 16:21 [Bug tree-optimization/47575] New: store-motion removes global stores from endless loops rguenth at gcc dot gnu.org
2011-02-01 16:26 ` [Bug tree-optimization/47575] " rguenth at gcc dot gnu.org
2011-02-01 17:13 ` rakdver at gcc dot gnu.org
2021-07-07 11:55 ` rguenth at gcc dot gnu.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).