From 3f12f020c62b9f460febb59053e312f5ff298bec Mon Sep 17 00:00:00 2001 From: Andreas Krebbel Date: Fri, 18 Dec 2015 10:39:52 +0000 Subject: [PATCH] IRA: Fix % constraint modifier handling on disabled alternatives. gcc/ChangeLog: 2015-12-18 Andreas Krebbel * ira.c (ira_setup_alts): Move the scan for commutative modifier to the first loop to make it work even with disabled alternatives. From-SVN: r231814 --- gcc/ChangeLog | 5 +++++ gcc/ira.c | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 802c8b8fd76..803dbd775a6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-12-18 Andreas Krebbel + + * ira.c (ira_setup_alts): Move the scan for commutative modifier + to the first loop to make it work even with disabled alternatives. + 2015-12-18 Dominik Vogt * config/s390/s390.c (s390_init_frame_layout): Try r4 to r2 for the diff --git a/gcc/ira.c b/gcc/ira.c index 97edf8c4816..9824e4a6d89 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -1800,7 +1800,13 @@ ira_setup_alts (rtx_insn *insn, HARD_REG_SET &alts) { insn_constraints[nop * recog_data.n_alternatives + nalt] = p; while (*p && *p != ',') - p++; + { + /* We only support one commutative marker, the first + one. We already set commutative above. */ + if (*p == '%' && commutative < 0) + commutative = nop; + p++; + } if (*p) p++; } @@ -1831,11 +1837,7 @@ ira_setup_alts (rtx_insn *insn, HARD_REG_SET &alts) break; case '%': - /* We only support one commutative marker, the - first one. We already set commutative - above. */ - if (commutative < 0) - commutative = nop; + /* The commutative modifier is handled above. */ break; case '0': case '1': case '2': case '3': case '4': -- 2.30.2