public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/34037] [4.1/4.2/4.3 Regression] Bounds for VLAs not emitted into debuginfo
Date: Fri, 09 Nov 2007 13:56:00 -0000	[thread overview]
Message-ID: <20071109135622.17072.qmail@sourceware.org> (raw)
In-Reply-To: <bug-34037-87@http.gcc.gnu.org/bugzilla/>



------- 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


  parent reply	other threads:[~2007-11-09 13:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-08 22:49 [Bug debug/34037] New: " jakub at gcc dot gnu dot org
2007-11-09  7:32 ` [Bug debug/34037] " jakub at gcc dot gnu dot org
2007-11-09 13:56 ` jakub at gcc dot gnu dot org [this message]
2007-11-09 13:57 ` jakub at gcc dot gnu dot org
2007-11-27  5:58 ` mmitchel at gcc dot gnu dot org
2008-02-05  5:59 ` aoliva at gcc dot gnu dot org
2008-02-05 13:49 ` jakub at gcc dot gnu dot org
2008-07-04 22:21 ` [Bug debug/34037] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
2008-09-11 13:51 ` jakub at gcc dot gnu dot org
2008-09-18 15:20 ` jakub at gcc dot gnu dot org
2008-09-18 15:20 ` jakub at gcc dot gnu dot org
2009-04-29 15:17 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071109135622.17072.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).