This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Ensure DW_TAG_base_type has DW_AT_name (PR debug/42278)


On 05/11/2010 01:34 PM, Jakub Jelinek wrote:
+  if (qualified_type == sizetype
+      && TYPE_NAME (qualified_type)
+      && TREE_CODE (TYPE_NAME (qualified_type)) == TYPE_DECL
+      && TREE_CODE (TREE_TYPE (TYPE_NAME (qualified_type))) == INTEGER_TYPE
+      && TYPE_PRECISION (TREE_TYPE (TYPE_NAME (qualified_type)))
+	 == TYPE_PRECISION (qualified_type)
+      && TYPE_UNSIGNED (TREE_TYPE (TYPE_NAME (qualified_type)))
+	 == TYPE_UNSIGNED (qualified_type))
+    qualified_type = TREE_TYPE (TYPE_NAME (qualified_type));

Is this level of checking really necessary? Does any front end have a TYPE_DECL for TYPE_NAME (sizetype) with an incompatible TREE_TYPE? I'd rather make the later tests an assert.


+  else if (name && mod_type_die->die_tag == DW_TAG_base_type)
+    add_name_attribute (mod_type_die, "__unknown__");

Why check 'name' here?


I would think this could replace the "__unknown__" code in base_type_die, but please bring over the comment that this probably indicates a bug.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]