From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4038C3858D39; Wed, 9 Feb 2022 08:49:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4038C3858D39 From: "yancheng.li at foxmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/104457] New: ipa-cp with autofdo: internal compiler error in update_specialized_profile, at ipa-cp.c:4422 Date: Wed, 09 Feb 2022 08:49:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 10.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: yancheng.li at foxmail 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 cc target_milestone 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: Wed, 09 Feb 2022 08:49:29 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104457 Bug ID: 104457 Summary: ipa-cp with autofdo: internal compiler error in update_specialized_profile, at ipa-cp.c:4422 Product: gcc Version: 10.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: yancheng.li at foxmail dot com CC: marxin at gcc dot gnu.org Target Milestone: --- ***************************************************************************= **** OS and Platform: openEuler 20.03 LTS SP2, AARCH64 ***************************************************************************= **** GCC version: # gcc -v Using built-in specs. COLLECT_GCC=3D/bin/gcc COLLECT_LTO_WRAPPER=3D/libexec/gcc/aarch64-linux-gnu/10.3.0/lto-wrapper Target: aarch64-linux-gnu Configured with: ../gcc/configure --enable-shared --enable-threads=3Dposix --enable-checking=3Drelease --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=3Dgnu --enable-languages=3Dc,c++,objc,obj-c++,fortran,lto --enable-plugin --enable-initfini-array --disable-libgcj --without-isl --without-cloog --enable-gnu-indirect-function --build=3Daarch64-linux-gnu --with-stage1-ldflags=3D' -Wl,-z,relro,-z,now' --with-boot-ldflags=3D' -Wl,-z,relro,-z,now' --with-multilib-list=3Dlp64 Thread model: posix Supported LTO compression algorithms: zlib gcc version 10.3.0 (GCC) ***************************************************************************= **** Reproduce: This ICE occurs when using AutoFDO to optimize SPECCPU2017 502=EF=BC=8Crepr= oduce it as following=EF=BC=9A SPECCPU2017 502 optimization flag: -O2 -g Step 1: perf # runcpu -a run --rebuild 502 -n 1 # perf record -e inst_retired:up -o pmu.data -- runcpu -a run --nobuild 502= -n 1 Step 2: collect profile # create_gcov --binary=3D$SPEC/output/benchspec/CPU/557.xz_r/exe/xz_r_base --profile=3Dpmu.data --gcov=3D502.gcov -gcov_version=3D1 -use_lbr=3D0 Step 3: reproduce SPECCPU2017 502 optimization flag: -O2 -g -fauto-profile=3D502.gcov # runcpu -a run --rebuild 502 -n 1 ***************************************************************************= **** c-parser.c:8724: internal compiler error: in update_specialized_profile, at ipa-cp.c:4422 0x132d657 update_specialized_profile ../../gcc/gcc/ipa-cp.c:4422 0x1337583 perhaps_add_new_callers ../../gcc/gcc/ipa-cp.c:5347 0x1337583 decide_about_value ../../gcc/gcc/ipa-cp.c:5454 0x1338e4f decide_whether_version_node ../../gcc/gcc/ipa-cp.c:5550 0x1338e4f ipcp_decision_stage ../../gcc/gcc/ipa-cp.c:5732 0x1338e4f ipcp_driver ../../gcc/gcc/ipa-cp.c:5915 0x1338e4f execute ../../gcc/gcc/ipa-cp.c:5990 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. ***************************************************************************= **** Thinking=EF=BC=9A In gcc/ipa.cp:4361 orig_node_count =3D (orig_sum + new_sum).apply_scale (12, 10); it seems that wrong orig_node_count has processed, but orig_new_node_count = not processed at the same time, this may be the cause of the ICE?=