[Bug middle-end/92037] [10 Regression] LTO bootstrap broken in selftests

2019-10-16 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92037

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

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

[Bug middle-end/92037] [10 Regression] LTO bootstrap broken in selftests

2019-10-10 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92037

--- Comment #6 from Jan Hubicka  ---
Author: hubicka
Date: Thu Oct 10 13:04:44 2019
New Revision: 276804

URL: https://gcc.gnu.org/viewcvs?rev=276804&root=gcc&view=rev
Log:
PR middle-end/92037
* cgraph.c (symbol_table_test::symbol_table_test): Use ggc_alloc
rather than ggc_alloc_cleared to alloc symbol table.
* toplev.c (general_init): Likewise.
* cgraph.h (symbol_table): Explicitly construct every field.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/cgraph.c
trunk/gcc/cgraph.h
trunk/gcc/toplev.c

[Bug middle-end/92037] [10 Regression] LTO bootstrap broken in selftests

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

--- Comment #5 from Jan Hubicka  ---
It is lifetime dse issue in symbol table construction. I am testing

* cgraph.c (symbol_table_test::symbol_table_test): Use ggc_alloc
rather than ggc_alloc_cleared to alloc symbol table.
* toplev.c (general_init): Likewise.
* cgraph.h (symbol_table): Explicitly construct every field.
Index: cgraph.c
===
--- cgraph.c(revision 276707)
+++ cgraph.c(working copy)
@@ -3835,7 +3832,7 @@ symbol_table_test::symbol_table_test ()
 {
   gcc_assert (saved_symtab == NULL);
   saved_symtab = symtab;
-  symtab = new (ggc_cleared_alloc  ()) symbol_table ();
+  symtab = new (ggc_alloc  ()) symbol_table ();
 }

 /* Destructor.  Restore the old value of symtab.  */
Index: toplev.c
===
--- toplev.c(revision 276707)
+++ toplev.c(working copy)
@@ -1170,7 +1170,7 @@ general_init (const char *argv0, bool in
   /* Create the passes.  */
   g->set_passes (new gcc::pass_manager (g));

-  symtab = new (ggc_cleared_alloc  ()) symbol_table ();
+  symtab = new (ggc_alloc  ()) symbol_table ();

   statistics_early_init ();
   debuginfo_early_init ();
Index: cgraph.h
===
--- cgraph.h(revision 276707)
+++ cgraph.h(working copy)
@@ -2095,9 +2095,19 @@ public:
   friend struct cgraph_node;
   friend struct cgraph_edge;

-  symbol_table (): cgraph_max_uid (1), cgraph_max_summary_id (0),
-  edges_max_uid (1), edges_max_summary_id (0),
-  cgraph_released_summary_ids (), edge_released_summary_ids ()
+  symbol_table (): 
+  cgraph_count (0), cgraph_max_uid (1), cgraph_max_summary_id (0),
+  edges_count (0), edges_max_uid (1), edges_max_summary_id (0),
+  cgraph_released_summary_ids (), edge_released_summary_ids (),
+  nodes (NULL), asmnodes (NULL), asm_last_node (NULL),
+  order (0), global_info_ready (false), state (PARSING),
+  function_flags_ready (false), cpp_implicit_aliases_done (false),
+  section_hash (NULL), assembler_name_hash (NULL), init_priority_hash (NULL),
+  dump_file (NULL), ipa_clones_dump_file (NULL), cloned_nodes (),
+  m_first_edge_removal_hook (NULL), m_first_cgraph_removal_hook (NULL),
+  m_first_edge_duplicated_hook (NULL), m_first_cgraph_duplicated_hook (NULL),
+  m_first_cgraph_insertion_hook (NULL), m_first_varpool_insertion_hook (NULL),
+  m_first_varpool_removal_hook (NULL)
   {
   }

@@ -2343,6 +2353,9 @@ public:
   /* Vector of released summary IDS for cgraph nodes.  */
   vec GTY ((skip)) edge_released_summary_ids;

+  /* Return symbol used to separate symbol name from suffix.  */
+  static char symbol_suffix_separator ();
+
   symtab_node* GTY(()) nodes;
   asm_node* GTY(()) asmnodes;
   asm_node* GTY(()) asm_last_node;
@@ -2372,9 +2385,6 @@ public:

   FILE* GTY ((skip)) dump_file;

-  /* Return symbol used to separate symbol name from suffix.  */
-  static char symbol_suffix_separator ();
-
   FILE* GTY ((skip)) ipa_clones_dump_file;

   hash_set  GTY ((skip)) cloned_nodes;

[Bug middle-end/92037] [10 Regression] LTO bootstrap broken in selftests

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

--- Comment #4 from Jan Hubicka  ---
> Started with Honza's r276469 (git mirror 047f91509cb) but that likely only
> exposed some latent issue.  Given where the segfault takes place, perhaps the
> symbol_table needs re-initialization in between different self-tests... David?
One posibility would be lifetime DSE bug in the C++ conversion of the
code. We had some issues with that in the past.

Honza
> 
> -- 
> You are receiving this mail because:
> You are on the CC list for the bug.

[Bug middle-end/92037] [10 Regression] LTO bootstrap broken in selftests

2019-10-10 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92037

Martin Jambor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-10-10
 CC||dmalcolm at gcc dot gnu.org,
   ||hubicka at gcc dot gnu.org,
   ||jamborm at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #3 from Martin Jambor  ---
Started with Honza's r276469 (git mirror 047f91509cb) but that likely only
exposed some latent issue.  Given where the segfault takes place, perhaps the
symbol_table needs re-initialization in between different self-tests... David?

[Bug middle-end/92037] [10 Regression] LTO bootstrap broken in selftests

2019-10-09 Thread trass3r at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92037

Trass3r  changed:

   What|Removed |Added

 CC||trass3r at gmail dot com

--- Comment #2 from Trass3r  ---
Same here with
CPPFLAGS="-pipe -O3 -g0 -flto -march=haswell" CC=gcc-9 CXX=g++-9
../sources/gcc-git/configure --enable-languages=c,c++ --enable-lto
--enable-plugins --disable-nls --disable-multilib --disable-bootstrap
on Ubuntu 19.04:

./gcc/xgcc -B..././gcc/ -xc -nostdinc /dev/null -S -o /dev/null
-fself-test=../../sources/gcc-git/gcc/testsuite/selftests
cc1: internal compiler error: Segmentation fault
0x147094f crash_signal
../../sources/gcc-git/gcc/toplev.c:326
0x195ad29 cgraph_node::create(tree_node*)
../../sources/gcc-git/gcc/cgraph.h:2658
0x1958947 cgraph_node::get_create(tree_node*)
../../sources/gcc-git/gcc/cgraph.c:545
0x1926c38 selftest::test_capture_of_dump_calls(selftest::line_table_case
const&) [clone .lto_priv.0]
../../sources/gcc-git/gcc/dumpfile.c:2236
0x18f5fb3 selftest::dumpfile_c_tests()
../../sources/gcc-git/gcc/input.c:3555
0x8d3c31 selftest::run_tests()
../../sources/gcc-git/gcc/selftest-run-tests.c:62
0x1470973 toplev::run_self_tests()
../../sources/gcc-git/gcc/toplev.c:2230

[Bug middle-end/92037] [10 Regression] LTO bootstrap broken in selftests

2019-10-09 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92037

--- Comment #1 from Richard Biener  ---
Note my stage1 compiler was built with gcc 9.2.1 (r274748) and
STAGE1_CFLAGS=-O2
trying with -O0 stage1 now.

[Bug middle-end/92037] [10 Regression] LTO bootstrap broken in selftests

2019-10-09 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92037

Richard Biener  changed:

   What|Removed |Added

   Keywords||build
 Target||x86_64-*-*
Version|9.2.1   |10.0
   Target Milestone|--- |10.0