diff options
author | Jason Merrill <jason@redhat.com> | 2000-07-27 14:22:39 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2000-07-27 14:22:39 -0400 |
commit | 62e3bf547695acd0095964060d79b5c599cbd368 (patch) | |
tree | 35a36012e2786a4d508c08f34fb89d9e42cd5c10 /gcc | |
parent | 589ca5cb100f0975f12890c95ea2b29301bb4294 (diff) | |
download | gcc-62e3bf547695acd0095964060d79b5c599cbd368.zip gcc-62e3bf547695acd0095964060d79b5c599cbd368.tar.gz gcc-62e3bf547695acd0095964060d79b5c599cbd368.tar.bz2 |
dwarf2out.c (gen_typedef_die): Abort if we get identical TREE_TYPE and DECL_ORIGINAL_TYPE on a typedef.
* dwarf2out.c (gen_typedef_die): Abort if we get identical
TREE_TYPE and DECL_ORIGINAL_TYPE on a typedef.
* typeck.c (common_type): If we're just returning one of our
arguments, don't strip typedef types.
From-SVN: r35297
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 19 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 6 |
4 files changed, 25 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 53ad550..0cc077e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-07-27 Jason Merrill <jason@redhat.com> + + * dwarf2out.c (gen_typedef_die): Abort if we get identical + TREE_TYPE and DECL_ORIGINAL_TYPE on a typedef. + 2000-07-27 RodneyBrown <RodneyBrown@pmsc.com> * expr.h (get_alias_set, lang_get_alias_set): Delete prototypes. diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1ebe193..c981ca6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2000-07-27 Jason Merrill <jason@redhat.com> + + * typeck.c (common_type): If we're just returning one of our + arguments, don't strip typedef types. + 2000-07-26 Mark Mitchell <mark@codesourcery.com> * decl.c (start_cleanup_fn): Mark the function as `inline'. diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index e7f8d2f..0df8a03 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -521,26 +521,27 @@ composite_pointer_type (t1, t2, arg1, arg2, location) converted to integer types. */ tree -common_type (t1, t2) - tree t1, t2; +common_type (orig_t1, orig_t2) + tree orig_t1, orig_t2; { register enum tree_code code1; register enum tree_code code2; tree attributes; + tree t1, t2; /* Save time if the two types are the same. */ + if (orig_t1 == orig_t2) + return orig_t1; + t1 = original_type (orig_t1); + t2 = original_type (orig_t2); if (t1 == t2) - return t1; - t1 = original_type (t1); - t2 = original_type (t2); - if (t1 == t2) - return t1; + return orig_t1; /* If one type is nonsense, use the other. */ if (t1 == error_mark_node) - return t2; + return orig_t2; if (t2 == error_mark_node) - return t1; + return orig_t1; if ((ARITHMETIC_TYPE_P (t1) || TREE_CODE (t1) == ENUMERAL_TYPE) && (ARITHMETIC_TYPE_P (t2) || TREE_CODE (t2) == ENUMERAL_TYPE)) diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 01911a0..6b04b77 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -9276,7 +9276,11 @@ gen_typedef_die (decl, context_die) if (DECL_ORIGINAL_TYPE (decl)) { type = DECL_ORIGINAL_TYPE (decl); - equate_type_number_to_die (TREE_TYPE (decl), type_die); + + if (type == TREE_TYPE (decl)) + abort (); + else + equate_type_number_to_die (TREE_TYPE (decl), type_die); } else type = TREE_TYPE (decl); |