public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/19626] New: Aliasing says stores to local memory do alias
@ 2005-01-25 16:56 rguenth at tat dot physik dot uni-tuebingen dot de
  2005-01-25 16:57 ` [Bug tree-optimization/19626] " rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2005-01-25 16:56 UTC (permalink / raw)
  To: gcc-bugs

Given the attached testcase, for reference, the interesting function is
this:

int loc_test(void)
{
	const Loc<2> dX(1, 0);
	const Loc<2> k(0, 1);
	return k[0].first() + dX[0].first();
}

aliasing tells us that the initializations of dX and k alias each
other:

<bb 0>:
  D.2540 = (struct Loc<1> *) &dX.D.2210.D.2166.domain_m.buffer;
  #   dX_357 = V_MAY_DEF <dX_318>;
  #   k_358 = V_MAY_DEF <k_317>;
  *&(&D.2540->D.2094)->D.2057.domain_m = 1;
  #   dX_365 = V_MAY_DEF <dX_357>;
  #   k_364 = V_MAY_DEF <k_358>;
  *&(&(D.2540 + 4B)->D.2094)->D.2057.domain_m = 0;
  D.2682 = (struct Loc<1> *) &k.D.2210.D.2166.domain_m.buffer;
  #   dX_337 = V_MAY_DEF <dX_365>;
  #   k_338 = V_MAY_DEF <k_364>;
  *&(&D.2682->D.2094)->D.2057.domain_m = 0;
  #   dX_361 = V_MAY_DEF <dX_337>;
  #   k_63 = V_MAY_DEF <k_338>;
  *&(&(D.2682 + 4B)->D.2094)->D.2057.domain_m = 1;
  D.2769 = (struct Loc<1> *) &k.D.2210.D.2166.domain_m.buffer;
  D.2791 = (struct Loc<1> *) &dX.D.2210.D.2166.domain_m.buffer;
  return (&D.2769->D.2094)->D.2057.domain_m + (&D.2791->D.2094)->D.2057.domain_m;

which is of course (trivially) not true.  This may be obfuscated by
the actual implementation of the template class Loc (see attached
complete testcase).

At the RTL level we are able to optimize this to just return 1, as
expected.  This pessimizes tree loop optimizations if such constructs
are used inside a loop and as induction variable.

-- 
           Summary: Aliasing says stores to local memory do alias
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at tat dot physik dot uni-tuebingen dot de
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2005-06-09 16:32 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-25 16:56 [Bug tree-optimization/19626] New: Aliasing says stores to local memory do alias rguenth at tat dot physik dot uni-tuebingen dot de
2005-01-25 16:57 ` [Bug tree-optimization/19626] " rguenth at tat dot physik dot uni-tuebingen dot de
2005-01-25 17:16 ` pinskia at gcc dot gnu dot org
2005-01-25 17:24 ` pinskia at gcc dot gnu dot org
2005-01-26  8:47 ` rguenth at tat dot physik dot uni-tuebingen dot de
2005-02-10 18:59 ` rguenth at gcc dot gnu dot org
2005-04-07 10:36 ` rguenth at gcc dot gnu dot org
2005-04-07 12:48 ` dberlin at dberlin dot org
2005-04-07 12:50 ` rguenth at tat dot physik dot uni-tuebingen dot de
2005-04-07 16:43 ` dberlin at dberlin dot org
2005-04-07 22:55 ` pinskia at gcc dot gnu dot org
2005-05-13 13:18 ` pinskia at gcc dot gnu dot org
2005-05-17 16:39 ` law at redhat dot com
2005-05-17 17:36 ` pinskia at gcc dot gnu dot org
2005-05-18 21:52 ` rguenth at gcc dot gnu dot org
2005-06-09 16:32 ` 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).