Commit 26a8813f by Segher Boessenkool Committed by Segher Boessenkool

genrecog: Fix crash on invalid input

If your machine description refers to a non-existent predicate genrecog
crashes.  This fixes it.


	* genrecog.c (match_pattern_2): If pred is NULL don't call
	safe_predicate_mode on it.

From-SVN: r234206
parent 26a7773c
2016-03-15 Segher Boessenkool <segher@kernel.crashing.org>
* genrecog.c (match_pattern_2): If pred is NULL don't call
safe_predicate_mode on it.
2016-03-14 Jakub Jelinek <jakub@redhat.com>
PR middle-end/70219
......
......@@ -4037,7 +4037,7 @@ match_pattern_2 (state *s, md_rtx_info *info, position *pos, rtx pattern)
/* Check the mode first, to distinguish things like SImode
and DImode register_operands, as described above. */
machine_mode mode = GET_MODE (e->pattern);
if (safe_predicate_mode (pred, mode))
if (pred && safe_predicate_mode (pred, mode))
s = add_decision (s, rtx_test::mode (e->pos), mode, true);
/* Assign to operands[] first, so that the rtx usually doesn't
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment