libtheora has a ICE when building under the Linaro toolchain
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Linaro GCC |
Fix Released
|
High
|
Paul Brook |
Bug Description
Seen with gcc 4.4.4-6ubuntu5~ppa2 and libtheora 1.1.1+dfsg.1-3.
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -Wall -Wno-parentheses -O3 -fforce-addr -fomit-
mathops.c: In function 'oc_blog64':
mathops.c:296: error: unable to generate reloads for:
(insn 758 609 770 12 mathops.c:288 (set (subreg:SI (reg:DI 2 r2 [648]) 0)
(ior:SI (ashift:SI (reg:SI 6 r6 [688])
mathops.c:296: internal compiler error: in find_reloads, at reload.c:3781
Related branches
- Andrew Stubbs (community): Approve
-
Diff: 185 lines (+50/-16)4 files modifiedChangeLog.linaro (+17/-0)
gcc/config/arm/predicates.md (+2/-3)
gcc/config/arm/thumb2.md (+13/-13)
gcc/testsuite/gcc.dg/long-long-shift-1.c (+18/-0)
Changed in gcc-linaro: | |
status: | Confirmed → Triaged |
importance: | Undecided → High |
milestone: | none → 4.4-2010.07-1 |
Changed in gcc-linaro: | |
assignee: | nobody → Paul Brook (paul-codesourcery) |
Changed in gcc-linaro: | |
status: | Triaged → In Progress |
Changed in gcc-linaro: | |
status: | In Progress → Fix Committed |
Changed in gcc-linaro: | |
status: | Fix Committed → Fix Released |
Confirmed; this seems to be a compiler bug.
Very much reduced test case:
long long
test (long long pat, long long mask)
{
long long z = 0;
int i;
for (i = 39; i < 62; i++)
z += (pat >> i) + mask ^ mask;
return z;
}
If you build with cc1 test.i -march=armv7-a -mthumb -O2 you get with current Linaro GCC 4.4:
test.i:12: error: unable to generate reloads for:
(const_ int -7 [0xffffffffffff fff9]))
(subreg: SI (reg:DI 4 r4 [140]) 0))) 689 {*thumb2_ arith_shiftsi} (nil))
(insn 79 86 81 2 test.i:9 (set (subreg:SI (reg:DI 4 r4 [140]) 0)
(ior:SI (ashift:SI (reg:SI 1 r1 [orig:151 pat+4 ] [151])
test.i:12: internal compiler error: in find_reloads, at reload.c:3781
This looks like a bug in the thumb2.md file:
(define_insn "*thumb2_ arith_shiftsi" operand" "=r")
(match_ operator: SI 1 "shiftable_ operator"
[(match_ operator: SI 3 "shift_operator"
[ (match_ operand: SI 4 "s_register_ operand" "r")
(match_ operand: SI 5 "const_int_operand" "M")])
(match_ operand: SI 2 "s_register_ operand" "r")]))]
[(set (match_operand:SI 0 "s_register_
"TARGET_THUMB2"
"%i1%?\\t%0, %2, %4%S3"
[(set_attr "predicable" "yes")
(set_attr "shift" "4")
(set_attr "type" "alu_shift")]
)
Note how operand 5 claims to accept *any* immediate integer value in the predicate, but then offers just a single constraint "M" that accepts only a subset of immediate integer values? This implies any integer accepted by "const_int_operand" but then rejected by the "M" constraint will necessarily cause a reload failure. The pattern ought to either use a special predicate that matches what the constraint accepts, or else add appropriate tests to the overall insn condition.