Bug 65761 - [5 Regression] internal compiler error: in patch_jump_insn, at cfgrtl.c:1296
Summary: [5 Regression] internal compiler error: in patch_jump_insn, at cfgrtl.c:1296
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 5.0
: P3 normal
Target Milestone: 5.0
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-14 08:15 UTC by Mike Hommey
Modified: 2015-04-14 13:27 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2015-04-14 00:00:00


Attachments
Unified_cpp_js_src5.i (994.58 KB, application/x-xz)
2015-04-14 09:24 UTC, Mike Hommey
Details
Unified_cpp_js_src5.gcda (93.23 KB, application/octet-stream)
2015-04-14 09:39 UTC, Mike Hommey
Details
gcc5-pr65761.patch (434 bytes, patch)
2015-04-14 11:01 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Hommey 2015-04-14 08:15:20 UTC
This happened while building Firefox with PGO with GCC 5.1.0-RC-20150412, compiled with "--enable-languages=c,c++  --disable-nls --disable-gnu-unique-object --enable-__cxa_atexit --with-arch-32=pentiumpro".

As it happened on Mozilla automation, though, I don't have more than the build logs, unfortunately. This happened building a x86 (32-bits) Firefox on a x86-64 host with a x86-64 toolchain.

00:57:02     INFO -  In file included from /builds/slave/try-lx-00000000000000000000000/build/src/obj-firefox/js/src/Unified_cpp_js_src5.cpp:92:0:
00:57:02     INFO -  /builds/slave/try-lx-00000000000000000000000/build/src/js/src/jit/RangeAnalysis.cpp: In member function 'bool js::jit::RangeAnalysis::addBetaNodes()':
00:57:02     INFO -  /builds/slave/try-lx-00000000000000000000000/build/src/js/src/jit/RangeAnalysis.cpp:294:1: internal compiler error: in patch_jump_insn, at cfgrtl.c:1296
00:57:02     INFO -   }
00:57:02     INFO -   ^
00:57:02     INFO -  0x7c6943 patch_jump_insn
00:57:02     INFO -  	../../gcc-5.1.0-RC-20150412/gcc/cfgrtl.c:1296
00:57:02     INFO -  0x7c6d6b redirect_branch_edge
00:57:02     INFO -  	../../gcc-5.1.0-RC-20150412/gcc/cfgrtl.c:1329
00:57:02     INFO -  0x7c72f2 rtl_redirect_edge_and_branch
00:57:02     INFO -  	../../gcc-5.1.0-RC-20150412/gcc/cfgrtl.c:1462
00:57:02     INFO -  0x7b94c9 redirect_edge_and_branch(edge_def*, basic_block_def*)
00:57:02     INFO -  	../../gcc-5.1.0-RC-20150412/gcc/cfghooks.c:376
00:57:02     INFO -  0x7c6b8a rtl_split_edge
00:57:02     INFO -  	../../gcc-5.1.0-RC-20150412/gcc/cfgrtl.c:1960
00:57:02     INFO -  0x7b9acb split_edge(edge_def*)
00:57:02     INFO -  	../../gcc-5.1.0-RC-20150412/gcc/cfghooks.c:635
00:57:02     INFO -  0x7c8304 commit_one_edge_insertion(edge_def*)
00:57:02     INFO -  	../../gcc-5.1.0-RC-20150412/gcc/cfgrtl.c:2075
00:57:02     INFO -  0x7c8569 commit_edge_insertions()
00:57:02     INFO -  	../../gcc-5.1.0-RC-20150412/gcc/cfgrtl.c:2142
00:57:02     INFO -  0xa51380 convert_regs
00:57:02     INFO -  	../../gcc-5.1.0-RC-20150412/gcc/reg-stack.c:3175
00:57:02     INFO -  0xa51380 reg_to_stack
00:57:02     INFO -  	../../gcc-5.1.0-RC-20150412/gcc/reg-stack.c:3283
00:57:02     INFO -  0xa51380 rest_of_handle_stack_regs
00:57:02     INFO -  	../../gcc-5.1.0-RC-20150412/gcc/reg-stack.c:3338
00:57:02     INFO -  0xa51380 execute
00:57:02     INFO -  	../../gcc-5.1.0-RC-20150412/gcc/reg-stack.c:3369

Please tell me if you need the input files or if the backtrace is enough.
Comment 1 Richard Biener 2015-04-14 08:25:20 UTC
Please attach preprocessed source.
Comment 2 Jakub Jelinek 2015-04-14 09:22:52 UTC
Well, for PGO not just the preprocessed source, but also the *.gcda file.
Comment 3 Mike Hommey 2015-04-14 09:24:51 UTC
Created attachment 35309 [details]
Unified_cpp_js_src5.i

The full compile command line is:
g++ -m32 -march=pentiumpro -o Unified_cpp_js_src5.o -c  -I../../dist/system_wrappers -include /builds/slave/try-lx-00000000000000000000000/build/src/config/gcc_hidden.h -DFFI_BUILDING -DENABLE_BINARYDATA -DENABLE_SHARED_ARRAY_BUFFER -DEXPORT_JS_API -DJS_HAS_CTYPES -DDLL_PREFIX='"lib"' -DDLL_SUFFIX='".so"' -DMOZ_GLUE_IN_PROGRAM -DAB_CD= -DNO_NSPR_10_SUPPORT -I/builds/slave/try-lx-00000000000000000000000/build/src/js/src -I. -Ictypes/libffi/include -I/builds/slave/try-lx-00000000000000000000000/build/src/intl/icu/source/common -I/builds/slave/try-lx-00000000000000000000000/build/src/intl/icu/source/i18n -I../../dist/include   -I/builds/slave/try-lx-00000000000000000000000/build/src/obj-firefox/dist/include/nspr        -fPIC   -DMOZILLA_CLIENT -include ../../js/src/js-confdefs.h -MD -MP -MF .deps/Unified_cpp_js_src5.o.pp  -Wall -Wsign-compare -Wtype-limits -Werror=char-subscripts -Werror=comment -Werror=endif-labels -Werror=ignored-qualifiers -Werror=int-to-pointer-cast -Werror=missing-braces -Werror=overloaded-virtual -Werror=parentheses -Werror=pointer-arith -Werror=reorder -Werror=return-type -Werror=sequence-point -Werror=switch -Werror=trigraphs -Werror=unknown-pragmas -Werror=unused-label -Werror=unused-value -Werror=write-strings -Werror=conversion-null -Wno-invalid-offsetof -Wcast-align -Wno-error=uninitialized -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -std=gnu++0x -pthread -pipe  -DNDEBUG -DTRIMMED -g -fprofile-use -fprofile-correction -Wcoverage-mismatch -O3 -fno-omit-frame-pointer  -Werror     /builds/slave/try-lx-00000000000000000000000/build/src/obj-firefox/js/src/Unified_cpp_js_src5.cpp

... and it doesn't happen without the profile data. I'm trying to get that.
Comment 4 Mike Hommey 2015-04-14 09:39:19 UTC
Created attachment 35310 [details]
Unified_cpp_js_src5.gcda
Comment 5 Mike Hommey 2015-04-14 09:53:36 UTC
I can reproduce with:

g++ -m32 -march=pentiumpro -o Unified_cpp_js_src5.o -c -fPIC -Wno-invalid-offsetof -fno-exceptions -std=gnu++0x -fprofile-use -fprofile-correction -O3 -fno-omit-frame-pointer Unified_cpp_js_src5.i

It doesn't happen when removing -fno-omit-frame-pointer.
Comment 6 Mike Hommey 2015-04-14 09:55:43 UTC
It also doesn't happen at -O2.
Comment 7 Jakub Jelinek 2015-04-14 10:12:07 UTC
Reproduced.
Comment 8 Jakub Jelinek 2015-04-14 10:59:36 UTC
Latent before r221868.  The bug is in incorrectly inserting a new basic block between a tablejump and the associated jump table.
Comment 9 Jakub Jelinek 2015-04-14 11:01:10 UTC
Created attachment 35311 [details]
gcc5-pr65761.patch

Untested fix.
Comment 10 Jakub Jelinek 2015-04-14 13:25:24 UTC
Author: jakub
Date: Tue Apr 14 13:24:53 2015
New Revision: 222090

URL: https://gcc.gnu.org/viewcvs?rev=222090&root=gcc&view=rev
Log:
	PR rtl-optimization/65761
	* cfgrtl.c (rtl_split_edge): For EDGE_CROSSING split, use
	get_last_bb_insn (after) instead of NEXT_INSN (BB_END (after)).

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cfgrtl.c
Comment 11 Jakub Jelinek 2015-04-14 13:26:06 UTC
Author: jakub
Date: Tue Apr 14 13:25:34 2015
New Revision: 222091

URL: https://gcc.gnu.org/viewcvs?rev=222091&root=gcc&view=rev
Log:
	PR rtl-optimization/65761
	* cfgrtl.c (rtl_split_edge): For EDGE_CROSSING split, use
	get_last_bb_insn (after) instead of NEXT_INSN (BB_END (after)).

Modified:
    branches/gcc-5-branch/gcc/ChangeLog
    branches/gcc-5-branch/gcc/cfgrtl.c
Comment 12 Jakub Jelinek 2015-04-14 13:27:43 UTC
Fixed for 5.1+.