get_attr_length_1 don't call the fallback function

Christian BRUEL christian.bruel@st.com
Fri Jul 4 12:28:00 GMT 2008


hello,

Is it normal/expected that get_attr_length_1 calls get_attr_length, 
instead of the callback_fn when recursively called from a SEQUENCE stmt?

When it is called from get_attr_min_length, we can get the wrong value, 
which is most of the time only an heuristic issue, but the sh4 is very 
sensitive to it (e.g to compute short conditional branch distances), 
when INSN_ADDRESSES_SET_P () is not set.

thanks for clarifying my view of this piece of code, or eventually allow 
me to commit the change if it happens to be an issue.

thanks,

Christian

2008-07-04  Christian Bruel  <christian.bruel@st.com>
 

         * final.c (get_attr_length_1) call fallback_fn instead of 
get_attr_length

Index: final.c
===================================================================
--- final.c     (revision 137454)
+++ final.c     (working copy)
@@ -410,7 +410,7 @@
           length = asm_insn_count (body) * fallback_fn (insn);
         else if (GET_CODE (body) == SEQUENCE)
           for (i = 0; i < XVECLEN (body, 0); i++)
-           length += get_attr_length (XVECEXP (body, 0, i));
+           length += fallback_fn (XVECEXP (body, 0, i));
         else
           length = fallback_fn (insn);
         break;



More information about the Gcc-patches mailing list