[Bug target/37640] Misuse of __sync_lock_test_and_set causes ICE
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Sep 24 20:17:00 GMT 2008
------- 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
More information about the Gcc-bugs
mailing list