[armel, avmv6] wrong assembler with -O[13s], not -O2

Bug #730840 reported by Matthias Klose
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Linaro GCC
Invalid
Undecided
Unassigned
gcc-4.4 (Ubuntu)
New
Undecided
Unassigned
gcc-4.5 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: gcc-4.4

maverick:

$ gcc-4.4 -c -march=armv6 -Os inlining.i
inlining.c: In function 'rewriteLock':
inlining.c:850: error: insn does not satisfy its constraints:
(insn 62 20 21 3 inlining.c:846 (set (reg:SI 3 r3)
        (reg/f:SI 13 sp)) 174 {*thumb1_movsi_insn_osize} (nil))
inlining.c:850: internal compiler error: in reload_cse_simplify_operands, at postreload.c:397
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.

natty, with both gcc-4.4 and gcc-4.5:
$ gcc-4.5 -c -march=armv6 -Os inlining.i
/tmp/ccl1qfKd.s: Assembler messages:
/tmp/ccl1qfKd.s:794: Error: invalid immediate: 983040 is out of range
/tmp/ccl1qfKd.s:794: Error: value of 983040 too large for field of 2 bytes at 1310
/tmp/ccl1qfKd.s:1088: Error: invalid immediate: 983040 is out of range
/tmp/ccl1qfKd.s:1088: Error: value of 983040 too large for field of 2 bytes at 1800

works with -O2, fails with -O1, -Os, -O3.

Tags: armel
Revision history for this message
Matthias Klose (doko) wrote :
summary: - XX
+ [armel, avmv6] wrong assembler with -O[13s], not -O2
Revision history for this message
Dr. David Alan Gilbert (davidgil-uk) wrote :

Still fails on 4.5-2011.03-0 release when built with -mthumb

/tmp/cc491lp9.s: Assembler messages:
/tmp/cc491lp9.s:793: Error: invalid immediate: 983040 is out of range
/tmp/cc491lp9.s:793: Error: value of 00000000000f0000 too large for field of 2 bytes at 000000000000051e
/tmp/cc491lp9.s:1087: Error: invalid immediate: 983040 is out of range
/tmp/cc491lp9.s:1087: Error: value of 00000000000f0000 too large for field of 2 bytes at 0000000000000708

those seem to come from a line in the input newCodeBlock() and newDuplicateBlock function with inline asm, of

mov r7, #0xf0000

For Thumb1 that just doesn't fit; compiling with -march=armv6t2 works.

Dave

Revision history for this message
Michael Hope (michaelh1) wrote :

From what you're saying Dave, this is an inline assembler bug which is invalid for Thumb-1.

Matthias, if this needs to compile under Thumb-1 then could you tag it as arm-porting-queue and notify Steve L?

Changed in gcc-linaro:
status: New → Incomplete
Revision history for this message
Dr. David Alan Gilbert (davidgil-uk) wrote :

Correct, my reading is that the inline assembler is invalid on Thumb-1.

Dave

Revision history for this message
Mans Rullgard (mansr) wrote :

The problem is indeed inline asm which is invalid for Thumb-1.

This code comes from JamVM, and the inline asm performs a syscall to invalidate the I-cache after generating some code. It would be better off using the gcc __builtin__clear_cache() function for this, or least changing the code to let gcc generate the constants.

Changed in gcc-linaro:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.