First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 11442
Product:  
Component:  
Status: RESOLVED
Resolution: INVALID
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Debian GCC Maintainers <debian-gcc@lists.debian.org>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
engine.i.gz preprocessed source application/gzip 2003-07-06 11:58 37.20 KB Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 11442 depends on: Show dependency tree
Show dependency graph
Bug 11442 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2003-07-09 22:19 Opened: 2003-07-06 11:57
[forwarded from http://bugs.debian.org/188513]

rechecked with CVS 3.3.1 and HEAD CVS 20030531, binutils-2.14.0.90.4
regression compared to gcc-2.95

$ gcc -c -O2 engine.i 
/tmp/ccVcqHkK.s: Assembler messages:
/tmp/ccVcqHkK.s:4532: Warning: source register same as write-back base
/tmp/ccVcqHkK.s:3038: Error: bad immediate value for offset (4104)
/tmp/ccVcqHkK.s:3056: Error: bad immediate value for offset (4176)
/tmp/ccVcqHkK.s:3084: Error: bad immediate value for offset (4288)
/tmp/ccVcqHkK.s:3092: Error: bad immediate value for offset (4140)
/tmp/ccVcqHkK.s:3103: Error: bad immediate value for offset (4104)
/tmp/ccVcqHkK.s:5237: Error: bad immediate value for offset (4132)
/tmp/ccVcqHkK.s:5250: Error: bad immediate value for offset (4184)
/tmp/ccVcqHkK.s:5264: Error: bad immediate value for offset (4240)
/tmp/ccVcqHkK.s:5276: Error: bad immediate value for offset (4108)

------- Comment #1 From Debian GCC Maintainers 2003-07-06 11:58 -------
Created an attachment (id=4352) [edit]
preprocessed source

------- Comment #2 From Dara Hazeghi 2003-07-09 22:19 -------
Confirmed with gcc 3.1, 3.3 branch and mainline (20030708).

------- Comment #3 From Richard Earnshaw 2003-10-01 09:15 -------
Not a bug.  Your source code is invalid.

You can't put any "asm" in your source code that requires more than 4 bytes per
statement.  You have ".skip 16" operations which are violating this constraint
and consequently gcc gets confused in a way which can only be detected by the
assembler.

The compiler does not parse the body of asm statements to divine their meaning.

------- Comment #4 From Richard Earnshaw 2003-10-01 09:18 -------
Note for clarity.  By "four bytes per statement" I mean between each semicolon
in the input string.  So 

	asm ("insn1; insn2; insn3 insn4")

is ok and (on ARM) will be counted as 16 bytes.  But

	asm (".space 16")

is not, it will only be counted as 4 bytes by the compiler.

------- Comment #5 From falk.hueffner@student.uni-tuebingen.de 2003-10-01 09:29 -------
Subject: Re:  [3.3 regression] [arm] invalid assembler on arm

"rearnsha at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

> You can't put any "asm" in your source code that requires more than
> 4 bytes per statement.  You have ".skip 16" operations which are
> violating this constraint and consequently gcc gets confused in a
> way which can only be detected by the assembler.

Is this something ARM specific? I can't find anything in the manual
about it. If it's a general statement, we can also close 12108.

> The compiler does not parse the body of asm statements to divine
> their meaning.

But it does count the ;'s?


------- Comment #6 From Richard Earnshaw 2003-10-01 10:16 -------
> Is this something ARM specific? I can't find anything in the manual
> about it. If it's a general statement, we can also close 12108.

Not specifically.  It applies to any port which relies on accurate tracking of
the size of instructions generated (sh spings to mind here).

In the ARM case we have to do this because of the limited range of a pc-relative
load, which means that constants have to split into sub-pools that are reachable
by a single instruction.

12108 is similar, but subtly different.  In that case (as I understand it from a
quick scan) the compiler is trying to suppress an ASM statement by the use of a
special instruction which will cause the following instruction to not be
executed (or only executed under specific conditions).  In this case the
compiler must know that the asm body will expand into exactly one target
instruction -- so it's not the length of the sequence generated, but the number
of instructions.  It could be argued that conditional suppression of an ASM
should never be attempted by the compiler, but I don't know enough about the
processor in question to be sure.

The documentation for ASM should probably be updated to make it clear that gcc
has to estimate the number of bytes that an ASM will generate and that the
estimate is based on the number of statements multiplied by the longest
instruction in the target.  Use of any ASM statement that produces more bytes
than that should be considered "unspecified behaviour" (it might work on some
platforms all the time, but on others only some of the time).

First Last Prev Next    No search results available      Search page      Enter new bug