Bug 1727979 - gcc fails with "internal compiler error" on second arches
Summary: gcc fails with "internal compiler error" on second arches
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Developer Toolset
Classification: Red Hat
Component: gcc
Version: DTS 8.1 RHEL 7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: alpha
: 9.0
Assignee: Marek Polacek
QA Contact: Alexandra Petlanová Hájková
URL:
Whiteboard:
: 1724945 (view as bug list)
Depends On:
Blocks: 1724939 1730724
TreeView+ depends on / blocked
 
Reported: 2019-07-08 17:26 UTC by Martin Stransky
Modified: 2019-12-10 07:49 UTC (History)
9 users (show)

Fixed In Version: devtoolset-9-gcc-9.1.1-1.1.el7
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 1730724 1753965 (view as bug list)
Environment:
Last Closed: 2019-12-10 07:49:25 UTC
Target Upstream Version:


Attachments (Terms of Use)
/tmp/ccABE18v.out file (253.83 KB, text/x-csrc)
2019-07-08 17:26 UTC, Martin Stransky
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 78643 0 None None None 2019-08-05 07:36:07 UTC
GNU Compiler Collection 83623 0 None None None 2019-08-05 07:36:07 UTC
GNU Compiler Collection 90139 0 None None None 2019-08-05 07:36:07 UTC
GNU Compiler Collection 90756 0 None None None 2019-08-05 07:36:07 UTC
Red Hat Product Errata RHEA-2019:4134 0 None None None 2019-12-10 07:49:45 UTC

Description Martin Stransky 2019-07-08 17:26:06 UTC
Created attachment 1588456 [details]
/tmp/ccABE18v.out file

Description of problem:
g++ fails with internal compiler error. This affects s390x/aarch64 on rhel7. I didn't test ppc64(le). Intel builds are fine.

Error:

/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h: In function ‘void baseline::exec_ops(const Op*, const void**, const char*, char*, int)’:
/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h:640:13: internal compiler error: in convert_move, at expr.c:218
 static void exec_ops(const Op* ops, const void** args,
             ^~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccABE18v.out file, please attach this to your bugreport.

Used compiler:

[stransky@devel1 ~]$ /opt/rh/devtoolset-8/root/usr/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/opt/rh/devtoolset-8/root/usr/bin/g++
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-8/root/usr/libexec/gcc/s390x-redhat-linux/8/lto-wrapper
Target: s390x-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-8/root/usr --mandir=/opt/rh/devtoolset-8/root/usr/share/man --infodir=/opt/rh/devtoolset-8/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --with-default-libstdcxx-abi=gcc4-compatible --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-8.3.1-20190311/obj-s390x-redhat-linux/isl-install --disable-libmpx --enable-gnu-indirect-function --with-long-double-128 --with-arch=z196 --with-tune=zEC12 --enable-decimal-float --build=s390x-redhat-linux
Thread model: posix
gcc version 8.3.1 20190311 (Red Hat 8.3.1-3) (GCC) 


Command used to build it:

[stransky@devel1 skia]$ /opt/rh/devtoolset-8/root/usr/bin/g++ -o skcms.o -c  -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/objdir/dist/stl_wrappers -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/objdir/dist/system_wrappers -include /home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/config/gcc_hidden.h -DNDEBUG=1 -DTRIMMED=1 -DSKIA_IMPLEMENTATION=1 -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/objdir/gfx/skia -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/include/c -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/include/codec -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/include/config -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/include/core -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/include/docs -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/include/effects -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/include/encode -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/include/gpu -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/include/pathops -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/include/ports -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/include/private -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/include/utils -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/include/utils/mac -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/src/codec -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/src/core -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/src/image -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/src/lazy -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/src/opts -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/src/sfnt -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/src/shaders -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/src/shaders/gradients -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/src/sksl -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/src/utils -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/src/utils/mac -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/src/utils/win -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/objdir/dist/include -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/objdir/dist/include/nspr -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/objdir/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/objdir/mozilla-config.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wall -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wc++1z-compat -Wduplicated-cond -Wimplicit-fallthrough -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wno-error=multistatement-macros -Wno-error=class-memaccess -Wformat -Wformat-overflow=2 -fno-sized-deallocation -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -march=z196 -mtune=zEC12 -Wformat-security -Wformat -Werror=format-security -fPIC -Wl,-z,relro -Wl,-z,now -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -g -freorder-blocks -O2 -fomit-frame-pointer -funwind-tables -Wno-deprecated-declarations -Wno-overloaded-virtual -Wno-shadow -Wno-sign-compare -Wno-unreachable-code -Wno-unused-function -Wno-logical-op -Wno-maybe-uninitialized -I/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/objdir/dist/include/cairo -I/usr/include/freetype2 -I/usr/include/freetype2 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng15 -I/usr/include/libdrm  -MD -MP -MF .deps/skcms.o.pp  -O3 /home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc

Comment 2 Martin Stransky 2019-07-11 14:36:44 UTC
*** Bug 1724945 has been marked as a duplicate of this bug. ***

Comment 3 Martin Stransky 2019-07-11 14:37:52 UTC
Is there any workaround for it?

Comment 4 Marek Polacek 2019-07-11 15:22:28 UTC
This is actually a problem with devtoolset-8-gcc, not the system rhel7 gcc.

Comment 6 Marek Polacek 2019-07-12 19:05:28 UTC
(In reply to Martin Stransky from comment #3)
> Is there any workaround for it?

I don't know of a workaround, because it ICEs with -O0 too, sorry :/.

I'm bisecting what fixed this.

Comment 7 Jakub Jelinek 2019-07-12 19:11:29 UTC
See the above two PRs, that is most likely it.
There is a workaround, avoid using generic vectors with sizes not supported by corresponding ISAs, it will not be more efficient than using scalar ops anyway.

Comment 8 Marek Polacek 2019-07-12 19:48:36 UTC
It's actually fixed by r256051 aka PR83623.

Comment 9 Marek Polacek 2019-07-12 19:54:45 UTC
(In reply to Marek Polacek from comment #8)
> It's actually fixed by r256051 aka PR83623.

But that's already fixed for devtoolset-8-gcc...

Comment 10 Marek Polacek 2019-07-12 20:25:30 UTC
(In reply to Marek Polacek from comment #9)
> (In reply to Marek Polacek from comment #8)
> > It's actually fixed by r256051 aka PR83623.
> 
> But that's already fixed for devtoolset-8-gcc...

Because the bug report says this also fails on aarch64, I bisected on aarch64.  But it compiles fine with DTS 8 gcc on aarch64:

# g++ --version
g++ (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# g++ -c ff.ii -w
# echo $?
0

Comment 11 Marek Polacek 2019-07-12 20:43:56 UTC
Since I can't easily bisect s390x, I'll build two scratch builds, one with the 90139 fix, and another with the 90756 fix; hopefully one of them will compile the .ii file fine.

Comment 12 Jakub Jelinek 2019-07-13 06:06:12 UTC
I can and have bisected it:
./cc1plus.273035 -quiet -nostdinc -march=z196 -mtune=zEC12 -mzarch -O3 -fPIC rh1727979.ii  -w; echo $?; ./cc1plus.273036 -quiet -nostdinc -march=z196 -mtune=zEC12 -mzarch -O3 -fPIC rh1727979.ii  -w; echo $?
during RTL pass: expand
In file included from /home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/third_party/skcms/skcms.cc:1859:
/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h: In function ‘void baseline::exec_ops(const Op*, const void**, const char*, char*, int)’:
/home/nfs/stransky/rpmbuild/BUILD/firefox-68.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h:640:13: internal compiler error: in convert_move, at expr.c:218
0xe15c59 convert_move(rtx_def*, rtx_def*, int)
	../../gcc/expr.c:218
0xe18ede convert_modes(machine_mode, machine_mode, rtx_def*, int)
	../../gcc/expr.c:712
0xe184fa convert_to_mode(machine_mode, rtx_def*, int)
	../../gcc/expr.c:637
0x13be64f emit_partition_copy
	../../gcc/tree-outof-ssa.c:222
0x13bef58 insert_part_to_rtx_on_edge
	../../gcc/tree-outof-ssa.c:391
0x13bf9d0 elim_create
	../../gcc/tree-outof-ssa.c:679
0x13bfccb eliminate_phi
	../../gcc/tree-outof-ssa.c:737
0x13c06ad expand_phi_nodes(ssaexpand*)
	../../gcc/tree-outof-ssa.c:990
0xca8eb3 execute
	../../gcc/cfgexpand.c:6507
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
4
0

So it is PR90756 and that one depends on PR90139.

Comment 13 Marek Polacek 2019-07-13 13:36:05 UTC
Thanks!  How about backporting them to upstream gcc-8-branch?  (And gcc- 9 I suppose.)

Comment 14 Marek Polacek 2019-07-16 14:40:40 UTC
The PR90756 fix needs to be added to DTS 9.

Comment 15 Marek Polacek 2019-07-16 20:15:46 UTC
PR90756 fix committed to devtoolset-9.0-rhel-7.

Comment 16 Marek Polacek 2019-07-16 20:19:14 UTC
Proposing 8.1.z.

Comment 24 errata-xmlrpc 2019-12-10 07:49:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2019:4134


Note You need to log in before you can comment on or make changes to this bug.