mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-10 09:20:31 +08:00
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
This commit is contained in:
parent
26a7773c2f
commit
26a8813fa3
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user