public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix MEM_REF offset calculation in dr_analyze_innermost
@ 2012-05-31 11:04 Richard Guenther
  0 siblings, 0 replies; only message in thread
From: Richard Guenther @ 2012-05-31 11:04 UTC (permalink / raw)
  To: gcc-patches


Pointed out by people working on targets with ptr-size != sizetype size.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2012-05-31  Richard Guenther  <rguenther@suse.de>

	* tree-data-ref.c (dr_analyze_innermost): Properly convert
	the MEM_REF offset to sizetype.

Index: gcc/tree-data-ref.c
===================================================================
--- gcc/tree-data-ref.c	(revision 188055)
+++ gcc/tree-data-ref.c	(working copy)
@@ -755,13 +755,12 @@ dr_analyze_innermost (struct data_refere
     {
       if (!integer_zerop (TREE_OPERAND (base, 1)))
 	{
+	  double_int moff = mem_ref_offset (base);
+	  tree mofft = double_int_to_tree (sizetype, moff);
 	  if (!poffset)
-	    {
-	      double_int moff = mem_ref_offset (base);
-	      poffset = double_int_to_tree (sizetype, moff);
-	    }
+	    poffset = mofft;
 	  else
-	    poffset = size_binop (PLUS_EXPR, poffset, TREE_OPERAND (base, 1));
+	    poffset = size_binop (PLUS_EXPR, poffset, mofft);
 	}
       base = TREE_OPERAND (base, 0);
     }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-05-31 11:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-31 11:04 [PATCH] Fix MEM_REF offset calculation in dr_analyze_innermost Richard Guenther

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).