Aliasing patches

Richard Henderson rth@cygnus.com
Thu Jun 1 00:38:00 GMT 2000


> This also adds alias sets for frame values and for spilled registers.
>
> I tested this on Alpha.

Did you really test this on an Alpha?  Run the testsuite and look
at the results I mean?  I have trouble believing that. 

I count twenty additional failures, not counting duplicates.  Some
of the C++ ones are weird, and probably indicate miscompilation in
the compiler itself.

Take gcc.c-torture/execute/920411-1.c as an example:

  char *p = (char*) &x;
  for (i = 0; i < 1; i++)
    {
      for (k = 0; k < sizeof (long); k++)
        p[k] = w[k];
      c += x;

This fails because loop decided that 'x' does not alias anything
in the loop.  Looking at the gcse dump immediately picks out the
highly suspicious 

  (insn 41 39 42 (set (reg:QI 79)
          (mem:QI (reg:DI 78) 6)) 202 {reload_inqi_help-3} (nil)
      (nil))

Note the non-zero alias set.  Which is clearly wrong from an ISO C
standpoint.  For the stack frame load for 'c += x', we have

  (insn 56 86 57 (set (reg:DI 80)
          (mem:DI (reg:DI 63 FP) 12)) 204 {reload_inqi_help-1} (nil)
      (nil))

which easily explains why loop makes the transformation it does.

I have not yet investigated the root cause of the failure.


r~


More information about the Gcc-patches mailing list