Bug 2048910

Summary: internal compiler error when building mame on ppc64le with precompiled headers enabled
Product: [Fedora] Fedora Reporter: Julian Sikorski <belegdol>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: aoliva, barndt, belegdol, dmalcolm, extras-qa, fweimer, jakub, jwakely, law, mpolacek, msebor, nickc, sipoyare
Target Milestone: ---   
Target Release: ---   
Hardware: ppc64le   
OS: Unspecified   
Whiteboard:
Fixed In Version: gcc-12.0.1-0.5.fc36 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1541613 Environment:
Last Closed: 2022-02-04 08:02:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1541613, 1649936    
Bug Blocks: 1071880    

Description Julian Sikorski 2022-02-01 07:24:27 UTC
Description of problem:
mame-0.240 fails to build on ppc64le when precompiled headers are enabled.

Version-Release number of selected component (if applicable):
0.240-1.fc36

How reproducible:
always

Steps to Reproduce:
1. fedpkg clone mame
2. cd mame
3. remove or comment out lines 227 to 231 in the spec file
4. attempt a build

Actual results:
build fails with the following error:

*** WARNING *** there are active plugins, do not report this as a bug unless you can reproduce it without enabling any plugins.
Event                            | Plugins
PLUGIN_FINISH_UNIT               | annobin: Generate final annotations
PLUGIN_START_UNIT                | annobin: Generate global annotations
PLUGIN_ALL_PASSES_START          | annobin: Generate per-function annotations
PLUGIN_ALL_PASSES_END            | annobin: Register per-function end symbols
In file included from ../../../../../src/emu/video/rgbutil.h:24,
                 from ../../../../../src/mame/drivers/rollext.cpp:123:
../../../../../src/emu/video/rgbvmx.h: In member function 'void rgbaint_t::set(u32)':
../../../../../src/emu/video/rgbvmx.h:49:62: internal compiler error: Segmentation fault
   49 |                 m_value = VECS32(vec_mergeh(VECS16(vec_mergeh(temp, VECS8(zero))), VECS16(zero)));
      |                                                              ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
make[2]: *** [gaelco.make:586: ../../../../linux_gcc/obj/x64/Release/src/mame/drivers/rollext.o] Error 1

Full log: https://kojipkgs.fedoraproject.org//work/tasks/19/82140019/build.log

with annobin disabled the error is there as well:

In file included from ../../../../../src/emu/video/rgbutil.h:24,
                 from ../../../../../src/emu/rendersw.hxx:14,
                 from ../../../../../src/emu/video.cpp:16:
../../../../../src/emu/video/rgbvmx.h: In member function 'void rgbaint_t::set(u32)':
../../../../../src/emu/video/rgbvmx.h:49:62: internal compiler error: in fold_convert_loc, at fold-const.cc:2450
   49 |                 m_value = VECS32(vec_mergeh(VECS16(vec_mergeh(temp, VECS8(zero))), VECS16(zero)));
      |                                                              ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
                                                                             ~~~~~~^~~~~
make[2]: *** [casio.make:362: ../../../../linux_gcc/obj/x64/Release/src/mame/drivers/fp200.o] Error 1
make[1]: *** [Makefile:463: casio] Error 2

Expected results:
Build completes successfully. As per comment from Jakub Jelinek on bug #1541613:

Seems to be PCH related, looks like rs6000_builtin_info[?].fntype contains random garbage.
When PCH is disabled, compiles just fine.
Will try to reproduce tomorrow on a simpler testcase.

I tried to get preprocessed source with -save-temps, but with header precompilation enabled, the build fails with gcc complaining about the PCH being created and used with different settings of %<-fpic%>.

Comment 1 Jakub Jelinek 2022-02-04 08:02:58 UTC
Should be fixed now.