From dea984dc065d2b32a48986a5644edd51b17437f4 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 20 Mar 2004 20:46:56 +0000 Subject: [PATCH] re PR c/12373 (ICE when generating RTX on valid code) 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 | 6 ++++++ gcc/c-typeck.c | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 230157fbc02..c0720ce275d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-03-20 Ian Lance Taylor + + 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 * fold-const.c (fold): Replace "final_type" with "type". diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 50ae16ff7bb..1cfc8039244 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -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. */ -- 2.30.2