The following fixes an oversight(?) in ix86_loop_unroll_adjust which will happily bump unrolling to unreasonable amounts for bdverN.
Bootstrap / regtest running on x86_64-unknown-linux-gnu, ok? Thanks, Richard. 2018-02-05 Richard Biener <rguent...@suse.de> * config/i386/i386.c (print_reg): Fix typo. (ix86_loop_unroll_adjust): Do not unroll beyond the original nunroll. Index: gcc/config/i386/i386.c =================================================================== --- gcc/config/i386/i386.c (revision 257382) +++ gcc/config/i386/i386.c (working copy) @@ -17946,7 +17946,7 @@ print_reg (rtx x, int code, FILE *file) F,f -- likewise, but for floating-point. O -- if HAVE_AS_IX86_CMOV_SUN_SYNTAX, expand to "w.", "l." or "q.", otherwise nothing - R -- print embeded rounding and sae. + R -- print embedded rounding and sae. r -- print only sae. z -- print the opcode suffix for the size of the current operand. Z -- likewise, with special suffixes for x87 instructions. @@ -50560,7 +50560,7 @@ ix86_loop_unroll_adjust (unsigned nunrol free (bbs); if (mem_count && mem_count <=32) - return 32/mem_count; + return MIN (nunroll, 32 / mem_count); return nunroll; }