[PATCH] Slight emit_note_insn_var_location optimization (was Re: Fix mode checks in var-tracking.c)
Jakub Jelinek
jakub@redhat.com
Fri Oct 23 21:28:00 GMT 2009
On Thu, Oct 22, 2009 at 11:27:24PM +0100, Richard Sandiford wrote:
> As an optimisation, you mean? Yeah, that makes sense, but can
> we leave it for a follow-on patch? I still think this hunk is
> the right fix in itself, as well as being a similar kind of
> optimisation.
Here is what I've bootstrapped/regtested on x86_64-linux and i686-linux
on top of the patch you've posted. Ok for trunk when your patch is
committed?
2009-10-23 Jakub Jelinek <jakub@redhat.com>
* var-tracking.c (emit_note_insn_var_location): Don't call the second
vt_expand_loc unnecessarily when location is not a register nor
memory.
--- gcc/var-tracking.c.jj 2009-10-23 18:41:33.000000000 +0200
+++ gcc/var-tracking.c 2009-10-23 18:54:55.000000000 +0200
@@ -6414,6 +6414,7 @@ emit_note_insn_var_location (void **varp
if (j < var->n_var_parts
&& wider_mode != VOIDmode
&& mode == GET_MODE (var->var_part[j].loc_chain->loc)
+ && (REG_P (loc[n_var_parts]) || MEM_P (loc[n_var_parts]))
&& (loc2 = vt_expand_loc (var->var_part[j].loc_chain->loc, vars))
&& GET_CODE (loc[n_var_parts]) == GET_CODE (loc2)
&& last_limit == var->var_part[j].offset)
Jakub
More information about the Gcc-patches
mailing list