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]

Re: [tuples] dereference POINTER_PLUS_EXPR check


On 11/21/07 15:46, Aldy Hernandez wrote:

Index: tree-cfg.c
===================================================================
--- tree-cfg.c	(revision 130313)
+++ tree-cfg.c	(working copy)
@@ -3558,16 +3558,37 @@ verify_types_in_gimple_assign (gimple st
 	    error ("invalid operands in pointer plus expression");
 	    return true;
 	  }
-	if (!POINTER_TYPE_P (rhs1_type)
-	    || !useless_type_conversion_p (lhs_type, rhs1_type)
+
+	if (!POINTER_TYPE_P (lhs_type)
+	    || !POINTER_TYPE_P (rhs1_type))
+	  {
+	    error ("type mismatch in pointer plus expression");
+	    return true;
+	  }
+
+	/* Drill down to get to the pointed-to type.  */

Maybe we could make this a helper in tree.c. Something like pointed_to_type(). I don't think one exists already, but I may be wrong.


OK with that change. Thanks.


Diego.



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