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.
Please attach preprocessed source.
Well, for PGO not just the preprocessed source, but also the *.gcda file.
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.
Created attachment 35310 [details] Unified_cpp_js_src5.gcda
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.
It also doesn't happen at -O2.
Reproduced.
Latent before r221868. The bug is in incorrectly inserting a new basic block between a tablejump and the associated jump table.
Created attachment 35311 [details] gcc5-pr65761.patch Untested fix.
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
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
Fixed for 5.1+.