[Bug debug/87295] [8 Regression][early debug] ICE with -ffat-lto-objects -fdebug-types-section -g

2019-02-18 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87295

--- Comment #19 from rguenther at suse dot de  ---
On Thu, 7 Feb 2019, hubicka at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87295
> 
> --- Comment #16 from Jan Hubicka  ---
> GDB PR is now https://sourceware.org/bugzilla/show_bug.cgi?id=24189
> lldb complains too
> error: libxul.so {0x0077}: invalid abbreviation code 42879271, please file
> a bug and attach the file at the start of this error message
> warning: (x86_64)
> /aux/hubicka/firefox2018-release-trunktest2/dist/bin/libxul.so DWARF compile
> unit extends beyond its bounds cu 0x at 0x

Sounds like the DWARF is bogus.  But unless you have a reasonably
small testcase (w/o -fdebug-types-section) I don't want to see it ;)

[Bug debug/87295] [8 Regression][early debug] ICE with -ffat-lto-objects -fdebug-types-section -g

2019-02-08 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87295

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||8.2.1
 Resolution|--- |FIXED
  Known to fail|8.2.1   |8.2.0

--- Comment #18 from Richard Biener  ---
Fixed.

[Bug debug/87295] [8 Regression][early debug] ICE with -ffat-lto-objects -fdebug-types-section -g

2019-02-08 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87295

--- Comment #17 from Richard Biener  ---
Author: rguenth
Date: Fri Feb  8 14:34:49 2019
New Revision: 268698

URL: https://gcc.gnu.org/viewcvs?rev=268698=gcc=rev
Log:
2019-02-08  Richard Biener  

Backport from mainline
2019-02-03  Richard Biener  

PR debug/87295
* dwarf2out.c (copy_ancestor_tree): Register non-stubs as
orig.

* g++.dg/debug/dwarf2/pr87295.C: New testcase.

2019-01-29  Richard Biener  

PR debug/87295
* dwarf2out.c (collect_skeleton_dies): New helper.
(copy_decls_for_unworthy_types): Call it.
(build_abbrev_table): Do not try to replace
DW_AT_signature refs with local refs.

* g++.dg/lto/pr87295_0.C: New testcase.

2019-01-17  Richard Biener  

PR lto/86736
* dwarf2out.c (want_pubnames): Never generate pubnames sections
and friends for the LTO part of debug info.

2019-01-24  Richard Biener  

PR lto/87187
* tree-streamer-out.c (write_ts_decl_common_tree_pointers):
When in "legacy" debug mode make sure to reset self-origins.

2019-01-15  Richard Biener  

PR debug/88046
* dwarf2out.c (gen_member_die): Do not generate inheritance
DIEs late.

* g++.dg/lto/pr88046_0.C: New testcase.

2018-11-22  Richard Biener  

PR lto/87229
PR lto/88112
* lto-streamer-out.c (lto_is_streamable): Allow CALL_EXPRs
which can appear in size expressions.
* tree-streamer-in.c (unpack_ts_base_value_fields): Stream
CALL_EXPR_BY_DESCRIPTOR.
(streamer_read_tree_bitfields): Stream CALL_EXPR_IFN.
* tree-streamer-out.c (pack_ts_base_value_fields): Stream
CALL_EXPR_BY_DESCRIPTOR.
(streamer_write_tree_bitfields): Stream CALL_EXPR_IFN.

Added:
branches/gcc-8-branch/gcc/testsuite/g++.dg/debug/dwarf2/pr87295.C
branches/gcc-8-branch/gcc/testsuite/g++.dg/lto/pr87295_0.C
branches/gcc-8-branch/gcc/testsuite/g++.dg/lto/pr88046_0.C
Modified:
branches/gcc-8-branch/gcc/ChangeLog
branches/gcc-8-branch/gcc/dwarf2out.c
branches/gcc-8-branch/gcc/lto-streamer-out.c
branches/gcc-8-branch/gcc/testsuite/ChangeLog
branches/gcc-8-branch/gcc/tree-streamer-in.c
branches/gcc-8-branch/gcc/tree-streamer-out.c

[Bug debug/87295] [8 Regression][early debug] ICE with -ffat-lto-objects -fdebug-types-section -g

2019-02-07 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87295

--- Comment #16 from Jan Hubicka  ---
GDB PR is now https://sourceware.org/bugzilla/show_bug.cgi?id=24189
lldb complains too
error: libxul.so {0x0077}: invalid abbreviation code 42879271, please file
a bug and attach the file at the start of this error message
warning: (x86_64)
/aux/hubicka/firefox2018-release-trunktest2/dist/bin/libxul.so DWARF compile
unit extends beyond its bounds cu 0x at 0x

[Bug debug/87295] [8 Regression][early debug] ICE with -ffat-lto-objects -fdebug-types-section -g

2019-02-07 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87295

--- Comment #15 from Jan Hubicka  ---
I now can build Firefox with gdb, but debugging experience is not optimal. Gdb
starts and when I start firefox it stops itself. After doing "fg" it complains
about dwarf headers
hubicka@lomikamen-jh:/aux/hubicka/firefox2018-release-trunktest2/dist/bin$ gdb
firefox
GNU gdb (GDB) 8.2.50.20181222-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from firefox...
Dwarf Error: wrong version in compilation unit header (is 12062, should be 2,
3, 4 or 5) [in module
/aux/hubicka/firefox2018-release-trunktest2/dist/bin/firefox]
(No debugging symbols found in firefox)
warning: File "/aux/hubicka/firefox-2018/firefox/.gdbinit" auto-loading has
been declined by your `auto-load safe-path' set to
"$debugdir:$datadir/auto-load".
To enable execution of this file add
add-auto-load-safe-path /aux/hubicka/firefox-2018/firefox/.gdbinit 
line to your configuration file "/home/hubicka/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/home/hubicka/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
info "(gdb)Auto-loading safe path"
(gdb) run
Starting program: /aux/hubicka/firefox2018-release-trunktest2/dist/bin/firefox
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". 

[4]+  Stopped gdb firefox
hubicka@lomikamen-jh:/aux/hubicka/firefox2018-release-trunktest2/dist/bin$ fg
gdb firefox
Dwarf Error: wrong version in compilation unit header (is 82, should be 2, 3, 4
or 5) [in module
/aux/hubicka/firefox2018-release-trunktest2/dist/bin/libnspr4.so]

[4]+  Stopped gdb firefox
hubicka@lomikamen-jh:/aux/hubicka/firefox2018-release-trunktest2/dist/bin$ fg

[Bug debug/87295] [8 Regression][early debug] ICE with -ffat-lto-objects -fdebug-types-section -g

2019-02-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87295

--- Comment #14 from Richard Biener  ---
Author: rguenth
Date: Sun Feb  3 10:53:01 2019
New Revision: 268485

URL: https://gcc.gnu.org/viewcvs?rev=268485=gcc=rev
Log:
2019-02-03  Richard Biener  

PR debug/87295
* dwarf2out.c (copy_ancestor_tree): Register non-stubs as
orig.

* g++.dg/debug/dwarf2/pr87295.C: New testcase.

Added:
trunk/gcc/testsuite/g++.dg/debug/dwarf2/pr87295.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/dwarf2out.c
trunk/gcc/testsuite/ChangeLog

[Bug debug/87295] [8 Regression][early debug] ICE with -ffat-lto-objects -fdebug-types-section -g

2019-02-01 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87295

--- Comment #13 from Richard Biener  ---
OK, so we're cloning from two different type units ultimatively refering to the
same DIE.  This means that copy_ancestor_tree doesn't set up decl_table
appropriately since it doesn't have the same logic as clone_as_declaration.

The following fixes tramp3d and survives the dwarf2.exp testsuites.

Index: gcc/dwarf2out.c
===
--- gcc/dwarf2out.c (revision 268446)
+++ gcc/dwarf2out.c (working copy)
@@ -8169,6 +8169,11 @@ copy_ancestor_tree (dw_die_ref unit, dw_
   decl_table_entry **slot = NULL;
   struct decl_table_entry *entry = NULL;

+  /* If DIE refers to a stub unfold that so we get the appropriate
+ DIE registered as orig in decl_table.  */
+  if (dw_die_ref c = get_AT_ref (die, DW_AT_signature))
+die = c;
+
   if (decl_table)
 {
   /* Check if the entry has already been copied to UNIT.  */

[Bug debug/87295] [8 Regression][early debug] ICE with -ffat-lto-objects -fdebug-types-section -g

2019-02-01 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87295

--- Comment #12 from Jakub Jelinek  ---
Reduced testcase for -O2 -g -fdebug-types-section:
struct A {};
namespace N {
struct B {
  using C = struct H {};
  using D = A;
};
}
struct E : N::B {
  typedef C C;
};
namespace N {
struct F {
  E::C d;
  E::D h;
};
}
struct G {
  N::F i;
} j;

[Bug debug/87295] [8 Regression][early debug] ICE with -ffat-lto-objects -fdebug-types-section -g

2019-02-01 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87295

--- Comment #11 from Richard Biener  ---
Created attachment 45581
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45581=edit
sources

[Bug debug/87295] [8 Regression][early debug] ICE with -ffat-lto-objects -fdebug-types-section -g

2019-02-01 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87295

Richard Biener  changed:

   What|Removed |Added

   Keywords||needs-reduction

--- Comment #10 from Richard Biener  ---
So it's again copy_decls_for_unworthy_types creating a duplicate stub, this
time inside a type unit.  There's no stub previously present thus not for
the fix I installed.  I'll debug once I get a reduced testcase.

+DIE0: DW_TAG_class_type (0x7fffdb7cdc80)
+  abbrev id: 0 offset: 0 mark: 0
+  DW_AT_name: "DataBlockController"
+  DW_AT_signature: die -> signature: bbc5b80d562b30b7 (0x72865280)
+  DW_AT_declaration: 1
+DIE0: DW_TAG_structure_type (0x7fffdb7cdc30)
+  abbrev id: 0 offset: 0 mark: 0
+  DW_AT_name: "WithAffinity"
+  DW_AT_declaration: 1
...
+DIE0: DW_TAG_class_type (0x7fffdb7d0140)
+  abbrev id: 0 offset: 0 mark: 0
+  DW_AT_name: "DataBlockController"
+  DW_AT_signature: die -> signature: bbc5b80d562b30b7 (0x72865280)
+  DW_AT_declaration: 1
+DIE0: DW_TAG_typedef (0x7fffdb7d00f0)
+  abbrev id: 0 offset: 0 mark: 0
+  DW_AT_name: "DynamicID_t"
+  DW_AT_decl_file: "tramp3d-v4.cpp" (0)
+  DW_AT_decl_line: 7182
+  DW_AT_decl_column: 31
+  DW_AT_type: die -> 0 (0x7fffdb7d0190)
+  DW_AT_accessibility: 1

[Bug debug/87295] [8 Regression][early debug] ICE with -ffat-lto-objects -fdebug-types-section -g

2019-02-01 Thread hubicka at ucw dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87295

--- Comment #9 from Jan Hubicka  ---
Note that Mark also got an crash in the wrapper
#0  0x0046527f in simple_object_elf_copy_lto_debug_sections
(sobj=, dobj=, pfn=,
err=) at 
+/home/engshare/third-party2/gcc/7.x/src/gcc-8.x/libiberty/simple-object-elf.c:1481
 
#1  0x00462c05 in simple_object_copy_lto_debug_sections
(sobj=sobj@entry=0x71be50, dest=dest@entry=0x7532620   
  
+"/data/users/mwilliams/hphp-2/fbcode/buck-out/tmp/ld/tmp-lj3w0kif/ccGHeQIUdebugobjtem",
err=err@entry=0x7ffe2189b758) at   
 
+/home/engshare/third-party2/gcc/7.x/src/gcc-8.x/libiberty/simple-object.c:320  
#2  0x00450073 in debug_objcopy (infile=) at
/home/engshare/third-party2/gcc/7.x/src/gcc-8.x/gcc/lto-wrapper.c:1009  
#3  0x00450bbc in run_gcc (argc=, argv=)
at /home/engshare/third-party2/gcc/7.x/src/gcc-8.x/gcc/lto-wrapper.c:1436   
#4  0x00438a47 in main (argc=, argv=) at
/home/engshare/third-party2/gcc/7.x/src/gcc-8.x/gcc/lto-wrapper.c:1716  

This does not seem to reproduce simply to me.
Honza

[Bug debug/87295] [8 Regression][early debug] ICE with -ffat-lto-objects -fdebug-types-section -g

2019-02-01 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87295

--- Comment #8 from Richard Biener  ---
(In reply to Jan Hubicka from comment #7)
> It seems that this breaks debug-types-sections w/o LTO as well now.
> ./xgcc -B ./ -O2 -g ~/tramp3d-v44.ii -fdebug-types-section
> /aux/hubicka/tramp3d-v4b.cpp:56088:1: internal compiler error: in
> build_abbrev_table, at dwarf2out.c:9061
> 56088 | }
>   | ^
> 0x720707 build_abbrev_table
> ../../gcc/dwarf2out.c:9061
> 0xc3dee7 build_abbrev_table
> ../../gcc/dwarf2out.c:9112
> 0xc40e7b output_comdat_type_unit
> ../../gcc/dwarf2out.c:11237
> 0xc6678d dwarf2out_finish
> ../../gcc/dwarf2out.c:31496
> Please submit a full bug report,
> with preprocessed source if appropriate.
> Please include the complete backtrace with any bug report.
> See  for instructions.

Confirmed with just -g -fdebug-types-section -fpermissive - it's easy to
remove the assert but I hope to get a testcase for the testsuite...

[Bug debug/87295] [8 Regression][early debug] ICE with -ffat-lto-objects -fdebug-types-section -g

2019-01-31 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87295

--- Comment #7 from Jan Hubicka  ---
It seems that this breaks debug-types-sections w/o LTO as well now.
./xgcc -B ./ -O2 -g ~/tramp3d-v44.ii -fdebug-types-section
/aux/hubicka/tramp3d-v4b.cpp:56088:1: internal compiler error: in
build_abbrev_table, at dwarf2out.c:9061
56088 | }
  | ^
0x720707 build_abbrev_table
../../gcc/dwarf2out.c:9061
0xc3dee7 build_abbrev_table
../../gcc/dwarf2out.c:9112
0xc40e7b output_comdat_type_unit
../../gcc/dwarf2out.c:11237
0xc6678d dwarf2out_finish
../../gcc/dwarf2out.c:31496
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug debug/87295] [8 Regression][early debug] ICE with -ffat-lto-objects -fdebug-types-section -g

2019-01-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87295

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
  Known to work||7.3.1, 9.0
   Target Milestone|--- |8.3
Summary|[early debug] ICE with  |[8 Regression][early debug]
   |-ffat-lto-objects   |ICE with -ffat-lto-objects
   |-fdebug-types-section -g|-fdebug-types-section -g
  Known to fail||8.2.1

--- Comment #6 from Richard Biener  ---
Fixed on trunk sofar, also fails on the GCC 8 branch.