From: Richard Sandiford Date: Fri, 30 May 2014 07:35:47 +0000 (+0000) Subject: ira.c (ira_get_dup_out_num): Check for output operands at the start of the loop. X-Git-Tag: upstream/12.2.0~62908 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98f2f031af6c7a215c607702036195dcc8faaf86;p=platform%2Fupstream%2Fgcc.git ira.c (ira_get_dup_out_num): Check for output operands at the start of the loop. gcc/ * ira.c (ira_get_dup_out_num): Check for output operands at the start of the loop. Handle cases where an included alternative follows an excluded one. From-SVN: r211072 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 30aaf18..a0d75fe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-05-30 Richard Sandiford + + * ira.c (ira_get_dup_out_num): Check for output operands at + the start of the loop. Handle cases where an included alternative + follows an excluded one. + 2014-05-29 Mike Stump PR debug/61352 diff --git a/gcc/ira.c b/gcc/ira.c index 26d017e..eebd410 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -1979,33 +1979,33 @@ ira_get_dup_out_num (int op_num, HARD_REG_SET &alts) if (op_num < 0 || recog_data.n_alternatives == 0) return -1; - use_commut_op_p = false; + /* We should find duplications only for input operands. */ + if (recog_data.operand_type[op_num] != OP_IN) + return -1; str = recog_data.constraints[op_num]; + use_commut_op_p = false; for (;;) { #ifdef EXTRA_CONSTRAINT_STR op = recog_data.operand[op_num]; #endif - for (ignore_p = false, original = -1, curr_alt = 0;;) + for (curr_alt = 0, ignore_p = !TEST_HARD_REG_BIT (alts, curr_alt), + original = -1;;) { c = *str; if (c == '\0') break; - if (c == '#' || !TEST_HARD_REG_BIT (alts, curr_alt)) + if (c == '#') ignore_p = true; else if (c == ',') { curr_alt++; - ignore_p = false; + ignore_p = !TEST_HARD_REG_BIT (alts, curr_alt); } else if (! ignore_p) switch (c) { - /* We should find duplications only for input operands. */ - case '=': - case '+': - goto fail; case 'X': case 'p': case 'g':