re PR c/12373 (ICE when generating RTX on valid code)
authorIan Lance Taylor <ian@wasabisystems.com>
Sat, 20 Mar 2004 20:46:56 +0000 (20:46 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Sat, 20 Mar 2004 20:46:56 +0000 (20:46 +0000)
PR c/12373
* c-typeck.c (tagged_types_tu_compatible_p): Don't use
DECL_ORIGINAL_TYPE if there isn't one.

From-SVN: r79759

gcc/ChangeLog
gcc/c-typeck.c

index 230157fbc02152fc30df281b688f03df1610cafe..c0720ce275d75cbf4703b8e3887966944585d768 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-20  Ian Lance Taylor  <ian@wasabisystems.com>
+
+       PR c/12373
+       * c-typeck.c (tagged_types_tu_compatible_p): Don't use
+       DECL_ORIGINAL_TYPE if there isn't one.
+
 2004-03-20  Kazu Hirata  <kazu@cs.umass.edu>
 
        * fold-const.c (fold): Replace "final_type" with "type".
index 50ae16ff7bbc1636f2aeeafa444e316ae3d31674..1cfc8039244fe0cfcc35226da4dd386168b1d65f 100644 (file)
@@ -674,10 +674,14 @@ tagged_types_tu_compatible_p (tree t1, tree t2, int flags)
      is harder than it looks because this may be a typedef, so we have
      to go look at the original type.  It may even be a typedef of a
      typedef...  */
-  while (TYPE_NAME (t1) && TREE_CODE (TYPE_NAME (t1)) == TYPE_DECL)
+  while (TYPE_NAME (t1)
+        && TREE_CODE (TYPE_NAME (t1)) == TYPE_DECL
+        && DECL_ORIGINAL_TYPE (TYPE_NAME (t1)))
     t1 = DECL_ORIGINAL_TYPE (TYPE_NAME (t1));
 
-  while (TYPE_NAME (t2) && TREE_CODE (TYPE_NAME (t2)) == TYPE_DECL)
+  while (TYPE_NAME (t2)
+        && TREE_CODE (TYPE_NAME (t2)) == TYPE_DECL
+        && DECL_ORIGINAL_TYPE (TYPE_NAME (t2)))
     t2 = DECL_ORIGINAL_TYPE (TYPE_NAME (t2));
 
   /* C90 didn't have the requirement that the two tags be the same.  */