This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
19990502-0.f fails at -O2 on x86; reload bug
- To: egcs-bugs at cygnus dot com, craig at jcb-sc dot com, amylaar at cygnus dot co dot uk
- Subject: 19990502-0.f fails at -O2 on x86; reload bug
- From: Zack Weinberg <zack at rabi dot columbia dot edu>
- Date: Thu, 06 May 1999 20:59:10 -0400
19990502-0.f is failing on x86 at -O2 and no other optimization
level. We abort in print_operand:
$ f771 19990502-0.f -O2 -w -o /tmp/ccxldaaa.s
19990502-0.f: In subroutine `trf2f2':
19990502-0.f:350: Internal compiler error in `print_operand',
at config/i386/i386.c:3405
because we tried to emit a hard register reference to %argp. There is
no such register; reload is supposed to eliminate %argp to %fp or %sp
always.
The offending insn, just before reload, is
(insn 1659 1653 1677 (set (reg:SI 447)
(const_int 0 [0x0])) 48 {movsi+2} (nil)
(nil))
Looks perfectly harmless, ne? But after reload we have
(insn 1659 2138 2141 (set (reg:SI 16 %argp)
(const_int 0 [0x0])) 48 {movsi+2} (nil)
(nil))
(insn 2141 1659 1677 (set (mem:SI (plus:SI (reg:SI 6 %ebp)
(const_int -196 [0xffffff3c])) 0)
(reg:SI 16 %argp)) 48 {movsi+2} (nil)
(nil))
The register allocation matrix indicates that reg 447 wound up on the
stack - presumably at (mem:SI (plus:SI (reg:SI 6 %ebp) (const_int -196)).
Reload has apparently decided that it can use %argp as a scratch
register to copy (const_int 0) onto the stack.
;; Register dispositions:
22 in 0 23 in 0 40 in 11 41 in 13 43 in 14 45 in 12
47 in 5 51 in 0 52 in 3 68 in 8 79 in 8 91 in 9
95 in 10 99 in 8 105 in 8 109 in 8 117 in 4 123 in 0
124 in 9 134 in 8 135 in 8 136 in 9 147 in 8 157 in 8
160 in 9 164 in 10 168 in 8 174 in 8 178 in 8 187 in 8
188 in 10 190 in 8 193 in 9 194 in 8 197 in 8 200 in 8
205 in 8 209 in 8 211 in 8 215 in 0 216 in 3 232 in 8
243 in 8 262 in 8 266 in 8 267 in 10 270 in 9 271 in 8
273 in 8 291 in 10 292 in 11 294 in 15 297 in 9 298 in 8
314 in 0 315 in 9 325 in 8 326 in 13 327 in 9 338 in 8
348 in 11 350 in 8 358 in 8 362 in 10 363 in 10 366 in 9
367 in 8 369 in 9 370 in 8 388 in 10 389 in 11 394 in 9
395 in 8 410 in 0 417 in 0 418 in 4 423 in 0 424 in 4
425 in 0 426 in 4 428 in 0 433 in 3 434 in 3 435 in 3
438 in 3 439 in 4 442 in 5 453 in 5 464 in 3 466 in 4
469 in 4 471 in 2 472 in 1 476 in 3 479 in 4 480 in 2
481 in 1 482 in 0
;; Hard regs used: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
The docs imply that hard registers marked in FIXED_REGISTERS may not
be used by register allocation (which I take to include reload), and
argp is so marked, so I'm guessing the bug is there.
zw