Bug 88858 - ICE in rtl_verify_fallthru, at cfgrtl.c:2930 in Firefox build with LTO and PGO
Summary: ICE in rtl_verify_fallthru, at cfgrtl.c:2930 in Firefox build with LTO and PGO
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: lto (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: ---
Assignee: Martin Liška
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks: mozillametabug
  Show dependency treegraph
 
Reported: 2019-01-15 13:42 UTC by Martin Liška
Modified: 2019-02-15 10:03 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 7.4.0, 8.2.1, 9.0
Known to fail:
Last reconfirmed: 2019-01-16 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2019-01-15 13:42:55 UTC
Using following git branch:
https://github.com/marxin/gecko-dev/tree/lto-stable-2

and r267935 of GCC I see following ICE in profile_use phase:

108:40.08 /home/marxin/Programming/gecko-dev/js/src/vm/JSAtom.cpp: In function ‘Atomize’:
108:40.08 /home/marxin/Programming/gecko-dev/js/src/vm/JSAtom.cpp:965: error: verify_flow_info: Incorrect fallthru 423->424
108:40.08   965 | }
108:40.08       |
108:40.08 /home/marxin/Programming/gecko-dev/js/src/vm/JSAtom.cpp:965: error: wrong insn in the fallthru edge
108:40.08 (barrier 6592 9309 2658)
108:40.08 during RTL pass: bbro
108:40.08 /home/marxin/Programming/gecko-dev/js/src/vm/JSAtom.cpp:965: internal compiler error: in rtl_verify_fallthru, at cfgrtl.c:2930
108:40.08 0x6417c0 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
108:40.08 	/home/marxin/Programming/gcc/gcc/rtl-error.c:108
108:40.08 0x80dba1 rtl_verify_fallthru
108:40.08 	/home/marxin/Programming/gcc/gcc/cfgrtl.c:2930
108:40.08 0x80dba1 rtl_verify_flow_info
108:40.08 	/home/marxin/Programming/gcc/gcc/cfgrtl.c:3031
108:40.08 0x7f1e0d verify_flow_info()
108:40.08 	/home/marxin/Programming/gcc/gcc/cfghooks.c:263
108:40.08 0x80b8b9 checking_verify_flow_info
108:40.08 	/home/marxin/Programming/gcc/gcc/cfghooks.h:198
108:40.08 0x80b8b9 cfg_layout_finalize()
108:40.08 	/home/marxin/Programming/gcc/gcc/cfgrtl.c:4359
108:40.08 0x13a18f9 execute
108:40.08 	/home/marxin/Programming/gcc/gcc/bb-reorder.c:2658

would be non-trivial to reduce/debug.
Comment 1 Martin Liška 2019-01-16 18:56:05 UTC
Lemme try to fix it.
Comment 2 Martin Liška 2019-02-13 06:58:10 UTC
Author: marxin
Date: Wed Feb 13 06:57:38 2019
New Revision: 268835

URL: https://gcc.gnu.org/viewcvs?rev=268835&root=gcc&view=rev
Log:
Remove a barrier when EDGE_CROSSING is removed (PR lto/88858).

2019-02-13  Martin Liska  <mliska@suse.cz>

	PR lto/88858
	* cfgrtl.c (remove_barriers_from_footer): New function.
	(try_redirect_by_replacing_jump): Use it.
	(cfg_layout_redirect_edge_and_branch): Likewise.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cfgrtl.c
Comment 3 Martin Liška 2019-02-13 06:59:03 UTC
Fixed on trunk so far.
Comment 4 Martin Liška 2019-02-14 11:25:50 UTC
Author: marxin
Date: Thu Feb 14 11:25:18 2019
New Revision: 268872

URL: https://gcc.gnu.org/viewcvs?rev=268872&root=gcc&view=rev
Log:
Backport r268835

2019-02-14  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-02-13  Martin Liska  <mliska@suse.cz>

	PR lto/88858
	* cfgrtl.c (remove_barriers_from_footer): New function.
	(try_redirect_by_replacing_jump): Use it.
	(cfg_layout_redirect_edge_and_branch): Likewise.

Modified:
    branches/gcc-8-branch/gcc/ChangeLog
    branches/gcc-8-branch/gcc/cfgrtl.c
Comment 5 Martin Liška 2019-02-15 10:03:21 UTC
GCC 7 branch is not affected, closing then.