Hi Jeff, Thanks for the quick review. >> the right test is rtx_equal_p(operands[0], operands[1]) Committed with above changes to the bsetqi_msx, bclrqi_msx and bnotqi_msx patterns.
Thanks & Regards, Kaushik Phatak www.kpitgnutools.com -----Original Message----- From: Jeff Law [mailto:l...@redhat.com] Sent: 11 June 2011 00:01 To: Kaushik Phatak Cc: gcc-patches@gcc.gnu.org; Prafulla Thakare Subject: Re: [Patch : H8300] Bug fix for bit insn and minor tweaks to insns -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 06/09/11 01:20, Kaushik Phatak wrote: > Hi, > The following patch fixes an ICE that is generated when the compiler tries > to perform bit manipulation for logical operations when the source and > destination address does not match. The testcase is also included in the > patch(gcc.dg). > The additional condition in the insn takes care of the ICE which occurs at > '-O1'. > The other insn's are reordered to give preference to bit instructions using > existing > constraints. > Ok to apply? > > Thanks & Regards, > Kaushik Phatak > www.kpitgnutools.com > > 2011-06-09 Kaushik Phatak <kaushik.pha...@kpitcummins.com> > > * config/h8300/h8300.md (bsetqi_msx, bclrqi_msx, bnotqi_msx): Added > condition to disallow non-identical memory locations. > (*andqi3_2, andqi3_1, iorqi3_1, xorqi3_1): Reorder insn to give > preference to bit manipulation instructions. > * gcc.dg/h8300-bit-insn-ice2.2: New testcase. Can't the operand be MEM (reg) or MEM (const_int)? In which case INTVAL (XEXP (operands[], 0)) is the wrong test since you shouldn't be applying INTVAL to a REG. Furthermore, if you're trying to compare CONST_INTs, those are shared and you can use pointer equality rather than their underlying value. Regardless, I think the right test is rtx_equal_p (operands[0], operands[1], NULL) With that change to bsetqi_msx, bclrqi_msx and bnotqi_msx this patch is OK. jeff -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJN8mMBAAoJEBRtltQi2kC7NjUIAJDylrPPoI6YMk4lfRwclIPT VCzk31q3DpZ3H5CEv8e6u7DmmJl9ng78uYHXejAqTbpAn/mDOtEWasBIUIhTACFF UgH3bK3wwhF412Dbr/6ND/dPCMiImzSUR8PC8N6S31k8q5JmXIkfVfX/oKaSH/n6 9VxyIfh7PmGRqjMlH434DyvOvH+qPfN3jSNLVHDvUeVYKI6gnfXtR8tuHTlIw4LO eiubgvmD4RXa6Nnpeuafs8GyTCRA5jbVU2jf3ZR3jBA08YpS/cSeECd19ytSdVuS Au20hmDPStkJwr/0kw+QtqeZRg5BP4JWF0COYQJDFQVa64Gt6LEterBmntPJr8g= =JdgV -----END PGP SIGNATURE-----