Hi,

Fix internal compiler error when using -fprofile-partial-training with
AutoFDO by skipping annotation of basic blocks with zero counts to avoid
profile incompatibilities.

The ICE manifests as:
  gcc/optabs.cc: In function 'int shift_amt_for_vec_perm_mask()':
  gcc/optabs.cc:7863:1: internal compiler error: in to_sreal_scale, at 
profile-count.cc:352
  0x3d91ad3 internal_error(char const*, ...)
        ../../gcc/gcc/diagnostic-global-context.cc:786
  0x3da0e07 fancy_abort(char const*, int, char const*)
        ../../gcc/gcc/diagnostics/context.cc:1787
  0x1e8e5d7 profile_count::to_sreal_scale(profile_count, bool*) const
        ../../gcc/gcc/profile-count.cc:352
  0x1bceb43 analyze_function_body
        ../../gcc/gcc/ipa-fnsummary.cc:2941
  0x1bd0c23 compute_fn_summary(cgraph_node*, bool)
        ../../gcc/gcc/ipa-fnsummary.cc:3491

This occurs during IPA analysis when basic blocks have incompatible profile
qualities  due to forced zero annotations during
partial training, causing to_sreal_scale to fail when computing relative
scaling factors.

Thanks,
Kugan



Attachment: 0001-AutoFDO-Skip-zero-BB-annotation-for-partial-training.patch
Description: 0001-AutoFDO-Skip-zero-BB-annotation-for-partial-training.patch

Reply via email to