[Bug tree-optimization/47575] New: store-motion removes global stores from endless loops

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 1 16:21:00 GMT 2011


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.



More information about the Gcc-bugs mailing list