This is the mail archive of the gcc-patches@gcc.gnu.org mailing 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]

[lto-streamer] Fix pr36245


For some reason, the test case for pr36245 is in the branch but not
the actual patch from richi.  Fixed with

2008-05-30  Diego Novillo  <dnovillo@google.com>

	Backport from trunk:

	2008-05-27  Richard Guenther  <rguenther@suse.de>

		PR tree-optimization/36245
		* tree-ssa-address.c (add_to_parts): Deal with non-pointer
		bases.

Index: tree-ssa-address.c
===================================================================
--- tree-ssa-address.c	(revision 136188)
+++ tree-ssa-address.c	(working copy)
@@ -423,9 +423,13 @@ add_to_parts (struct mem_address *parts,

   /* Add ELT to base.  */
   type = TREE_TYPE (parts->base);
-  parts->base = fold_build2 (POINTER_PLUS_EXPR, type,
-			     parts->base,
-			     fold_convert (sizetype, elt));
+  if (POINTER_TYPE_P (type))
+    parts->base = fold_build2 (POINTER_PLUS_EXPR, type,
+			       parts->base,
+			       fold_convert (sizetype, elt));
+  else
+    parts->base = fold_build2 (PLUS_EXPR, type,
+			       parts->base, elt);
 }

 /* Finds the most expensive multiplication in ADDR that can be


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