From: Kyrylo Tkachov Date: Tue, 30 Mar 2021 15:42:17 +0000 (+0100) Subject: aarch64: PR target/99820: Guard on available SVE issue info before using X-Git-Tag: basepoints/gcc-12~344 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c277abd9cd3d10db59f9965d7d6356868da42a9f;p=thirdparty%2Fgcc.git aarch64: PR target/99820: Guard on available SVE issue info before using This fixes a simple segfault ICE when using the use_new_vector_costs tunable with a CPU tuning that it wasn't intended for. I'm not adding a testcase here as we intend to remove the tunable for GCC 12 anyway (the new costing logic will remain and will benefit from this extra check, but the -moverride option will no longer exist). gcc/ChangeLog: PR target/99820 * config/aarch64/aarch64.c (aarch64_analyze_loop_vinfo): Check for available issue_info before using it. --- diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index a573850b3fd6..5eda9e80bd0e 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -14460,7 +14460,9 @@ aarch64_analyze_loop_vinfo (loop_vec_info loop_vinfo, /* Record the issue information for any SVE WHILE instructions that the loop needs. */ auto *issue_info = aarch64_tune_params.vec_costs->issue_info; - if (issue_info->sve && !LOOP_VINFO_MASKS (loop_vinfo).is_empty ()) + if (issue_info + && issue_info->sve + && !LOOP_VINFO_MASKS (loop_vinfo).is_empty ()) { unsigned int num_masks = 0; rgroup_controls *rgm;