From e0944870710b48ad98e10e17ac0ae23995947573 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 27 Aug 2014 20:06:47 +0000 Subject: [PATCH] function.c: Use rtx_sequence gcc/ 2014-08-27 David Malcolm * function.c (contains): Introduce local "seq" for PATTERN (insn), with a checked cast, in the region for where we know it's a SEQUENCE. Use methods of rtx_sequence. From-SVN: r214595 --- gcc/ChangeLog | 6 ++++++ gcc/function.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c8b68a2ce95..8b33726443b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-08-27 David Malcolm + + * function.c (contains): Introduce local "seq" for PATTERN (insn), + with a checked cast, in the region for where we know it's a + SEQUENCE. Use methods of rtx_sequence. + 2014-08-27 David Malcolm * final.c (get_attr_length_1): Replace GET_CODE check with a diff --git a/gcc/function.c b/gcc/function.c index 25f1519a93e..6023d69800a 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -5335,9 +5335,10 @@ contains (const_rtx insn, htab_t hash) if (NONJUMP_INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE) { + rtx_sequence *seq = as_a (PATTERN (insn)); int i; - for (i = XVECLEN (PATTERN (insn), 0) - 1; i >= 0; i--) - if (htab_find (hash, XVECEXP (PATTERN (insn), 0, i))) + for (i = seq->len () - 1; i >= 0; i--) + if (htab_find (hash, seq->element (i))) return true; return false; } -- 2.30.2