On Tue, Jun 18, 2013 at 10:59:56AM +0200, Steven Bosscher wrote:
> On Tue, Jun 18, 2013 at 10:57 AM, Andreas Krebbel
> <kreb...@linux.vnet.ibm.com> wrote:
> > Hi,
> >
> > the patch replaces next_real_insn with next_active_insn when checking
> > for JUMP TABLE insns.
> >
> > This fixes ESA mode bootstrap on s390 which broke with r197266.
> >
> > Comitted to mainline
> 
> Please revert this and find another solution. JUMP_TABLE_DATA is not
> an active insn, and I will be removing it soon from active_insn_p.

I don't see which of the other iterators would fit here.  So I'll need
my own.  How do you intend to fix this for the other targets?  Will
there be a new iterator available?

If you don't want me to use next_active_insn I probably have to do
something like this instead:

---
 gcc/config/s390/s390.c |   30 ++++++++++++++++++++++!!!!!!!!
 1 file changed, 22 insertions(+), 8 modifications(!)

Index: gcc/config/s390/s390.c
===================================================================
*** gcc/config/s390/s390.c.orig
--- gcc/config/s390/s390.c
*************** s390_mainpool_cancel (struct constant_po
*** 6792,6797 ****
--- 6792,6819 ----
    s390_free_pool (pool);
  }
  
+ /* Return true if LABEL is directly followed by a jump table insn.  If
+    JUMP_TABLE_INSN is non-null the jump table insn is returned
+    there.  */
+ static bool
+ s390_is_jumptable_label_p (rtx label, rtx *jump_table_insn)
+ {
+   while (label)
+     {
+       label = NEXT_INSN (label);
+ 
+       if (label == NULL_RTX || NONDEBUG_INSN_P (label))
+       return false;
+ 
+       if (JUMP_TABLE_DATA_P (label))
+       {
+         if (jump_table_insn != NULL)
+           *jump_table_insn = label;
+         return true;
+       }
+     }
+   return false;
+ }
  
  /* Chunkify the literal pool.  */
  
*************** s390_chunkify_start (void)
*** 7012,7019 ****
        if (LABEL_P (insn)
          && (LABEL_PRESERVE_P (insn) || LABEL_NAME (insn)))
        {
!         rtx vec_insn = next_active_insn (insn);
!         if (! vec_insn || ! JUMP_TABLE_DATA_P (vec_insn))
            bitmap_set_bit (far_labels, CODE_LABEL_NUMBER (insn));
        }
  
--- 7034,7040 ----
        if (LABEL_P (insn)
          && (LABEL_PRESERVE_P (insn) || LABEL_NAME (insn)))
        {
!         if (!s390_is_jumptable_label_p (insn, NULL))
            bitmap_set_bit (far_labels, CODE_LABEL_NUMBER (insn));
        }
  
*************** s390_chunkify_start (void)
*** 7043,7050 ****
            {
              /* Find the jump table used by this casesi jump.  */
              rtx vec_label = XEXP (XEXP (XVECEXP (pat, 0, 1), 0), 0);
!             rtx vec_insn = next_active_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;
--- 7064,7072 ----
            {
              /* Find the jump table used by this casesi jump.  */
              rtx vec_label = XEXP (XEXP (XVECEXP (pat, 0, 1), 0), 0);
!             rtx vec_insn;
! 
!             if (s390_is_jumptable_label_p (vec_label, &vec_insn))
                {
                  rtx vec_pat = PATTERN (vec_insn);
                  int i, diff_p = GET_CODE (vec_pat) == ADDR_DIFF_VEC;

Reply via email to