From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CA8483858C2C; Tue, 4 Jan 2022 22:30:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA8483858C2C From: "slyfox at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/103910] New: openjdk17 causes ICE on -O3 -march=opteron -fchecking-new: during GIMPLE pass: aprefetch: in gimple_build_call, at gimple.c:267 Date: Tue, 04 Jan 2022 22:30:56 +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: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: slyfox at gcc dot gnu.org 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_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: Tue, 04 Jan 2022 22:30:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103910 Bug ID: 103910 Summary: openjdk17 causes ICE on -O3 -march=3Dopteron -fchecking-new: during GIMPLE pass: aprefetch: in gimple_build_call, at gimple.c:267 Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: slyfox at gcc dot gnu.org Target Milestone: --- Target: x86_64-pc-linux-gnu ICE initially noticed by Alexander Weber in https://bugs.gentoo.org/822690. Here is the reduced test, fails on both gcc-12 and gcc-11.2.0. Note: it nee= ds a gch header. //$ cat archiveBuilder.cpp #include "precompiled.hpp" void *operator new(unsigned long, void *__p) { return __p; } #define MEMORY_TYPES_DO(f) f(mtNone, ) enum MEMFLAGS {}; #define MEMORY_TYPE_SHORTNAME(type, human_readable) MEMFLAGS type; MEMORY_TYPES_DO(MEMORY_TYPE_SHORTNAME) struct GrowableArrayView { GrowableArrayView(int *, int, int); }; int *GrowableArrayWithAllocator_data; struct GrowableArrayWithAllocator : GrowableArrayView { GrowableArrayWithAllocator(int initial_max) : GrowableArrayView(GrowableArrayWithAllocator_data, initial_max, 0) { for (int i =3D 0; i < initial_max; i++) new (&GrowableArrayWithAllocator_data[i]) int(); } }; struct GrowableArrayMetadata { GrowableArrayMetadata(MEMFLAGS); }; struct GrowableArray : GrowableArrayWithAllocator { GrowableArrayMetadata _metadata; GrowableArray(int initial_max) : GrowableArrayWithAllocator(initial_max), _metadata(mtNone) {} }; struct SourceObjList { SourceObjList(); }; SourceObjList::SourceObjList() { GrowableArray(128 * 1024); } $ rm -rf ph $ mkdir -p ph $ touch precompiled_.hpp # create empty file $ ./xg++ -B. -O3 -march=3Dopteron -fcheck-new -c precompiled_.hpp -o ph/precompiled.hpp.gch $ ./xg++ -B. -O3 -march=3Dopteron -fcheck-new -Iph -c archiveBuilder.cpp -o= a.o during GIMPLE pass: aprefetch archiveBuilder.cpp: In constructor =E2=80=98SourceObjList::SourceObjList()= =E2=80=99: archiveBuilder.cpp:28:1: internal compiler error: in gimple_build_call, at gimple.c:267 28 | SourceObjList::SourceObjList() { GrowableArray(128 * 1024); } | ^~~~~~~~~~~~~ 0xd2845f gimple_build_call(tree_node*, unsigned int, ...) gcc/gimple.c:267 0x12880c8 emit_mfence_after_loop gcc/tree-ssa-loop-prefetch.c:1300 0x12880c8 mark_nontemporal_stores gcc/tree-ssa-loop-prefetch.c:1359 0x12880c8 loop_prefetch_arrays gcc/tree-ssa-loop-prefetch.c:1955 0x12880c8 tree_ssa_prefetch_arrays() gcc/tree-ssa-loop-prefetch.c:2031 0x1288be9 execute gcc/tree-ssa-loop-prefetch.c:2097 $ ./xg++ -v Using built-in specs. COLLECT_GCC=3D./xg++ Target: x86_64-pc-linux-gnu Configured with: ../configure --disable-multilib --disable-bootstrap --with-native-system-header-dir=3D<>-glibc-2.33-59-dev/include --prefix=3D/home/slyfox/dev/git/gcc-build/__td__ CFLAGS=3D'-O1 -ggdb3' CXXFLAGS=3D'-O1 -ggdb3' LDFLAGS=3D'-O1 -ggdb3' Thread model: posix Supported LTO compression algorithms: zlib gcc version 12.0.0 20220104 (experimental) (GCC)=