public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] FIx PR47647, revert an earlier patch
@ 2011-02-18 16:41 Richard Guenther
  2011-02-18 18:56 ` Diego Novillo
  2011-02-20 11:12 ` H.J. Lu
  0 siblings, 2 replies; 4+ messages in thread
From: Richard Guenther @ 2011-02-18 16:41 UTC (permalink / raw)
  To: gcc-patches; +Cc: Diego Novillo


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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] FIx PR47647, revert an earlier patch
  2011-02-18 16:41 [PATCH] FIx PR47647, revert an earlier patch Richard Guenther
@ 2011-02-18 18:56 ` Diego Novillo
  2011-02-20 11:12 ` H.J. Lu
  1 sibling, 0 replies; 4+ messages in thread
From: Diego Novillo @ 2011-02-18 18:56 UTC (permalink / raw)
  To: Richard Guenther; +Cc: gcc-patches

On Fri, Feb 18, 2011 at 11:19, Richard Guenther <rguenther@suse.de> wrote:

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

OK.


Diego.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] FIx PR47647, revert an earlier patch
  2011-02-18 16:41 [PATCH] FIx PR47647, revert an earlier patch Richard Guenther
  2011-02-18 18:56 ` Diego Novillo
@ 2011-02-20 11:12 ` H.J. Lu
  2011-04-25 11:44   ` H.J. Lu
  1 sibling, 1 reply; 4+ messages in thread
From: H.J. Lu @ 2011-02-20 11:12 UTC (permalink / raw)
  To: Richard Guenther; +Cc: gcc-patches, Diego Novillo

On Fri, Feb 18, 2011 at 8:19 AM, Richard Guenther <rguenther@suse.de> wrote:
>
> 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.
>

This may have caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47820


-- 
H.J.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] FIx PR47647, revert an earlier patch
  2011-02-20 11:12 ` H.J. Lu
@ 2011-04-25 11:44   ` H.J. Lu
  0 siblings, 0 replies; 4+ messages in thread
From: H.J. Lu @ 2011-04-25 11:44 UTC (permalink / raw)
  To: Richard Guenther; +Cc: gcc-patches, Diego Novillo

On Sat, Feb 19, 2011 at 4:52 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Fri, Feb 18, 2011 at 8:19 AM, Richard Guenther <rguenther@suse.de> wrote:
>>
>> 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.
>>
>
> This may have caused:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47820
>

This also caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48354


-- 
H.J.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-25  4:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-18 16:41 [PATCH] FIx PR47647, revert an earlier patch Richard Guenther
2011-02-18 18:56 ` Diego Novillo
2011-02-20 11:12 ` H.J. Lu
2011-04-25 11:44   ` H.J. Lu

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