The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80017
The patch was successfully bootstrapped and tested on x86-64, ppc64, and aarch64.
Committed as rev. 246181.
Index: ChangeLog =================================================================== --- ChangeLog (revision 246180) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2017-03-15 Vladimir Makarov <vmaka...@redhat.com> + + PR target/80017 + * lra-constraints.c (process_alt_operands): Increase reject for + reloading an input/output operand. + 2017-03-15 Michael Meissner <meiss...@linux.vnet.ibm.com> PR target/79038 Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 246180) +++ lra-constraints.c (working copy) @@ -2713,6 +2713,15 @@ process_alt_operands (int only_alternati if (MEM_P (op) && offmemok) addr_losers++; + else if (curr_static_id->operand[nop].type == OP_INOUT) + { + if (lra_dump_file != NULL) + fprintf + (lra_dump_file, + " %d Input/Output reload: reject+=%d\n", + nop, LRA_LOSER_COST_FACTOR); + reject += LRA_LOSER_COST_FACTOR; + } } if (early_clobber_p && ! scratch_p)