From e2c038d34c01414b5efee68e5e3e41c3bd248193 Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Wed, 26 Mar 2008 16:33:33 +0000 Subject: [PATCH] gas/: * config/tc-bfin.c (bfin_start_line_hook): Localize the labels generated for LOOP_BEGIN and LOOP_END instructions. (bfin_gen_loop): Likewise. gas/testsuite/: * gas/bfin/flow.d: Adjust since the generated labels for LOOP_BEGIN and LOOP_END instruction are local now. * gas/bfin/flow2.d: Likewise. --- gas/ChangeLog | 4 ++++ gas/config/tc-bfin.c | 15 +++++++++------ gas/testsuite/ChangeLog | 6 +++++- gas/testsuite/gas/bfin/flow.d | 28 +++++++++------------------- gas/testsuite/gas/bfin/flow2.d | 10 +++------- 5 files changed, 30 insertions(+), 33 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 58c2524401b..d87cc0b9084 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -20,6 +20,10 @@ data register in each rule that moves to the data register. + * config/tc-bfin.c (bfin_start_line_hook): Localize the labels + generated for LOOP_BEGIN and LOOP_END instructions. + (bfin_gen_loop): Likewise. + 2008-03-19 Andreas Krebbel * config/tc-s390.c (md_parse_option): z10 option added. diff --git a/gas/config/tc-bfin.c b/gas/config/tc-bfin.c index 515019898de..4652efa8116 100644 --- a/gas/config/tc-bfin.c +++ b/gas/config/tc-bfin.c @@ -866,15 +866,17 @@ bfin_start_line_hook () input_line_pointer = c; if (maybe_end) { - label_name = (char *) xmalloc ((c - c1) + strlen ("__END") + 1); + label_name = (char *) xmalloc ((c - c1) + strlen ("__END") + 5); label_name[0] = 0; + strcat (label_name, "L$L$"); strncat (label_name, c1, c-c1); strcat (label_name, "__END"); } else /* maybe_begin. */ { - label_name = (char *) xmalloc ((c - c1) + strlen ("__BEGIN") + 1); + label_name = (char *) xmalloc ((c - c1) + strlen ("__BEGIN") + 5); label_name[0] = 0; + strcat (label_name, "L$L$"); strncat (label_name, c1, c-c1); strcat (label_name, "__BEGIN"); } @@ -884,8 +886,7 @@ bfin_start_line_hook () /* Loop_End follows the last instruction in the loop. Adjust label address. */ if (maybe_end) - line_label->sy_value.X_add_number -= last_insn_size; - + ((struct local_symbol *) line_label)->lsy_value -= last_insn_size; } /* Special extra functions that help bfin-parse.y perform its job. */ @@ -1878,15 +1879,17 @@ bfin_gen_loop (Expr_Node *expr, REG_T reg, int rop, REG_T preg) Expr_Node *lbegin, *lend; loopsym = expr->value.s_value; - lbeginsym = (char *) xmalloc (strlen (loopsym) + strlen ("__BEGIN") + 1); - lendsym = (char *) xmalloc (strlen (loopsym) + strlen ("__END") + 1); + lbeginsym = (char *) xmalloc (strlen (loopsym) + strlen ("__BEGIN") + 5); + lendsym = (char *) xmalloc (strlen (loopsym) + strlen ("__END") + 5); lbeginsym[0] = 0; lendsym[0] = 0; + strcat (lbeginsym, "L$L$"); strcat (lbeginsym, loopsym); strcat (lbeginsym, "__BEGIN"); + strcat (lendsym, "L$L$"); strcat (lendsym, loopsym); strcat (lendsym, "__END"); diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 11c0401132e..f307ee4e37a 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -15,7 +15,11 @@ Add check for mismatch of accumulator and data register. * gas/bfin/arithmetic.s, gas/bfin/arithmetic.d: Add check for IU option. - + + * gas/bfin/flow.d: Adjust since the generated labels for LOOP_BEGIN + and LOOP_END instruction are local now. + * gas/bfin/flow2.d: Likewise. + From Mike Frysinger * gas/bfin/expected_errors.s, gas/bfin/expected_errors.l: Add test for mismatched half registers in vector multipy-accumulate diff --git a/gas/testsuite/gas/bfin/flow.d b/gas/testsuite/gas/bfin/flow.d index 9c5c8252bfc..6a796194d33 100644 --- a/gas/testsuite/gas/bfin/flow.d +++ b/gas/testsuite/gas/bfin/flow.d @@ -39,9 +39,7 @@ Disassembly of section .text: 3e: 14 00 RTE; 00000040 : - 40: 82 e0 13 00 LSETUP\(44 ,66 \)LC0; - -00000044 : + 40: 82 e0 13 00 LSETUP\(44 ,66 \)LC0; 44: 38 e4 7b fc R0=\[FP\+-3604\]; 48: 49 60 R1=0x9\(x\); 4a: 38 e4 7b fc R0=\[FP\+-3604\]; @@ -55,27 +53,21 @@ Disassembly of section .text: 5e: 10 93 \[P2\]=R0; 60: 38 e4 7b fc R0=\[FP\+-3604\]; 64: 08 64 R0\+=0x1; - -00000066 : 66: 38 e6 7b fc \[FP\+-3604\]=R0; - 6a: a2 e0 02 40 LSETUP\(6e ,6e \)LC0=P4; - -0000006e : + 6a: a2 e0 02 40 LSETUP\(6e ,6e \)LC0=P4; 6e: 00 00 NOP; - 70: e0 e0 00 10 LSETUP\(70 ,70 \)LC0=P1>>1; - 74: 82 e0 ff 03 LSETUP\(78 ,72 \)LC0; - 78: af e0 00 52 LSETUP\(76 ,fffffc78 \)LC0=P5; - 7c: ef e0 02 00 LSETUP\(7a ,80 \)LC0=P0>>1; + 70: e0 e0 00 10 LSETUP\(70 ,70 \)LC0=P1>>1; + 74: 82 e0 ff 03 LSETUP\(78 ,72 \)LC0; + 78: af e0 00 52 LSETUP\(76 ,fffffc78 \)LC0=P5; + 7c: ef e0 02 00 LSETUP\(7a ,80 \)LC0=P0>>1; 00000080 : 80: 90 e0 00 00 LSETUP\(80 ,80 \)LC1; 84: b0 e0 00 40 LSETUP\(84 ,84 \)LC1=P4; - 88: f8 e0 1b 10 LSETUP\(78 ,be \)LC1=P1>>1; + 88: f8 e0 1b 10 LSETUP\(78 ,be \)LC1=P1>>1; 8c: 92 e0 ff 03 LSETUP\(90 ,8a \)LC1; - 90: bf e0 00 52 LSETUP\(8e ,fffffc90 \)LC1=P5; - 94: ff e0 02 00 LSETUP\(92 ,98 \)LC1=P0>>1; - -00000098 : + 90: bf e0 00 52 LSETUP\(8e ,fffffc90 \)LC1=P5; + 94: ff e0 02 00 LSETUP\(92 ,98 \)LC1=P0>>1; 98: 38 e4 7a fc R0=\[FP\+-3608\]; 9c: 00 32 P0=R0; 9e: 42 44 P2=P0<<2; @@ -91,6 +83,4 @@ Disassembly of section .text: b8: 00 32 P0=R0; ba: 82 5a P2=P2\+P0; bc: 10 91 R0=\[P2\]; - -000000be : be: 08 93 \[P1\]=R0; diff --git a/gas/testsuite/gas/bfin/flow2.d b/gas/testsuite/gas/bfin/flow2.d index 1ffe7c3eae3..64b782f7a9b 100644 --- a/gas/testsuite/gas/bfin/flow2.d +++ b/gas/testsuite/gas/bfin/flow2.d @@ -102,13 +102,9 @@ Disassembly of section .text: 000000ce : ce: 81 e1 02 00 R1=2 \(Z\); d2: a2 e0 04 10 LSETUP\(d6 ,da \)LC0=P1; - d6: e2 e0 04 10 LSETUP\(da ,de \)LC0=P1>>1; - da: 82 e0 03 00 LSETUP\(de ,e0 \)LC0; - -000000de : + d6: e2 e0 04 10 LSETUP\(da ,de \)LC0=P1>>1; + da: 82 e0 03 00 LSETUP\(de ,e0 \)LC0; de: 08 60 R0=0x1\(x\); - -000000e0 : e0: 11 60 R1=0x2\(x\); - e2: 90 e0 00 00 LSETUP\(e2 ,e2 \)LC1; + e2: 90 e0 00 00 LSETUP\(e2 ,e2 \)LC1; ... -- 2.30.2