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]

[incremental] Patch: FYI: add missing smashed type check


I'm checking this in on the incremental-compiler branch.

This adds a missing smashed type lookup that I found while building
gdb.

The incremental compiler can now build gdb (I only tried the gdb/
subdir, not the whole tree).  It isn't hugely faster (6%), but of
course for C I expect the gains to come from incremental code
generation -- the next phase.

Tom

ChangeLog:
2008-03-24  Tom Tromey  <tromey@redhat.com>

	* c-typeck.c (build_binary_op) <LE_EXPR>: Look at smashed type
	variant.

Index: c-typeck.c
===================================================================
--- c-typeck.c	(revision 132956)
+++ c-typeck.c	(working copy)
@@ -8311,12 +8311,13 @@
 	{
 	  if (comp_target_types (type0, type1))
 	    {
+	      tree typetype0 = C_SMASHED_TYPE_VARIANT (TREE_TYPE (type0));
+	      tree typetype1 = C_SMASHED_TYPE_VARIANT (TREE_TYPE (type1));
 	      result_type = common_pointer_type (type0, type1);
-	      if (!COMPLETE_TYPE_P (TREE_TYPE (type0))
-		  != !COMPLETE_TYPE_P (TREE_TYPE (type1)))
+	      if (!COMPLETE_TYPE_P (typetype0) != !COMPLETE_TYPE_P (typetype1))
 		pedwarn ("comparison of complete and incomplete pointers");
 	      else if (pedantic
-		       && TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE)
+		       && TREE_CODE (typetype0) == FUNCTION_TYPE)
 		pedwarn ("ISO C forbids ordered comparisons of pointers to functions");
 	    }
 	  else


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