This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] final.c max_skip without p2align
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Jan Hubicka <jh at suse dot cz>
- Date: Thu, 20 Feb 2003 13:24:33 -0500
- Subject: [PATCH] final.c max_skip without p2align
I would like to apply the max_skip limit to jump alignments on
targets without p2align support by using the instruction address directly,
as implemented by the following patch.
David
* final.c (shorten_branches): Apply max_skip to alignment on
targets without p2align support.
Index: final.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/final.c,v
retrieving revision 1.275
diff -c -p -r1.275 final.c
*** final.c 25 Jan 2003 23:32:20 -0000 1.275
--- final.c 20 Feb 2003 18:13:57 -0000
*************** shorten_branches (first)
*** 987,993 ****
--- 987,1001 ----
{
int align = 1 << log;
int new_address = (insn_current_address + align - 1) & -align;
+ #ifndef ASM_OUTPUT_MAX_SKIP_ALIGN
+ if ((new_address - insn_current_address)
+ <= LABEL_TO_MAX_SKIP (insn))
+ insn_lengths[uid] = new_address - insn_current_address;
+ else
+ LABEL_TO_ALIGNMENT (insn) = 0;
+ #else
insn_lengths[uid] = new_address - insn_current_address;
+ #endif
}
}