public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/106061] New: [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og
@ 2022-06-23 4:46 zsojka at seznam dot cz
2022-06-23 6:47 ` [Bug ipa/106061] [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og since r13-1204-gd68d366425369649 marxin at gcc dot gnu.org
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: zsojka at seznam dot cz @ 2022-06-23 4:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106061
Bug ID: 106061
Summary: [13 Regression] during GIMPLE pass: einline ICE:
verify_cgraph_node failed (edge points to wrong
declaration) with -Og
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: ipa
Assignee: unassigned at gcc dot gnu.org
Reporter: zsojka at seznam dot cz
CC: marxin at gcc dot gnu.org
Target Milestone: ---
Host: x86_64-pc-linux-gnu
Created attachment 53193
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53193&action=edit
reduced testcase
Compiler output:
$ x86_64-pc-linux-gnu-gcc -Og testcase.c
testcase.c: In function 'foo':
testcase.c:14:3: error: edge points to wrong declaration:
14 | bar (-1);
| ^~~~~~~~
<function_decl 0x7f78c998ee00 __builtin_trap
type <function_type 0x7f78c98d55e8
type <void_type 0x7f78c98c5f18 void VOID
align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f78c98c5f18
pointer_to_this <pointer_type 0x7f78c98cd000>>
QI
size <integer_cst 0x7f78c98a9e40 constant 8>
unit-size <integer_cst 0x7f78c98a9e58 constant 1>
align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f78c98d55e8
arg-types <tree_list 0x7f78c98c1b18 value <void_type 0x7f78c98c5f18
void>>>
volatile nothrow public external built-in decl_6 QI <built-in>:0:0
align:8 warn_if_not_align:0 built-in: BUILT_IN_NORMAL:BUILT_IN_TRAP context
<translation_unit_decl 0x7f78c98b7c30 testcase.c>
attributes <tree_list 0x7f78c998ceb0
purpose <identifier_node 0x7f78c98d1be0 nothrow>
chain <tree_list 0x7f78c998ce88
purpose <identifier_node 0x7f78c98d1c30 leaf>
chain <tree_list 0x7f78c998ce60
purpose <identifier_node 0x7f78c98d1b90 noreturn>
chain <tree_list 0x7f78c998ce38
purpose <identifier_node 0x7f78c98d1a00 cold>>>>> chain
<function_decl 0x7f78c998ef00 __builtin_unreachable>>
Instead of: <function_decl 0x7f78c99e8200 baz
type <function_type 0x7f78c98d4930
type <integer_type 0x7f78c98c55e8 int public SI
size <integer_cst 0x7f78c98a9f90 constant 32>
unit-size <integer_cst 0x7f78c98a9fa8 constant 4>
align:32 warn_if_not_align:0 symtab:0 alias-set 1 canonical-type
0x7f78c98c55e8 precision:32 min <integer_cst 0x7f78c98a9f48 -2147483648> max
<integer_cst 0x7f78c98a9f60 2147483647>
pointer_to_this <pointer_type 0x7f78c98cda80>>
QI
size <integer_cst 0x7f78c98a9e40 constant 8>
unit-size <integer_cst 0x7f78c98a9e58 constant 1>
align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f78c98d4930
pointer_to_this <pointer_type 0x7f78c99e1bd0>>
addressable used public external decl_5 QI testcase.c:1:5 align:8
warn_if_not_align:0 context <translation_unit_decl 0x7f78c98b7c30 testcase.c>
chain <var_decl 0x7f78c98b8bd0 g>>
bar/1 (bar) @0x7f78c9a0e000
Type: function definition analyzed
Visibility: semantic_interposition prevailing_def_ironly
References:
Referring:
Function bar/1 is inline copy in foo/2
Availability: local
Function flags: body local
Called by: foo/2 (inlined)
Calls: __builtin_trap/4 (0 (precise),1.00 per call)
during GIMPLE pass: einline
testcase.c:14:3: internal compiler error: verify_cgraph_node failed
0xed2848 cgraph_node::verify_node()
/repo/gcc-trunk/gcc/cgraph.cc:3881
0xec1a54 symtab_node::verify()
/repo/gcc-trunk/gcc/symtab.cc:1359
0x144eba1 expand_call_inline
/repo/gcc-trunk/gcc/tree-inline.cc:4912
0x1451659 gimple_expand_calls_inline
/repo/gcc-trunk/gcc/tree-inline.cc:5318
0x1451659 optimize_inline_calls(tree_node*)
/repo/gcc-trunk/gcc/tree-inline.cc:5490
0x24590be early_inliner(function*)
/repo/gcc-trunk/gcc/ipa-inline.cc:3038
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r13-1213-20220623060722-g31ce821a790-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/13.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r13-1213-20220623060722-g31ce821a790-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.0.0 20220623 (experimental) (GCC)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug ipa/106061] [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og since r13-1204-gd68d366425369649
2022-06-23 4:46 [Bug ipa/106061] New: [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og zsojka at seznam dot cz
@ 2022-06-23 6:47 ` marxin at gcc dot gnu.org
2022-06-24 10:09 ` rguenth at gcc dot gnu.org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-06-23 6:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106061
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[13 Regression] during |[13 Regression] during
|GIMPLE pass: einline ICE: |GIMPLE pass: einline ICE:
|verify_cgraph_node failed |verify_cgraph_node failed
|(edge points to wrong |(edge points to wrong
|declaration) with -Og |declaration) with -Og since
| |r13-1204-gd68d366425369649
Target Milestone|--- |13.0
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2022-06-23
CC| |jason at gcc dot gnu.org
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r13-1204-gd68d366425369649.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug ipa/106061] [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og since r13-1204-gd68d366425369649
2022-06-23 4:46 [Bug ipa/106061] New: [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og zsojka at seznam dot cz
2022-06-23 6:47 ` [Bug ipa/106061] [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og since r13-1204-gd68d366425369649 marxin at gcc dot gnu.org
@ 2022-06-24 10:09 ` rguenth at gcc dot gnu.org
2022-07-14 17:27 ` pinskia at gcc dot gnu.org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-06-24 10:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106061
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug ipa/106061] [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og since r13-1204-gd68d366425369649
2022-06-23 4:46 [Bug ipa/106061] New: [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og zsojka at seznam dot cz
2022-06-23 6:47 ` [Bug ipa/106061] [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og since r13-1204-gd68d366425369649 marxin at gcc dot gnu.org
2022-06-24 10:09 ` rguenth at gcc dot gnu.org
@ 2022-07-14 17:27 ` pinskia at gcc dot gnu.org
2022-08-10 19:25 ` pinskia at gcc dot gnu.org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-07-14 17:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106061
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |zhendong.su at inf dot ethz.ch
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 106305 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug ipa/106061] [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og since r13-1204-gd68d366425369649
2022-06-23 4:46 [Bug ipa/106061] New: [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og zsojka at seznam dot cz
` (2 preceding siblings ...)
2022-07-14 17:27 ` pinskia at gcc dot gnu.org
@ 2022-08-10 19:25 ` pinskia at gcc dot gnu.org
2022-10-11 23:20 ` pinskia at gcc dot gnu.org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-08-10 19:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106061
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |muecker at gwdg dot de
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 106580 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug ipa/106061] [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og since r13-1204-gd68d366425369649
2022-06-23 4:46 [Bug ipa/106061] New: [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og zsojka at seznam dot cz
` (3 preceding siblings ...)
2022-08-10 19:25 ` pinskia at gcc dot gnu.org
@ 2022-10-11 23:20 ` pinskia at gcc dot gnu.org
2022-10-11 23:23 ` pinskia at gcc dot gnu.org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-11 23:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106061
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |andres at anarazel dot de
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 107224 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug ipa/106061] [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og since r13-1204-gd68d366425369649
2022-06-23 4:46 [Bug ipa/106061] New: [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og zsojka at seznam dot cz
` (4 preceding siblings ...)
2022-10-11 23:20 ` pinskia at gcc dot gnu.org
@ 2022-10-11 23:23 ` pinskia at gcc dot gnu.org
2022-11-11 18:06 ` yann at droneaud dot fr
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-11 23:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106061
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note -Og enables -funreachable-traps which is why the ones with -O1
-funreachable-traps are duplicates of this bug too.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug ipa/106061] [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og since r13-1204-gd68d366425369649
2022-06-23 4:46 [Bug ipa/106061] New: [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og zsojka at seznam dot cz
` (5 preceding siblings ...)
2022-10-11 23:23 ` pinskia at gcc dot gnu.org
@ 2022-11-11 18:06 ` yann at droneaud dot fr
2022-12-20 14:37 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: yann at droneaud dot fr @ 2022-11-11 18:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106061
Yann Droneaud <yann at droneaud dot fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |yann at droneaud dot fr
--- Comment #6 from Yann Droneaud <yann at droneaud dot fr> ---
I'm reaching this bug too, compiling the following smaller reproducer:
extern void a(void);
inline void b(int c) { if (c) a(); }
void d(void) { b(0); }
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug ipa/106061] [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og since r13-1204-gd68d366425369649
2022-06-23 4:46 [Bug ipa/106061] New: [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og zsojka at seznam dot cz
` (6 preceding siblings ...)
2022-11-11 18:06 ` yann at droneaud dot fr
@ 2022-12-20 14:37 ` rguenth at gcc dot gnu.org
2023-01-27 10:17 ` cvs-commit at gcc dot gnu.org
2023-01-27 10:18 ` jakub at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-12-20 14:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106061
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2022-12-19 00:00:00 |2022-12-20
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Re-confirmed.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug ipa/106061] [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og since r13-1204-gd68d366425369649
2022-06-23 4:46 [Bug ipa/106061] New: [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og zsojka at seznam dot cz
` (7 preceding siblings ...)
2022-12-20 14:37 ` rguenth at gcc dot gnu.org
@ 2023-01-27 10:17 ` cvs-commit at gcc dot gnu.org
2023-01-27 10:18 ` jakub at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-27 10:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106061
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:bd246ac68239d944b01c213c39d6e212362c1b40
commit r13-5436-gbd246ac68239d944b01c213c39d6e212362c1b40
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Jan 27 11:16:43 2023 +0100
cgraph: Adjust verify_corresponds_to_fndecl [PR106061]
IPA passes redirect some calls in what it determines to be unreachable code
to builtin_decl_unreachable. But that function returns sometimes
builtin_decl_explicit (BUILT_IN_UNREACHABLE) (which was what GCC 12
and earlier did always), or builtin_decl_explicit (BUILT_IN_TRAP)
(e.g. for -funreachable-traps, -O0, -Og).
Now the cgraph verification code has a code to verify cgraph edges
and has there an exception for these redirections to BUILT_IN_UNREACHABLE,
but doesn't have for BUILT_IN_TRAP, so e.g. the following testcase
ICEs during that verification.
The following patch just adds BUILT_IN_TRAP to those exceptions.
2023-01-27 Jakub Jelinek <jakub@redhat.com>
PR ipa/106061
* cgraph.cc (cgraph_edge::verify_corresponds_to_fndecl): Allow
redirection of calls to __builtin_trap in addition to redirection
to __builtin_unreachable.
* gcc.dg/pr106061.c: New test.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug ipa/106061] [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og since r13-1204-gd68d366425369649
2022-06-23 4:46 [Bug ipa/106061] New: [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og zsojka at seznam dot cz
` (8 preceding siblings ...)
2023-01-27 10:17 ` cvs-commit at gcc dot gnu.org
@ 2023-01-27 10:18 ` jakub at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-27 10:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106061
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2023-01-27 10:18 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-23 4:46 [Bug ipa/106061] New: [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og zsojka at seznam dot cz
2022-06-23 6:47 ` [Bug ipa/106061] [13 Regression] during GIMPLE pass: einline ICE: verify_cgraph_node failed (edge points to wrong declaration) with -Og since r13-1204-gd68d366425369649 marxin at gcc dot gnu.org
2022-06-24 10:09 ` rguenth at gcc dot gnu.org
2022-07-14 17:27 ` pinskia at gcc dot gnu.org
2022-08-10 19:25 ` pinskia at gcc dot gnu.org
2022-10-11 23:20 ` pinskia at gcc dot gnu.org
2022-10-11 23:23 ` pinskia at gcc dot gnu.org
2022-11-11 18:06 ` yann at droneaud dot fr
2022-12-20 14:37 ` rguenth at gcc dot gnu.org
2023-01-27 10:17 ` cvs-commit at gcc dot gnu.org
2023-01-27 10:18 ` jakub at gcc dot gnu.org
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).