From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17173 invoked by alias); 9 Nov 2007 13:56:42 -0000 Received: (qmail 17073 invoked by uid 48); 9 Nov 2007 13:56:22 -0000 Date: Fri, 09 Nov 2007 13:56:00 -0000 Message-ID: <20071109135622.17072.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug debug/34037] [4.1/4.2/4.3 Regression] Bounds for VLAs not emitted into debuginfo In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jakub at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-11/txt/msg00796.txt.bz2 ------- Comment #1 from jakub at gcc dot gnu dot org 2007-11-09 13:56 ------- I have tried: --- dwarf2out.c.jj9 2007-11-05 09:05:44.000000000 +0100 +++ dwarf2out.c 2007-11-09 14:29:04.000000000 +0100 @@ -11032,6 +11032,26 @@ add_bound_info (dw_die_ref subrange_die, later parameter. */ if (decl_die != NULL) add_AT_die_ref (subrange_die, bound_attr, decl_die); + /* Handle gimplified type bounds. */ + else if (TREE_CODE (bound) == VAR_DECL + && DECL_ARTIFICIAL (bound) + && !DECL_NAME (bound) + && !TREE_STATIC (bound) + && current_function_decl + && (lookup_decl_loc (bound) + || loc_descriptor_from_tree (bound))) + { + dw_die_ref ctx, decl_die; + + ctx = lookup_decl_die (current_function_decl); + + decl_die = new_die (DW_TAG_variable, ctx, bound); + add_AT_flag (decl_die, DW_AT_artificial, 1); + add_type_attribute (decl_die, TREE_TYPE (bound), 1, 0, ctx); + add_location_or_const_value_attribute (decl_die, bound, + DW_AT_location); + add_AT_die_ref (subrange_die, bound_attr, decl_die); + } break; } but that still doesn't work, because instantiate_decl etc. hasn't been called on this, only BLOCK_VARS are treated that way. So, either we need to put these artificial vars into BLOCK_VARS, or find a way to also keep the original non-gimplified expression in TYPE_DOMAIN. -- jakub at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|4.1.3 |--- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34037