public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Cc: Diego Novillo <dnovillo@google.com>
Subject: [PATCH] FIx PR47647, revert an earlier patch
Date: Fri, 18 Feb 2011 16:41:00 -0000	[thread overview]
Message-ID: <alpine.LNX.2.00.1102181717090.17230@zhemvz.fhfr.qr> (raw)


This reverts lazy BLOCK_VARS streaming as I thought back in time
that VAR_DECLs have BLOCKs as DECL_CONTEXT while they have
FUNCTION_DECLs ... so the patch doesn't work at all and instead
causes us to not stream in any BLOCKs, resulting in no local
decls at all in debug info.  Not good.

Fixed with the following which also makes latent guality issues
re-appear - they were hidden by

pr41353-1.gdb:3: Error in sourced command file:^M
No symbol "vari2" in current context.^M
UNSUPPORTED: gcc.dg/guality/pr41353-1.c  -O2 -flto -flto-partition=none  
line 17 vari2 == 3 * 17

where "No symbol "vari2" in current context" isn't treated the
same as "<optimized out>" ...

I have filed bugs for some LTO debug info issues I noticed.

Bootstrapped and tested on x86_64-unknown-linux-gnu, ok?

Thanks,
Richard.

2011-02-18  Richard Guenther  <rguenther@suse.de>

	PR lto/47647
	* lto-streamer-in.c (lto_input_ts_decl_minimal_tree_pointers):
	Remove lazy BLOCK_VARS streaming.
	(lto_input_ts_block_tree_pointers): Likewise.
	* lto-streamer-out.c (lto_output_ts_block_tree_pointers): Likewise.

Index: trunk/gcc/lto-streamer-in.c
===================================================================
*** trunk.orig/gcc/lto-streamer-in.c	2011-02-18 15:15:52.000000000 +0100
--- trunk/gcc/lto-streamer-in.c	2011-02-18 16:19:25.000000000 +0100
*************** lto_input_ts_decl_minimal_tree_pointers
*** 1960,1972 ****
  {
    DECL_NAME (expr) = lto_input_tree (ib, data_in);
    DECL_CONTEXT (expr) = lto_input_tree (ib, data_in);
-   /* We do not stream BLOCK_VARS but lazily construct it here.  */
-   if (DECL_CONTEXT (expr)
-       && TREE_CODE (DECL_CONTEXT (expr)) == BLOCK)
-     {
-       TREE_CHAIN (expr) = BLOCK_VARS (DECL_CONTEXT (expr));
-       BLOCK_VARS (DECL_CONTEXT (expr)) = expr;
-     }
    DECL_SOURCE_LOCATION (expr) = lto_input_location (ib, data_in);
  }
  
--- 1960,1965 ----
*************** lto_input_ts_block_tree_pointers (struct
*** 2188,2195 ****
    unsigned i, len;
  
    BLOCK_SOURCE_LOCATION (expr) = lto_input_location (ib, data_in);
!   /* We do not stream BLOCK_VARS but lazily construct it when reading
!      in decls.  */
  
    len = lto_input_uleb128 (ib);
    if (len > 0)
--- 2181,2187 ----
    unsigned i, len;
  
    BLOCK_SOURCE_LOCATION (expr) = lto_input_location (ib, data_in);
!   BLOCK_VARS (expr) = lto_input_chain (ib, data_in);
  
    len = lto_input_uleb128 (ib);
    if (len > 0)
Index: trunk/gcc/lto-streamer-out.c
===================================================================
*** trunk.orig/gcc/lto-streamer-out.c	2011-02-18 15:15:50.000000000 +0100
--- trunk/gcc/lto-streamer-out.c	2011-02-18 16:13:13.000000000 +0100
*************** lto_output_ts_block_tree_pointers (struc
*** 1057,1064 ****
    tree t;
  
    lto_output_location (ob, BLOCK_SOURCE_LOCATION (expr));
!   /* We do not stream BLOCK_VARS but lazily construct it when reading
!      in decls.  */
  
    output_uleb128 (ob, VEC_length (tree, BLOCK_NONLOCALIZED_VARS (expr)));
    FOR_EACH_VEC_ELT (tree, BLOCK_NONLOCALIZED_VARS (expr), i, t)
--- 1057,1063 ----
    tree t;
  
    lto_output_location (ob, BLOCK_SOURCE_LOCATION (expr));
!   lto_output_chain (ob, BLOCK_VARS (expr), ref_p);
  
    output_uleb128 (ob, VEC_length (tree, BLOCK_NONLOCALIZED_VARS (expr)));
    FOR_EACH_VEC_ELT (tree, BLOCK_NONLOCALIZED_VARS (expr), i, t)

             reply	other threads:[~2011-02-18 16:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-18 16:41 Richard Guenther [this message]
2011-02-18 18:56 ` Diego Novillo
2011-02-20 11:12 ` H.J. Lu
2011-04-25 11:44   ` H.J. Lu

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=alpine.LNX.2.00.1102181717090.17230@zhemvz.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=dnovillo@google.com \
    --cc=gcc-patches@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).