https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70461
Vladimir Makarov <vmakarov at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vmakarov at gcc dot gnu.org --- Comment #1 from Vladimir Makarov <vmakarov at gcc dot gnu.org> --- (In reply to Alexander Fomin from comment #0) > Created attachment 38134 [details] > A reproducer > > When trying to compile the attached reproducer with -m32 -O2 -march=core-avx2 > we generate 12 extra instructions (namely spills & fills) for the hot loop > since r234527. Thank you for finding this out. I am confirming that the revision resulted in the code worsening. The problem is in using a wrong cost (65535) in saving calculations. Such cost is for AREG in DImode. This cost is defined when the class (AREG) has not enough registers to hold a value in given mode (DImode). I hope the patch will be ready today or tomorrow.