This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Tiny fix to fixup_var_refs
- From: Eric Botcazou <ebotcazou at act-europe dot fr>
- To: gcc-patches at gcc dot gnu dot org
- Cc: mark at codesourcery dot com
- Date: Thu, 10 Jun 2004 10:19:46 +0200
- Subject: [PATCH] Tiny fix to fixup_var_refs
Hi,
In the ongoing series of tiny fixes for Ada, here is another one, which was
independently written twice (by Olivier for GCC 2.8.1 and me for GCC 3.2.x),
so we'd rather not have to write it a third time.
When a sequence is fixed up, insns may be added before the first insn of the
sequence (e.g. on SPARC when the address of the stack slot doesn't fit into
the limits for the reg+constant addressing mode). In which case they are
lost because the start of the sequence is not adjusted.
The testcase is proprietary and very specific, so I can't really "re-create"
one. Bootstrapped/regtested on i586-redhat-linux-gnu (mainline). OK for
mainline?
Mark, can I put it on the 3.4 branch too? The fix is present in GNAT 3.15p,
which is the previous recommended public release of the GNU Ada compiler.
2004-06-10 Eric Botcazou <ebotcazou@act-europe.fr>
Olivier Hainque <hainque@act-europe.fr>
* function.c (fixup_var_refs): Also adjust the start of sequence
after fixing up the insns.
--
Eric Botcazou
Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.520
diff -u -p -r1.520 function.c
--- function.c 3 Jun 2004 12:07:40 -0000 1.520
+++ function.c 10 Jun 2004 07:51:18 -0000
@@ -1620,8 +1620,8 @@ fixup_var_refs (rtx var, enum machine_mo
push_to_full_sequence (stack->first, stack->last);
fixup_var_refs_insns (stack->first, var, promoted_mode, unsignedp,
stack->next != 0, may_share);
- /* Update remembered end of sequence
- in case we added an insn at the end. */
+ /* Update bounds of sequence in case we added insns. */
+ stack->first = get_insns ();
stack->last = get_last_insn ();
end_sequence ();
}