Daniel Berlin - Re: [RFH] Restrict support for trees (original) (raw)

This is the mail archive of the gcc@gcc.gnu.orgmailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

On Tue, 2005-11-29 at 22:08 +0100, Richard Guenther wrote:

The patch below teaches points-to analysis about restrict qualifiers of incoming parameters. It is modeled after the special handling of malloc result type pointers, namely creating fake variables we point to and thus trigger creation of NMTs. Unfortunately it doesn't exactly work, as for the testcase

double foo(double * restrict x, double * restrict y) { double res; res = *y + *(y+1); res += *x + *(x+1); return res; }

we generate the constraints (ok)

RESTRICT.4 = &ANYTHING x = &RESTRICT.4 RESTRICT.5 = &ANYTHING y = &RESTRICT.5 D.1282_3 = y + 64 D.1285_8 = x + 64

just like we do for the malloc case, but end up with an extra TMT that causes

It either decides to use a TMT, or an NMT, in a loop that looks through things, partially here:

/* Collect the list of pointers with a non-empty points to set. */ for (i = 1; i < num_ssa_names; i++) { tree ptr = ssa_name (i); struct ptr_info_def *pi;

  if (!ptr
      || !POINTER_TYPE_P (TREE_TYPE (ptr))
      || !SSA_NAME_PTR_INFO (ptr))
    continue;

  pi = SSA_NAME_PTR_INFO (ptr);


  if (pi->pt_anything || !pi->is_dereferenced)
    {
      /* No name tags for pointers that have not been
         dereferenced or point to an arbitrary location.  */
      pi->name_mem_tag = NULL_TREE;
      continue;
    }

and partially in set_pt_anything (which will reset the name tag as well).

I'd take a look and see what improved-aliasing does with it, and try to debug the problem there.

I plan on starting to merge the improved aliasing stuff early next week.

--Dan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]