This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: A new linux/alpha failure (aliasing bug)
- To: Richard Henderson <rth at cygnus dot com>
- Subject: Re: A new linux/alpha failure (aliasing bug)
- From: Jim Wilson <wilson at chestnut dot cygnus dot com>
- Date: Wed, 03 Sep 1997 12:30:08 -0700
- cc: hjl at lucon dot org, egcs at cygnus dot com, jfc at mit dot edu
I thought we already did that, though perhaps in the old alias code.
Yes, in fact I remember having this problem last year, or one like it:
Mon Jul 8 18:00:33 1996 Jim Wilson <wilson@cygnus.com>
I thought the problem looked familiar. I guess I forgot to look at the old
alias analysis code before sending mail to egcs.
I suspect that jfc wrote his code before I patched sched.c, which is why
this patch is missing from his code. I extracted the missing patch and added
it in to the new aliasing code.
Wed Sep 3 12:26:33 1997 Jim Wilson <wilson@cygnus.com>
* alias.c (true_dependence): Address with AND can alias scalars.
(anti_dependence, output_dependence): Likewise.
Index: alias.c
===================================================================
RCS file: /cvs/cvsfiles/egcs/gcc/alias.c,v
retrieving revision 1.5
diff -p -r1.5 alias.c
*** alias.c 1997/09/03 17:42:21 1.5
--- alias.c 1997/09/03 19:13:10
*************** memrefs_conflict_p (xsize, x, ysize, y,
*** 751,761 ****
changed. A volatile and non-volatile reference can be interchanged
though.
! A MEM_IN_STRUCT reference at a non-QImode varying address can never
conflict with a non-MEM_IN_STRUCT reference at a fixed address. We must
allow QImode aliasing because the ANSI C standard allows character
pointers to alias anything. We are assuming that characters are
! always QImode here. */
/* Read dependence: X is read after read in MEM takes place. There can
only be a dependence here if both reads are volatile. */
--- 751,764 ----
changed. A volatile and non-volatile reference can be interchanged
though.
! A MEM_IN_STRUCT reference at a non-QImode non-AND varying address can never
conflict with a non-MEM_IN_STRUCT reference at a fixed address. We must
allow QImode aliasing because the ANSI C standard allows character
pointers to alias anything. We are assuming that characters are
! always QImode here. We also must allow AND addresses, because they may
! generate accesses outside the object being referenced. This is used to
! generate aligned addresses from unaligned addresses, for instance, the
! alpha storeqi_unaligned pattern. */
/* Read dependence: X is read after read in MEM takes place. There can
only be a dependence here if both reads are volatile. */
*************** true_dependence (mem, mem_mode, x, varie
*** 816,821 ****
--- 819,825 ----
if (MEM_IN_STRUCT_P (x) == MEM_IN_STRUCT_P (mem)
|| mem_mode == QImode || mem_mode == BLKmode
|| GET_MODE (x) == QImode || GET_MODE (x) == BLKmode
+ || GET_CODE (x_addr) == AND || GET_CODE (mem_addr) == AND
|| varies (x_addr) == varies (mem_addr))
return 1;
*************** anti_dependence (mem, x)
*** 856,864 ****
--- 860,870 ----
SIZE_FOR_MODE (x), XEXP (x, 0), 0)
&& ! (MEM_IN_STRUCT_P (mem) && rtx_addr_varies_p (mem)
&& GET_MODE (mem) != QImode
+ && GET_CODE (XEXP (mem, 0)) != AND
&& ! MEM_IN_STRUCT_P (x) && ! rtx_addr_varies_p (x))
&& ! (MEM_IN_STRUCT_P (x) && rtx_addr_varies_p (x)
&& GET_MODE (x) != QImode
+ && GET_CODE (XEXP (x, 0)) != AND
&& ! MEM_IN_STRUCT_P (mem) && ! rtx_addr_varies_p (mem)));
}
*************** output_dependence (mem, x)
*** 881,889 ****
--- 887,897 ----
SIZE_FOR_MODE (x), XEXP (x, 0), 0)
&& ! (MEM_IN_STRUCT_P (mem) && rtx_addr_varies_p (mem)
&& GET_MODE (mem) != QImode
+ && GET_CODE (XEXP (mem, 0)) != AND
&& ! MEM_IN_STRUCT_P (x) && ! rtx_addr_varies_p (x))
&& ! (MEM_IN_STRUCT_P (x) && rtx_addr_varies_p (x)
&& GET_MODE (x) != QImode
+ && GET_CODE (XEXP (x, 0)) != AND
&& ! MEM_IN_STRUCT_P (mem) && ! rtx_addr_varies_p (mem)));
}