Bug 110988 - [14 regression] ICE when building 523.xalancbmk_r with pgo and lto
Summary: [14 regression] ICE when building 523.xalancbmk_r with pgo and lto
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 14.0
: P3 normal
Target Milestone: 14.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks: spec
  Show dependency treegraph
 
Reported: 2023-08-11 09:37 UTC by Filip Kastl
Modified: 2023-08-15 13:03 UTC (History)
3 users (show)

See Also:
Host: x86_64-linux
Target: x86_64-linux
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Kastl 2023-08-11 09:37:09 UTC
On x86_64 Zen3-based CPU (and probably others) building 523.xalancbmk_r fails with an ICE in the final build step.

We have bisected this to 2e93b92c1ec5fbbbe10765c6e059c3c90d564245 (Fix profile update after cancelled loop distribution).

The backtrace is

during GIMPLE pass: vect
./xalanc/PlatformSupport/XalanArrayAllocator.hpp: In member function 'createEntry':
./xalanc/PlatformSupport/XalanArrayAllocator.hpp:174:9: internal compiler error: in apply_scale, at profile-count.h:1180
  174 |         createEntry(
      |         ^     
0x97fd4f profile_count::apply_scale(profile_count, profile_count) const 
        ../../gcc/gcc/profile-count.h:1180
0xe921fc fold_loop_internal_call(gimple*, tree_node*)
        ../../gcc/gcc/tree-cfg.cc:7738
0x1124a02 execute
        ../../gcc/gcc/tree-vectorizer.cc:1328
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
make[1]: *** [/tmp/ccHpVuHE.mk:26: /tmp/cc6fS858.ltrans8.ltrans.o] Error 1
make[1]: *** Waiting for unfinished jobs....
Comment 1 GCC Commits 2023-08-14 15:56:06 UTC
The master branch has been updated by Jan Hubicka <hubicka@gcc.gnu.org>:

https://gcc.gnu.org/g:882af290c137dfab5d99b88e6dbecc5e75d85a0b

commit r14-3201-g882af290c137dfab5d99b88e6dbecc5e75d85a0b
Author: Jan Hubicka <jh@suse.cz>
Date:   Mon Aug 14 17:55:33 2023 +0200

    Avoid division by zero in fold_loop_internal_call
    
    My patch to fix profile after folding internal call is missing check for the
    case profile was already zero before if-conversion.
    
    gcc/ChangeLog:
    
            PR gcov-profile/110988
            * tree-cfg.cc (fold_loop_internal_call): Avoid division by zero.
Comment 2 Jan Hubicka 2023-08-15 13:03:30 UTC
Fixed.