The following is causing hog (reduced from imagick SPEC benchmark): $ cat 1.i void ConvertImageCommand(); void MagickCommandGenesis(); void MogrifyImages(); void TracePath(); typedef struct { double x, y; } PointInfo; typedef struct { PointInfo point; } PrimitiveInfo; int TraceBezier_alpha, TraceBezier_i; double TraceBezier_weight; PointInfo *TraceBezier_points; PrimitiveInfo *TraceBezier_primitive_info; void DrawImage() { TracePath(); } void TracePath() { double *coefficients; PointInfo point; long j; for (; TraceBezier_i; TraceBezier_i++) { point.x = point.y = TraceBezier_alpha = 1.0; j = 0; for (; j < 4; j++) { point.x += TraceBezier_alpha * coefficients[j] * TraceBezier_primitive_info->point.x; point.y += TraceBezier_alpha * TraceBezier_primitive_info->point.y; TraceBezier_alpha *= TraceBezier_weight; TraceBezier_primitive_info++; } TraceBezier_points[TraceBezier_i] = point; TraceBezier_weight += 1.0; } } void ConvertMain() { MagickCommandGenesis(ConvertImageCommand); } void ConvertImageCommand() { MogrifyImages(); } void MogrifyImages() { DrawImage(); } int main() { return ConvertMain; } $ gcc 1.i -flto=auto -Ofast -shared -fPIC ... likely never finishes :)
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:b9ec5ebb605936684e95b8dcc12e43ba7d8f2cb4 commit r12-1388-gb9ec5ebb605936684e95b8dcc12e43ba7d8f2cb4 Author: Richard Biener <rguenther@suse.de> Date: Fri Jun 11 13:36:26 2021 +0200 tree-optimization/101028 - fix endless SLP reassoc discovery This fixes a missing clearing of mismatched lanes from the fatal fail path in SLP reassoc discovery in the most conservative way. 2021-06-11 Richard Biener <rguenther@suse.de> PR tree-optimization/101028 * tree-vect-slp.c (vect_build_slp_tree_2): When SLP reassoc discovery fails fatally, mark appropriate lanes in matches[] so. * gcc.dg/pr101028.c: New testcase.
Fixed.
This seems to have caused a compile time hog in SPECCPU 2006's 416.gamess as well which is not fixed by the subsequent commit. I'm attempting to reduce but it's taking a while since each test takes around 8 mins.. Compiling with -mcpu=native -Ofast -fomit-frame-pointer -flto=auto --param ipa-cp-eval-threshold=1 --param ipa-cp-unit-growth=80 -funconstrained-commons -std=legacy -fno-inline-functions-called-once and compile never finishes (have yet to reduce flags)