[Patch, PR 57812] Wasted work in computed_jump_p()
pchang9@cs.wisc.edu
pchang9@cs.wisc.edu
Mon Jul 22 16:51:00 GMT 2013
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 <pchang9@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
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pr57812_patch.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130722/024b5da9/attachment.ksh>
More information about the Gcc-patches
mailing list