------- Comment #3 from rguenth at gcc dot gnu dot org  2007-05-25 11:21 -------
Indeed with -fno-tree-ccp the testcase is optimized by forwprop1 to

<bb 2>:
  D.2000_3 = i_2(D) * 4;
  D.2001_4 = (int *) D.2000_3;
  D.2002_5 = &b.t[i_2(D)];
  *D.2002_5 = 1;
  return;

and then by forwprop2 to

<bb 2>:
  D.2002_5 = &b.t[i_2(D)];
  b.t[i_2(D)] = 1;
  return;

so the right fix is to eventually teach CCP to do the first transformation,
or rather teach fold_stmt to do a little tree combining in this case.  Ugh.
Or avoid this particular type of CCP.  Ugh.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Missed forw prop with       |Missed forw prop with
                   |indirect ref and addr.      |indirect ref and addr. due
                   |                            |to CCP


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

Reply via email to