This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/37640] Misuse of __sync_lock_test_and_set causes ICE
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Sep 2008 20:16:23 -0000
- Subject: [Bug target/37640] Misuse of __sync_lock_test_and_set causes ICE
- References: <bug-37640-8090@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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