Consider struct s { unsigned a : 1; }; int foo (struct s *p, int b, int c, int d) { p->a = 0; return b; } "./cc1 -quiet -mthumb -fPIC min.c" gives me min.c: In function 'foo': min.c:10: internal compiler error: in thumb_find_work_register, at config/arm/arm.c:3280 Please submit a full bug report, with preprocessed source if appropriate. See <for instructions. This testcase is reduced from libiberty/regex.c.
No.1 | | 223 bytes | |
Additional Comments From pinskia at gcc dot gnu dot org 2005-08-19 02:40 /* Something went wrong - thumb_compute_save_reg_mask() should have arranged for a suitable register to be pushed. */ gcc_unreachable ();
No.2 | | 329 bytes | |
Additional Comments From pinskia at gcc dot gnu dot org 2005-08-19 02:53 Seems like it was caused by:
PR target/23355 * arm.c (thumb_compute_save_reg_mask): Use similar logic to to determine when the PIC register must be saved.
Confirmed, it worked a little bit ago. Also it fails on arm-linux-gnu.
No.3 | | 485 bytes | |
Additional Comments From kazu at gcc dot gnu dot org 2005-08-19 03:11 In fact, reverting Richard Earnshaw's patch
2005-08-15 Richard Earnshaw <richard.earnshaw (AT) arm (DOT) com>
PR target/23355 * arm.c (thumb_compute_save_reg_mask): Use similar logic to to determine when the PIC register must be saved.
fixes the problem (although simply reverting the patch is probably not a good idea because it's supposed to fix PR 23355).
No.4 | | 142 bytes | |
Additional Comments From rearnsha at gcc dot gnu dot org 2005-08-19 09:44 K. I think I understand what's failing here. Testing patch.
No.5 | | 727 bytes | |
Additional Comments From cvs-commit at gcc dot gnu dot org 2005-08-19 13:17 Subject: Bug 23473
Log message: PR target/23473 * arm.md (arm_load_pic_register): Change argument to the mask of saved registers. Call thumb_find_work_register if we need a scratch register on Thumb. (arm_expand_prologue): Pass empty register set to arm_load_pic_register. (thumb_expand_prologue): Pass live_regs_mask directly to arm_load_pic_register. * arm-protos.h (arm_load_pic_register): Update prototype.
Patches:
No.6 | | 84 bytes | |
Additional Comments From rearnsha at gcc dot gnu dot org 2005-08-19 13:17 Fixed.