[#5928] gas has problems with local labels in LOOP instructions
Submitted By: Robin Getz
2010-02-24 09:55:40 Close Date
Custom Silicon Revision:
Fixed Fixed In Release:
Host Operating System:
Closed Found In Release:
Is this bug repeatable?:
Summary: gas has problems with local labels in LOOP instructions
.macro divide num:req den:req
/* Evaluate given a signed integer dividend and divisor */
r0 = \num; /* Dividend, or numerator */
r1 = \den; /* Divisor, or denominator */
r0 <<= 1; /* Left shift dividend by 1 needed for integer division */
p0 = 15; /* Evaluate the quotient to 16 bits. */
divs (r0, r1); /* Evaluate quotient MSB. Initialize AQ status bit and dividend for the DIVQ loop. */
loop 1f lc0=p0; /* Evaluate DIVQ p0=15 times. */
divq (r0, r1);
r0 = r0.l (x); /* Sign extend the 16-bit quotient to 32bits. */
/* r0 contains the quotient (70/5 = 14) */
r1 = (\num / \den);
CC = r0 == r1
if !CC jump 2f;
divide 70 5
divide 100 10
divide 1000 10
Compiling tests: divq.s: Assembler messages:
divq.s:33: Error: Invalid expression in LOOP_BEGIN statement.
divq.s:33: Error: Invalid expression in LOOP_END statement.
divq.s:34: Error: Invalid expression in LOOP_BEGIN statement.
divq.s:34: Error: Invalid expression in LOOP_END statement.
divq.s:35: Error: Invalid expression in LOOP_BEGIN statement.
divq.s:35: Error: Invalid expression in LOOP_END statement.
make: *** [divq.s.x] Error 1
make: *** Waiting for unfinished jobs....
changing it to:
loop .Lfoo lc0=p0; /* Evaluate DIVQ p0=15 times. */
r0 = r0.l (x);
divq.s:33: Internal error, aborting at /home/rgetz/blackfin/trunk/toolchain/binutils-2.17/gas/symbols.c line 817 in symbol_remove
Please report this bug.
--- Mike Frysinger 2010-05-27 14:09:45
is that original code correct ? i dont see it declaring "1:"
anywhere, and the loop_begin/loop_end should be using "1f" or
"1b" and not just "1".
--- Robin Getz 2010-05-27 18:01:38
It's correct in terms of it should be
loop name lc0=p0;
loop_begin name; /* place before the first instruction in the loop */
loop_end name; /* place after the last instruction in the loop */
It's just that names can't be numeric local labels.
since the parser turns names into $L$L (local labels)
So - I don't think this is a bug.
Or - at least the bug is between the chair and the keyboard.
I'll leave this open - since we shouldn't ever get an internal error (that
needs to be tracked down) - we are calling symbol_remove with null or
--- David Gibson 2010-06-08 06:38:45
Fixed this issue, but the fix has caused a regression (6059).
--- Sonic Zhang 2010-06-18 04:47:44
Could you add a test case for this bug under binutility?
--- Robin Getz 2010-06-18 13:51:16
Things look OK - verified that the old assembler fails on the new test cases,
and the new assembler works.
Since I opened things - I'll close it.
File Name File Type File Size Posted By
No Files Were Found