From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A312E3851C09; Sun, 28 Jun 2020 15:59:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A312E3851C09 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1593359963; bh=tXteltwjkuaIdOeXbg8asqDVH6+ayGwGJ1dPgqxhh8w=; h=From:To:Subject:Date:From; b=gltL4D2+99rxW1qvuLkJ4msoPZ4Iqovp8BH6d4Z7SCV1G6ySavwdcsIdzoOOQCnZi aDn3wI3GMRhMWQ1PudOB70Z1nVQ7jeWHSnErXmWWkm9q8kMilEi0oTVvczZEkJNvGK SpWtxFkKgvgcOkh3Jk1cZhWlv9go164NlJ6q53gY= From: "belegdol at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95949] New: mame build succeeds with -O3 but fails with -O2 and all -O3 flags added manually Date: Sun, 28 Jun 2020 15:59:23 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: belegdol at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone cf_gcchost cf_gcctarget Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2020 15:59:23 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95949 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.=20 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=3Dsrc/mame/drivers/model1.cpp NOWERROR=3D1 OPTIMIZE=3D3 VERBOS= E=3D1 -j12 works, but make SOURCES=3Dsrc/mame/drivers/model1.cpp NOWERROR=3D1 OPTIMIZE=3D2 OPT_FLAGS=3D"-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=3Ddynamic -fversion-loops-for-strides" VERBOSE=3D1 -j12 does not. Linking fails with tons of undefined references. I am going to at= tach 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=3D/mingw64 5. make SOURCES=3Dsrc/mame/drivers/model1.cpp NOWERROR=3D1 OPTIMIZE=3D2 OPT_FLAGS=3D"-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=3Ddynamic -fversion-loops-for-strides" VERBOSE=3D1 -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-m= sys2-installation=