This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR42509, wrong-code from the RTL alias oracle
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: rguenther at suse dot de (Richard Guenther)
- Cc: gcc-patches at gcc dot gnu dot org, rearnsha at gcc dot gnu dot org, doko at ubuntu dot com
- Date: Wed, 28 Jul 2010 20:03:20 +0200 (CEST)
- Subject: Re: [PATCH] Fix PR42509, wrong-code from the RTL alias oracle
Richard Guenther wrote:
> On Tue, 27 Jul 2010, Ulrich Weigand wrote:
>
> > Richard Guenther wrote:
> >
> > > PR middle-end/42509
> > > * alias.c (nonoverlapping_memrefs_p): For spill-slot accesses
> > > require a non-NULL MEM_OFFSET.
> >
> > What are your thoughts on backporting this to the 4.4 branch?
>
> If you want to do it and do the testing a backport is fine with me.
I've checked this in now. Tested on powerpc-linux and s390x-linux.
Thanks,
Ulrich
ChangeLog:
Backport from mainline:
2010-04-03 Richard Guenther <rguenther@suse.de>
PR middle-end/42509
* alias.c (nonoverlapping_memrefs_p): For spill-slot accesses
require a non-NULL MEM_OFFSET.
Index: gcc/alias.c
===================================================================
*** gcc/alias.c (revision 157953)
--- gcc/alias.c (revision 157954)
*************** nonoverlapping_memrefs_p (const_rtx x, c
*** 2147,2152 ****
--- 2147,2159 ----
if (exprx == 0 || expry == 0)
return 0;
+ /* For spill-slot accesses make sure we have valid offsets. */
+ if ((exprx == get_spill_slot_decl (false)
+ && ! MEM_OFFSET (x))
+ || (expry == get_spill_slot_decl (false)
+ && ! MEM_OFFSET (y)))
+ return 0;
+
/* If both are field references, we may be able to determine something. */
if (TREE_CODE (exprx) == COMPONENT_REF
&& TREE_CODE (expry) == COMPONENT_REF
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com