From 3342b6fdab13e428d1f609c4c4b8af19d3d1cc26 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Fri, 18 May 2001 20:43:43 +0000 Subject: [PATCH] /tmp/pl From-SVN: r42283 --- gcc/ChangeLog | 6 ++++++ gcc/dbxout.c | 23 ++++++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6637b38fd90..7c150e1ce75 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Fri May 18 07:26:34 2001 Richard Kenner + + * dbxout.c (dbxout_type): Use host_integerp. + (dbxout_symbol, case TYPE_DECL): Don't generate tag for records of + variable size. + 2001-05-18 Stan Shebs * configure.in (gcc_cv_as_eh_frame): Cope with old assemblers. diff --git a/gcc/dbxout.c b/gcc/dbxout.c index 97d6151ac00..1cc495b9c21 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -1069,7 +1069,7 @@ dbxout_type (type, full, show_arg_types) Sun dbx crashes if we do. */ if (! full || !COMPLETE_TYPE_P (type) /* No way in DBX fmt to describe a variable size. */ - || TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST) + || ! host_integerp (TYPE_SIZE (type), 1)) return; break; case TYPE_DEFINED: @@ -1094,7 +1094,7 @@ dbxout_type (type, full, show_arg_types) && !full) || !COMPLETE_TYPE_P (type) /* No way in DBX fmt to describe a variable size. */ - || TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST) + || ! host_integerp (TYPE_SIZE (type), 1)) { typevec[TYPE_SYMTAB_ADDRESS (type)].status = TYPE_XREF; return; @@ -1146,7 +1146,7 @@ dbxout_type (type, full, show_arg_types) /* If this is a subtype of another integer type, always prefer to write it as a subtype. */ else if (TREE_TYPE (type) != 0 - && TREE_CODE (TREE_TYPE (type)) == INTEGER_CST) + && TREE_CODE (TREE_TYPE (type)) == INTEGER_TYPE) dbxout_range_type (type); else @@ -1176,7 +1176,8 @@ dbxout_type (type, full, show_arg_types) && TYPE_MAX_VALUE (type) != 0 && TREE_CODE (TYPE_MAX_VALUE (type)) == INTEGER_CST && (TYPE_PRECISION (type) > TYPE_PRECISION (integer_type_node) - || (TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node) + || ((TYPE_PRECISION (type) + == TYPE_PRECISION (integer_type_node)) && TREE_UNSIGNED (type)) || TYPE_PRECISION (type) > HOST_BITS_PER_WIDE_INT || (TYPE_PRECISION (type) == HOST_BITS_PER_WIDE_INT @@ -1363,7 +1364,7 @@ dbxout_type (type, full, show_arg_types) && !full) || !COMPLETE_TYPE_P (type) /* No way in DBX fmt to describe a variable size. */ - || TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST) + || ! host_integerp (TYPE_SIZE (type), 1)) { /* If the type is just a cross reference, output one and mark the type as partially described. @@ -1810,7 +1811,11 @@ dbxout_symbol (decl, local) && !TREE_ASM_WRITTEN (TYPE_NAME (type)) /* Distinguish the implicit typedefs of C++ from explicit ones that might be found in C. */ - && DECL_ARTIFICIAL (decl)) + && DECL_ARTIFICIAL (decl) + /* Do not generate a tag for records of variable size, + since this type can not be properly described in the + DBX format, and it confuses some tools such as objdump. */ + && ! host_integerp (TYPE_SIZE (type), 1)) { tree name = TYPE_NAME (type); if (TREE_CODE (name) == TYPE_DECL) @@ -1859,9 +1864,9 @@ dbxout_symbol (decl, local) did_output = 1; } - /* Don't output a tag if this is an incomplete type (TYPE_SIZE is - zero). This prevents the sun4 Sun OS 4.x dbx from crashing. */ - + /* Don't output a tag if this is an incomplete type. This prevents + the sun4 Sun OS 4.x dbx from crashing. */ + if (tag_needed && TYPE_NAME (type) != 0 && (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE || (DECL_NAME (TYPE_NAME (type)) != 0)) -- 2.30.2