------- Comment #3 from pinskia at gcc dot gnu dot org 2008-09-24 20:16 ------- Something like this fixes the issue: Index: config/rs6000/rs6000.c =================================================================== --- config/rs6000/rs6000.c (revision 140638) +++ config/rs6000/rs6000.c (working copy) @@ -14082,7 +14082,8 @@ rs6000_expand_compare_and_swapqhi (rtx d HOST_WIDE_INT imask = GET_MODE_MASK (mode);
/* Shift amount for subword relative to aligned word. */ - addrSI = force_reg (SImode, gen_lowpart_common (SImode, XEXP (mem, 0))); + addrSI = force_reg (GET_MODE (XEXP (mem, 0)), XEXP (mem, 0)); + addrSI = force_reg (SImode, gen_lowpart_common (SImode, addrSI)); shift = gen_reg_rtx (SImode); emit_insn (gen_rlwinm (shift, addrSI, GEN_INT (3), GEN_INT (shift_mask))); --- CUT --- gen_lowpart_common does not work on non regs so force the addition to memory first and then get the lowerpart. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|__sync_lock_test_and_set |Misuse of |causes ICE |__sync_lock_test_and_set | |causes ICE http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37640