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