https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85459
Bug ID: 85459 Summary: [8 Regression] Larger code generated from GMP template meta-programming Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: glisse at gcc dot gnu.org Target Milestone: --- Created attachment 43982 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43982&action=edit preprocessed testcase The attached testcase is a preprocessed version of https://gmplib.org/list-archives/gmp-bugs/2014-January/003331.html, which I was about to commit to GMP. Compiling for x86_64 with g++-7 -O3, I get a nice .s file of size 4174. With g++-8 -O3, I get a much larger size of 7077. Looking more closely at the difference, I see a ton of moves. Besides, g++-8 finds fewer __builtin_constant_p opportunities than g++-7 (__gmpq_mul instead of __gmpq_mul_2exp for instance). The dump I glanced at makes me suspect I?SRA, but I am likely completely off.