From 0cd9a9a9ddecb2f6a05ab897b73c6a8c500dfd7f Mon Sep 17 00:00:00 2001 From: krebbel Date: Wed, 19 Jun 2013 12:06:30 +0000 Subject: [PATCH] 2013-06-19 Steven Bosscher PR target/57609 * config/s390/s390.c (s390_chunkify_start): Replace next_real_insn with NEXT_INSN. Use tablejump_p to check for jump table data insns. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200196 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/config/s390/s390.c | 38 +++++++++++++++----------------------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 53a6cde..08f40a3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-06-19 Steven Bosscher + + PR target/57609 + * config/s390/s390.c (s390_chunkify_start): Replace next_real_insn + with NEXT_INSN. Use tablejump_p to check for jump table data + insns. + 2013-06-19 Paolo Carlini PR c++/56544 diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 358345a..06d1228 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -7023,7 +7023,7 @@ s390_chunkify_start (void) if (LABEL_P (insn) && (LABEL_PRESERVE_P (insn) || LABEL_NAME (insn))) { - rtx vec_insn = next_real_insn (insn); + rtx vec_insn = NEXT_INSN (insn); if (! vec_insn || ! JUMP_TABLE_DATA_P (vec_insn)) bitmap_set_bit (far_labels, CODE_LABEL_NUMBER (insn)); } @@ -7033,6 +7033,8 @@ s390_chunkify_start (void) else if (JUMP_P (insn)) { rtx pat = PATTERN (insn); + rtx table; + if (GET_CODE (pat) == PARALLEL && XVECLEN (pat, 0) > 2) pat = XVECEXP (pat, 0, 0); @@ -7046,28 +7048,18 @@ s390_chunkify_start (void) bitmap_set_bit (far_labels, CODE_LABEL_NUMBER (label)); } } - else if (GET_CODE (pat) == PARALLEL - && XVECLEN (pat, 0) == 2 - && GET_CODE (XVECEXP (pat, 0, 0)) == SET - && GET_CODE (XVECEXP (pat, 0, 1)) == USE - && GET_CODE (XEXP (XVECEXP (pat, 0, 1), 0)) == LABEL_REF) - { - /* Find the jump table used by this casesi jump. */ - rtx vec_label = XEXP (XEXP (XVECEXP (pat, 0, 1), 0), 0); - rtx vec_insn = next_real_insn (vec_label); - if (vec_insn && JUMP_TABLE_DATA_P (vec_insn)) - { - rtx vec_pat = PATTERN (vec_insn); - int i, diff_p = GET_CODE (vec_pat) == ADDR_DIFF_VEC; - - for (i = 0; i < XVECLEN (vec_pat, diff_p); i++) - { - rtx label = XEXP (XVECEXP (vec_pat, diff_p, i), 0); - - if (s390_find_pool (pool_list, label) - != s390_find_pool (pool_list, insn)) - bitmap_set_bit (far_labels, CODE_LABEL_NUMBER (label)); - } + else if (tablejump_p (insn, NULL, &table)) + { + rtx vec_pat = PATTERN (table); + int i, diff_p = GET_CODE (vec_pat) == ADDR_DIFF_VEC; + + for (i = 0; i < XVECLEN (vec_pat, diff_p); i++) + { + rtx label = XEXP (XVECEXP (vec_pat, diff_p, i), 0); + + if (s390_find_pool (pool_list, label) + != s390_find_pool (pool_list, insn)) + bitmap_set_bit (far_labels, CODE_LABEL_NUMBER (label)); } } } -- 2.7.4