public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, C++] Make Canonical ICE instead of just warn when mismatching
@ 2007-01-04  5:30 Andrew_Pinski
  2007-01-04 19:23 ` Mike Stump
  2007-01-05  6:33 ` Gabriel Dos Reis
  0 siblings, 2 replies; 26+ messages in thread
From: Andrew_Pinski @ 2007-01-04  5:30 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 864 bytes --]

Since Doug mentioned it would ICE without checking enabled 
(http://gcc.gnu.org/ml/gcc-patches/2007-01/msg00172.html), it seems the 
right thing to just ICE and then watch out for more fall out.  Yes right 
now we know of a testcase where before this patch we will pass but after 
we will now ICE but it seems like a good idea to get this ICEing before we 
get more testcases where we ICE with checking disable.  (I posted the 
reduced testcase for this problem at 
http://gcc.gnu.org/ml/gcc-patches/2007-01/msg00209.html ).

OK? Bootstrapped and tested on i686-linux-gnu with no regressions.

Thanks,
Andrew Pinski

ChangeLog:

        * typeck.c (comptypes): Call error instead of warning for
        "canonical types differ for identical types".  And then
        call gcc_unreachable.
        Likewise for "same canonical type node for different types" case.


[-- Attachment #2: makeinternal_error.diff.txt --]
[-- Type: text/plain, Size: 1192 bytes --]

Index: typeck.c
===================================================================
--- typeck.c	(revision 120428)
+++ typeck.c	(working copy)
@@ -1121,22 +1121,22 @@ comptypes (tree t1, tree t2, int strict)
 	      /* The two types are structurally equivalent, but their
 		 canonical types were different. This is a failure of the
 		 canonical type propagation code.*/
-	      warning(0,
-		      "canonical types differ for identical types %T and %T", 
-		      t1, t2);
+	      error ("canonical types differ for identical types %T and %T", 
+		     t1, t2);
 	      debug_tree (t1);
 	      debug_tree (t2);
+	      gcc_unreachable ();
 	    }
 	  else if (!result && TYPE_CANONICAL (t1) == TYPE_CANONICAL (t2))
 	    {
 	      /* Two types are structurally different, but the canonical
 		 types are the same. This means we were over-eager in
 		 assigning canonical types. */
-	      warning (0, 
-		       "same canonical type node for different types %T and %T",
-		       t1, t2);
+	      error ("same canonical type node for different types %T and %T",
+		     t1, t2);
 	      debug_tree (t1);
 	      debug_tree (t2);
+	      gcc_unreachable ();
 	    }
 	  
 	  return result;

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2007-01-23  3:41 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-04  5:30 [PATCH, C++] Make Canonical ICE instead of just warn when mismatching Andrew_Pinski
2007-01-04 19:23 ` Mike Stump
2007-01-04 21:00   ` Andrew_Pinski
2007-01-04 22:26     ` Doug Gregor
2007-01-06  8:25       ` Eric Botcazou
2007-01-04 22:36     ` Mike Stump
2007-01-04 23:44       ` Andrew_Pinski
2007-01-04 23:48         ` Daniel Jacobowitz
2007-01-04 23:59           ` Andrew Pinski
2007-01-05  0:03             ` Daniel Jacobowitz
2007-01-05  0:17               ` Andrew_Pinski
2007-01-05  6:44                 ` Gabriel Dos Reis
2007-01-05 14:14                   ` Doug Gregor
2007-01-05 14:16                   ` Richard Kenner
2007-01-05  6:41             ` Gabriel Dos Reis
2007-01-05  2:04         ` Mike Stump
2007-01-05  3:13           ` Brooks Moses
2007-01-05 14:13             ` Doug Gregor
2007-01-05 14:20               ` Richard Guenther
2007-01-05 14:35                 ` Doug Gregor
2007-01-05 19:04                 ` Mike Stump
2007-01-05 19:12                   ` Richard Guenther
2007-01-08  5:14                   ` Andrew Pinski
2007-01-05  6:35   ` Gabriel Dos Reis
2007-01-05  6:33 ` Gabriel Dos Reis
2007-01-23  3:41   ` Mark Mitchell

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