* [Bug c++/67699] Segfault compiling a constexpr array with -fmerge-all-constants -flto
[not found] <bug-67699-4@http.gcc.gnu.org/bugzilla/>
@ 2015-09-23 22:39 ` gcc at norgg dot org
2015-09-23 22:47 ` gcc at norgg dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: gcc at norgg dot org @ 2015-09-23 22:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67699
--- Comment #1 from Norgg <gcc at norgg dot org> ---
Created attachment 36381
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36381&action=edit
Reduced testcase with const instead of constexpr
Futher testing by slowriot found that you can change the constexpr to const and
drop the --std switch.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/67699] Segfault compiling a constexpr array with -fmerge-all-constants -flto
[not found] <bug-67699-4@http.gcc.gnu.org/bugzilla/>
2015-09-23 22:39 ` [Bug c++/67699] Segfault compiling a constexpr array with -fmerge-all-constants -flto gcc at norgg dot org
@ 2015-09-23 22:47 ` gcc at norgg dot org
2015-09-23 22:56 ` [Bug c++/67699] Segfault compiling a const array with -flto gcc at norgg dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: gcc at norgg dot org @ 2015-09-23 22:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67699
--- Comment #2 from Norgg <gcc at norgg dot org> ---
It seems the -fmerge-all-constants isn't necessary to cause the segfault either
any more, although it was in an earlier larger test case.
Minimal command line to reproduce is now:
$ g++ const_crash.cpp -flto
const_crash.cpp:11:24: internal compiler error: Segmentation fault
template class foo<int>;
^
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/67699] Segfault compiling a const array with -flto
[not found] <bug-67699-4@http.gcc.gnu.org/bugzilla/>
2015-09-23 22:39 ` [Bug c++/67699] Segfault compiling a constexpr array with -fmerge-all-constants -flto gcc at norgg dot org
2015-09-23 22:47 ` gcc at norgg dot org
@ 2015-09-23 22:56 ` gcc at norgg dot org
2015-09-24 7:58 ` [Bug lto/67699] ICE (segfault) " rguenth at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: gcc at norgg dot org @ 2015-09-23 22:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67699
--- Comment #3 from Norgg <gcc at norgg dot org> ---
Created attachment 36382
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36382&action=edit
Preprocessed file
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug lto/67699] ICE (segfault) compiling a const array with -flto
[not found] <bug-67699-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2015-09-23 22:56 ` [Bug c++/67699] Segfault compiling a const array with -flto gcc at norgg dot org
@ 2015-09-24 7:58 ` rguenth at gcc dot gnu.org
2015-09-24 11:01 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-09-24 7:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67699
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
#2 0x000000000070544c in symtab_node::get (decl=0x7ffff68d9b40)
at /space/rguenther/src/svn/gcc-5-branch/gcc/cgraph.h:365
365 gcc_checking_assert (TREE_CODE (decl) == FUNCTION_DECL
(gdb) l
360 static inline symtab_node *get (const_tree decl)
361 {
362 #ifdef ENABLE_CHECKING
363 /* Check that we are called for sane type of object - functions
364 and static or external variables. */
365 gcc_checking_assert (TREE_CODE (decl) == FUNCTION_DECL
366 || (TREE_CODE (decl) == VAR_DECL
367 && (TREE_STATIC (decl) || DECL_EXTERNAL
(decl)
368 || in_lto_p)));
(gdb) p debug_tree (decl)
<var_decl 0x7ffff68d9b40 bar
type <array_type 0x7ffff6a405e8
...
readonly decl_1 decl_5 DI file t.ii line 2 col 23 size <integer_cst
0x7ffff68cce58 64> unit size <integer_cst 0x7ffff68cce70 8>
align 32 context <function_decl 0x7ffff6a411b0 foo>>
and we are not in_lto_p (this is cc1plus). And we're coming from (tataa)
940 create_references (encoder, vnode);
941 /* For proper debug info, we need to ship the origins, too. */
942 if (DECL_ABSTRACT_ORIGIN (vnode->decl))
943 {
944 varpool_node *origin_node
945 = varpool_node::get (DECL_ABSTRACT_ORIGIN (vnode->decl));
that's on the GCC 5 branch. ISTR fixing this on trunk - ah, but only for
the early LTO debug work.
Hmm. Let's see if we can survive removing that code - it got added during
GCC 4.9 development. But we never actually stream DECL_ABSTRACT_ORIGIN...
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug lto/67699] ICE (segfault) compiling a const array with -flto
[not found] <bug-67699-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2015-09-24 7:58 ` [Bug lto/67699] ICE (segfault) " rguenth at gcc dot gnu.org
@ 2015-09-24 11:01 ` rguenth at gcc dot gnu.org
2015-09-24 11:02 ` [Bug lto/67699] [4.9/5 Regression] " rguenth at gcc dot gnu.org
2015-10-06 10:20 ` rguenth at gcc dot gnu.org
6 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-09-24 11:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67699
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Thu Sep 24 11:01:14 2015
New Revision: 228084
URL: https://gcc.gnu.org/viewcvs?rev=228084&root=gcc&view=rev
Log:
2015-09-24 Richard Biener <rguenther@suse.de>
PR lto/67699
* lto-cgraph.c (compute_ltrans_boundary): Do not stream
abstract origins.
* g++.dg/pr67699.C: New testcase.
Added:
trunk/gcc/testsuite/g++.dg/pr67699.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/lto-cgraph.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug lto/67699] [4.9/5 Regression] ICE (segfault) compiling a const array with -flto
[not found] <bug-67699-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2015-09-24 11:01 ` rguenth at gcc dot gnu.org
@ 2015-09-24 11:02 ` rguenth at gcc dot gnu.org
2015-10-06 10:20 ` rguenth at gcc dot gnu.org
6 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-09-24 11:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67699
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |hubicka at gcc dot gnu.org
Known to work| |4.8.5, 6.0
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
Target Milestone|--- |4.9.4
Summary|ICE (segfault) compiling a |[4.9/5 Regression] ICE
|const array with -flto |(segfault) compiling a
| |const array with -flto
Known to fail|6.0 |
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed on trunk. Will backport to GCC 5 if no issues pop up.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug lto/67699] [4.9/5 Regression] ICE (segfault) compiling a const array with -flto
[not found] <bug-67699-4@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2015-09-24 11:02 ` [Bug lto/67699] [4.9/5 Regression] " rguenth at gcc dot gnu.org
@ 2015-10-06 10:20 ` rguenth at gcc dot gnu.org
6 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-10-06 10:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67699
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Tue Oct 6 10:19:54 2015
New Revision: 228517
URL: https://gcc.gnu.org/viewcvs?rev=228517&root=gcc&view=rev
Log:
2015-10-06 Richard Biener <rguenther@suse.de>
Backport from mainline
2015-09-15 Richard Biener <rguenther@suse.de>
PR middle-end/67563
* gimple-fold.c (gimplify_and_update_call_from_tree): Do not
transfer EH info from old to new stmt.
(replace_call_with_value): Likewise.
(replace_call_with_call_and_fold): Likewise.
(gimple_fold_builtin_memory_op): Likewise.
(gimple_fold_builtin_memset): Likewise.
(gimple_fold_builtin_stpcpy): Likewise.
(gimple_fold_call): Likewise.
* gcc.dg/pr67563.c: New testcase.
2015-09-24 Richard Biener <rguenther@suse.de>
PR lto/67699
* lto-cgraph.c (compute_ltrans_boundary): Do not stream
abstract origins.
* g++.dg/pr67699.C: New testcase.
Added:
branches/gcc-5-branch/gcc/testsuite/g++.dg/pr67699.C
branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr67563.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/gimple-fold.c
branches/gcc-5-branch/gcc/lto-cgraph.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 7+ messages in thread