public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95949] New: mame build succeeds with -O3 but fails with -O2 and all -O3 flags added manually
@ 2020-06-28 15:59 belegdol at gmail dot com
  2020-06-28 16:00 ` [Bug c++/95949] " belegdol at gmail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: belegdol at gmail dot com @ 2020-06-28 15:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95949

            Bug ID: 95949
           Summary: mame build succeeds with -O3 but fails with -O2 and
                    all -O3 flags added manually
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: belegdol at gmail dot com
  Target Milestone: ---
              Host: Windows MSYS2
            Target: x86_64

mame [1] no longer builds with optimisation options below -O3 since revision
22513fb6fe281f5ccb75aaddb6417a12a66c313d. 
I have tried isolating the flag making the build succeed but even with all
flags enabled the linking still fails. In other words

make SOURCES=src/mame/drivers/model1.cpp NOWERROR=1 OPTIMIZE=3 VERBOSE=1 -j12

works, but

make SOURCES=src/mame/drivers/model1.cpp NOWERROR=1 OPTIMIZE=2
OPT_FLAGS="-fgcse-after-reload -fipa-cp-clone -floop-interchange
-floop-unroll-and-jam -fpeel-loops -fpredictive-commoning -fsplit-loops
-fsplit-paths -ftree-loop-distribution -ftree-loop-vectorize -ftree-partial-pre
-ftree-slp-vectorize -funswitch-loops -fvect-cost-model
-fvect-cost-model=dynamic -fversion-loops-for-strides" VERBOSE=1 -j12

does not. Linking fails with tons of undefined references. I am going to attach
the full list.

In order to reproduce the issue:
1. Install msys2
2. set it up for mame compilation as per [2]
3. git clone mame source code
4. export MINGW64=/mingw64
5. make SOURCES=src/mame/drivers/model1.cpp NOWERROR=1 OPTIMIZE=2
OPT_FLAGS="-fgcse-after-reload -fipa-cp-clone -floop-interchange
-floop-unroll-and-jam -fpeel-loops -fpredictive-commoning -fsplit-loops
-fsplit-paths -ftree-loop-distribution -ftree-loop-vectorize -ftree-partial-pre
-ftree-slp-vectorize -funswitch-loops -fvect-cost-model
-fvect-cost-model=dynamic -fversion-loops-for-strides" VERBOSE=1 -j12

I am happy to provide intermediate build objects, please let me know which
ones.

[1] https://github.com/mamedev/mame
[2]
https://docs.mamedev.org/initialsetup/compilingmame.html#using-a-standard-msys2-installation

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-12-17 19:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-28 15:59 [Bug c++/95949] New: mame build succeeds with -O3 but fails with -O2 and all -O3 flags added manually belegdol at gmail dot com
2020-06-28 16:00 ` [Bug c++/95949] " belegdol at gmail dot com
2020-06-28 16:02 ` belegdol at gmail dot com
2020-06-29 10:41 ` rguenth at gcc dot gnu.org
2020-06-29 12:42 ` redi at gcc dot gnu.org
2020-06-29 16:11 ` belegdol at gmail dot com
2020-06-29 17:20 ` redi at gcc dot gnu.org
2020-06-29 17:23 ` redi at gcc dot gnu.org
2020-06-29 17:38 ` belegdol at gmail dot com
2020-06-29 20:17 ` redi at gcc dot gnu.org
2020-07-30 14:21 ` belegdol at gmail dot com
2021-12-17 19:39 ` belegdol at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).