aboutsummaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2013-01-15 16:17:28 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2013-01-15 16:17:28 +0000
commitb0fe107eedb0f6d1f86639372e614587d8df3a5d (patch)
tree6ca9b91464994dadabc30601888a873a0f454f7c /gcc/final.c
parentb164615d7992868eed1ff874b2ac0e2d1a73bffb (diff)
downloadgcc-b0fe107eedb0f6d1f86639372e614587d8df3a5d.zip
gcc-b0fe107eedb0f6d1f86639372e614587d8df3a5d.tar.gz
gcc-b0fe107eedb0f6d1f86639372e614587d8df3a5d.tar.bz2
re PR target/43961 ([ARM thumb] "branch out of range" with thumb1_output_casesi)
2013-01-15 Joseph Myers <joseph@codesourcery.com> Mikael Pettersson <mikpe@it.uu.se> PR target/43961 * config/arm/arm.h (ADDR_VEC_ALIGN): Align SImode jump tables for Thumb. (ASM_OUTPUT_CASE_LABEL): Remove. (ASM_OUTPUT_BEFORE_CASE_LABEL): Define to empty. * final.c (shorten_branches): Update alignment of labels before jump tables if CASE_VECTOR_SHORTEN_MODE. Co-Authored-By: Mikael Pettersson <mikpe@it.uu.se> From-SVN: r195208
Diffstat (limited to 'gcc/final.c')
-rw-r--r--gcc/final.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/final.c b/gcc/final.c
index 3da07ed..d5154db 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -1182,6 +1182,29 @@ shorten_branches (rtx first)
if (LABEL_P (insn))
{
int log = LABEL_TO_ALIGNMENT (insn);
+
+#ifdef CASE_VECTOR_SHORTEN_MODE
+ /* If the mode of a following jump table was changed, we
+ may need to update the alignment of this label. */
+ rtx next;
+ bool next_is_jumptable;
+
+ next = next_nonnote_insn (insn);
+ next_is_jumptable = next && JUMP_TABLE_DATA_P (next);
+ if ((JUMP_TABLES_IN_TEXT_SECTION
+ || readonly_data_section == text_section)
+ && next_is_jumptable)
+ {
+ int newlog = ADDR_VEC_ALIGN (next);
+ if (newlog != log)
+ {
+ log = newlog;
+ LABEL_TO_ALIGNMENT (insn) = log;
+ something_changed = 1;
+ }
+ }
+#endif
+
if (log > insn_current_align)
{
int align = 1 << log;