Hi,

The problem appears in revision 201034 in version 4.9. I also reported
this problem at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57812.

Bootstrap and regression-tested on x86_64-linux.

In method "computed_jump_p()" in gcc/rtlanal.c, the loop on line 2801
should break immediately after "has_use_labelref" is set to "1".


2013-07-22  Chang  <pcha...@cs.wisc.edu>

        * rtlanal.c (computed_jump_p): Exit loop once we find label
          reference is used.

Index: gcc/rtlanal.c
===================================================================
--- gcc/rtlanal.c       (revision 201034)
+++ gcc/rtlanal.c       (working copy)
@@ -2802,7 +2802,10 @@
            if (GET_CODE (XVECEXP (pat, 0, i)) == USE
                && (GET_CODE (XEXP (XVECEXP (pat, 0, i), 0))
                    == LABEL_REF))
-             has_use_labelref = 1;
+             {
+               has_use_labelref = 1;
+               break;
+             }

          if (! has_use_labelref)
            for (i = len - 1; i >= 0; i--)


-Chang
Index: gcc/rtlanal.c
===================================================================
--- gcc/rtlanal.c       (revision 201034)
+++ gcc/rtlanal.c       (working copy)
@@ -2802,7 +2802,10 @@
            if (GET_CODE (XVECEXP (pat, 0, i)) == USE
                && (GET_CODE (XEXP (XVECEXP (pat, 0, i), 0))
                    == LABEL_REF))
-             has_use_labelref = 1;
+             {
+               has_use_labelref = 1;
+               break;
+             }
 
          if (! has_use_labelref)
            for (i = len - 1; i >= 0; i--)

Reply via email to