The compare-elim.c change broke the build because the pass now sends all kind
of junk RTXes to the select_cc_mode target hook, which was written in exact
keeping with arithmetic patterns of the MD file. We now need to handle all
possible RTXes on the RHS of an assignment, even calls.
Tested on visium-elf, applied on the mainline.
2017-10-17 Eric Botcazou <ebotca...@adacore.com>
* config/visium/visium.c (visium_select_cc_mode): Return CCmode for
any RTX present on the RHS of a SET.
* compare-elim.c (try_eliminate_compare): Restore comment.
--
Eric Botcazou
Index: config/visium/visium.c
===================================================================
--- config/visium/visium.c (revision 253767)
+++ config/visium/visium.c (working copy)
@@ -2938,12 +2938,6 @@ visium_select_cc_mode (enum rtx_code cod
/* This is a btst, the result is in C instead of Z. */
return CCCmode;
- case CONST_INT:
- /* This is a degenerate case, typically an uninitialized variable. */
- gcc_assert (op0 == constm1_rtx);
-
- /* ... fall through ... */
-
case REG:
case AND:
case IOR:
@@ -2960,6 +2954,17 @@ visium_select_cc_mode (enum rtx_code cod
when applied to a comparison with zero. */
return CCmode;
+ /* ??? Cater to the junk RTXes sent by try_merge_compare. */
+ case ASM_OPERANDS:
+ case CALL:
+ case CONST_INT:
+ case LO_SUM:
+ case HIGH:
+ case MEM:
+ case UNSPEC:
+ case ZERO_EXTEND:
+ return CCmode;
+
default:
gcc_unreachable ();
}
Index: compare-elim.c
===================================================================
--- compare-elim.c (revision 253767)
+++ compare-elim.c (working copy)
@@ -729,6 +729,7 @@ try_eliminate_compare (struct comparison
if (try_merge_compare (cmp))
return true;
+ /* We must have found an interesting "clobber" preceding the compare. */
if (cmp->prev_clobber == NULL)
return false;