From patchwork Tue Nov 8 14:12:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: RFT: Fix PR middle/end-40154 From: Kaz Kojima X-Patchwork-Id: 124370 Message-Id: <20111108.231211.353111095.kkojima@rr.iij4u.or.jp> To: joern.rennecke@embecosm.com Cc: gcc-patches@gcc.gnu.org Date: Tue, 08 Nov 2011 23:12:11 +0900 (JST) Joern Rennecke wrote: > That's true, and it is by design. > This use of set_unique_reg_note is a bit debatable - add_reg_note > should do just fine there. > > OTOH keeping this as it is, and keeping set_unique_reg_note accepting USE > in this case, seems more conservative for stage3. A tiny change was needed I'm regtesting the patch on SH, though currently many C++ tests fail on SH with undefined reference to `std::atomic_thread_fence(std::memory_order)'. Regards, kaz --- trunk/gcc/emit-rtl.c.orig 2011-11-08 22:46:20.000000000 +0900 +++ trunk/gcc/emit-rtl.c 2011-11-08 22:53:16.000000000 +0900 @@ -4974,7 +4974,7 @@ set_unique_reg_note (rtx insn, enum reg_ } else /* Reload uses USEs with REG_EQUAL notes attached to keep track of reload inhertiance opportunities. */ - gcc_assert (PATTERN (insn) == USE && reload_in_progress); + gcc_assert (GET_CODE (PATTERN (insn)) == USE && reload_in_progress); note = find_reg_note (insn, kind, NULL_RTX); switch (kind)