public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/104457] New: ipa-cp with autofdo: internal compiler error in update_specialized_profile, at ipa-cp.c:4422
@ 2022-02-09  8:49 yancheng.li at foxmail dot com
  2022-02-09 10:08 ` [Bug ipa/104457] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: yancheng.li at foxmail dot com @ 2022-02-09  8:49 UTC (permalink / raw)
  To: gcc-bugs

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

            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=/bin/gcc
COLLECT_LTO_WRAPPER=/libexec/gcc/aarch64-linux-gnu/10.3.0/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../gcc/configure --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu
--enable-languages=c,c++,objc,obj-c++,fortran,lto --enable-plugin
--enable-initfini-array --disable-libgcj --without-isl --without-cloog
--enable-gnu-indirect-function --build=aarch64-linux-gnu
--with-stage1-ldflags=' -Wl,-z,relro,-z,now' --with-boot-ldflags='
-Wl,-z,relro,-z,now' --with-multilib-list=lp64
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,reproduce it as
following:

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=$SPEC/output/benchspec/CPU/557.xz_r/exe/xz_r_base
--profile=pmu.data --gcov=502.gcov -gcov_version=1 -use_lbr=0

Step 3: reproduce

SPECCPU2017 502 optimization flag: -O2 -g -fauto-profile=502.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<tree_node*>
        ../../gcc/gcc/ipa-cp.c:5347
0x1337583 decide_about_value<tree_node*>
        ../../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 <https://gcc.gnu.org/bugs/> for instructions.
*******************************************************************************
Thinking:
In gcc/ipa.cp:4361
orig_node_count = (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?

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

* [Bug ipa/104457] ipa-cp with autofdo: internal compiler error in update_specialized_profile, at ipa-cp.c:4422
  2022-02-09  8:49 [Bug ipa/104457] New: ipa-cp with autofdo: internal compiler error in update_specialized_profile, at ipa-cp.c:4422 yancheng.li at foxmail dot com
@ 2022-02-09 10:08 ` rguenth at gcc dot gnu.org
  2022-02-09 18:45 ` jamborm at gcc dot gnu.org
  2022-02-24 10:51 ` marxin at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-02-09 10:08 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jamborm at gcc dot gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Can you try a newer GCC?  I do think a gcc_assert () is a bit on the hard side
though - we should be able to safely demote it to gcc_checking_assert ()?

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

* [Bug ipa/104457] ipa-cp with autofdo: internal compiler error in update_specialized_profile, at ipa-cp.c:4422
  2022-02-09  8:49 [Bug ipa/104457] New: ipa-cp with autofdo: internal compiler error in update_specialized_profile, at ipa-cp.c:4422 yancheng.li at foxmail dot com
  2022-02-09 10:08 ` [Bug ipa/104457] " rguenth at gcc dot gnu.org
@ 2022-02-09 18:45 ` jamborm at gcc dot gnu.org
  2022-02-24 10:51 ` marxin at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jamborm at gcc dot gnu.org @ 2022-02-09 18:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Martin Jambor <jamborm at gcc dot gnu.org> ---
I have made some substantial changes to how profile_counts are updated in
IPA-CP, so trying the current master is definitely a good idea.  It might just
work and even if it does not, fixing it there would probably be quite a bit
easier.

If it persists even on master, please attach the dump generated by
-fdump-ipa-cp-details - I would have a look by one generated by GCC 10 too but
much less enthusiastically ;-)

I would be fine demoting the assert to gcc_checking_assert.

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

* [Bug ipa/104457] ipa-cp with autofdo: internal compiler error in update_specialized_profile, at ipa-cp.c:4422
  2022-02-09  8:49 [Bug ipa/104457] New: ipa-cp with autofdo: internal compiler error in update_specialized_profile, at ipa-cp.c:4422 yancheng.li at foxmail dot com
  2022-02-09 10:08 ` [Bug ipa/104457] " rguenth at gcc dot gnu.org
  2022-02-09 18:45 ` jamborm at gcc dot gnu.org
@ 2022-02-24 10:51 ` marxin at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-02-24 10:51 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-02-24

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

end of thread, other threads:[~2022-02-24 10:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-09  8:49 [Bug ipa/104457] New: ipa-cp with autofdo: internal compiler error in update_specialized_profile, at ipa-cp.c:4422 yancheng.li at foxmail dot com
2022-02-09 10:08 ` [Bug ipa/104457] " rguenth at gcc dot gnu.org
2022-02-09 18:45 ` jamborm at gcc dot gnu.org
2022-02-24 10:51 ` marxin at gcc dot gnu.org

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).