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]

[named-addr-spaces-branch] [PATCH, committed] Fix thinko in named address space branch


In cleaning up Ben's patches for submission I broke part of the named address
space patches.

I need to review the code more thoroughly, and deal with the other issues
raised in the patch submission, so there will be more patches coming along.

2008-11-18  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* expr.c (expand_expr_real_1): Fix thinko in converting named
	address space pointers.

Index: gcc/expr.c
===================================================================
--- gcc/expr.c	(revision 141895)
+++ gcc/expr.c	(working copy)
@@ -8145,13 +8145,14 @@ expand_expr_real_1 (tree exp, rtx target
       subexp0 = TREE_OPERAND (exp, 0);
       if (POINTER_TYPE_P (type)
 	  && POINTER_TYPE_P (TREE_TYPE (subexp0))
-	  && TYPE_ADDR_SPACE (type) != TYPE_ADDR_SPACE (TREE_TYPE (subexp0)))
+	  && (TYPE_ADDR_SPACE (TREE_TYPE (type))
+	      != TYPE_ADDR_SPACE (TREE_TYPE (subexp0))))
 	{
 	  op0 = expand_expr (subexp0, NULL_RTX, VOIDmode, modifier);
 	  return targetm.addr_space.convert (op0,
 					     TYPE_MODE (type),
-					     TYPE_ADDR_SPACE (subexp0),
-					     TYPE_ADDR_SPACE (type));
+					     TYPE_ADDR_SPACE (TREE_TYPE (subexp0)),
+					     TYPE_ADDR_SPACE (TREE_TYPE (type)));
 	}
 
       if (mode == TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0))))


-- 
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com


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