https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55212
--- Comment #115 from Oleg Endo <olegendo at gcc dot gnu.org> --- It seems that it's already enough to set the cost for I08 from 0 to 1: Index: gcc/config/sh/sh.c =================================================================== --- gcc/config/sh/sh.c (revision 227958) +++ gcc/config/sh/sh.c (working copy) @@ -3574,7 +3574,7 @@ return true; } if (CONST_OK_FOR_I08 (INTVAL (x))) - *total = 0; + *total = 1; else if ((outer_code == AND || outer_code == IOR || outer_code == XOR) && CONST_OK_FOR_K08 (INTVAL (x))) *total = 1; This will reduce the rematerializations and thus increase reg live ranges in other places. attachment 36363 and attachment 36364 are CSiBE comparistions with and without LRA. Without LRA: sum: 3347407 -> 3345667 -1740 / -0.051981 % With LRA: sum: 3348933 -> 3347433 -1500 / -0.044790 % Although there are quite some increases, overall it seems beneficial...