Message ID | 4FA0FF4E.5030205@redhat.com |
---|---|
State | New |
Headers | show |
Make sure a match_dup will still match the generated pattern later, I've had problems with match_dup not matching two rtx that rtx_equals() says are "the same" but not physically the same.
Hi DJ, > Make sure a match_dup will still match the generated pattern later, > I've had problems with match_dup not matching two rtx that > rtx_equals() says are "the same" but not physically the same. I have tried, but failed, to find a way to trigger the use of the bset_qi pattern. :-( I tried rebuilding the toolchain and running the GCC testsuite, but neither of these worked. Do you have a test case that triggers it ? Cheers Nick
#define q ((char *)0x1234) foo(int x) { *q |= (1 << (char)x); } $ m32c-elf-gcc -S -O3 nick.c .global _foo _foo: mov.w r1,a0 ; 20 movhi_op/3 bset 4660[a0] ; 11 bset_qi rts ; 23 epilogue_rts
Hi DJ, Thanks for the test program. With that I can confirm that the match_dup does work and that the bset instruction is still generated even with my patch applied. OK to apply ? Cheers Nick
> OK to apply ?
Ok. Thanks!
Index: gcc/config/m32c/bitops.md =================================================================== --- gcc/config/m32c/bitops.md (revision 187036) +++ gcc/config/m32c/bitops.md (working copy) @@ -43,7 +43,7 @@ [(set (match_operand:QI 0 "memsym_operand" "+Si") (ior:QI (subreg:QI (ashift:HI (const_int 1) (subreg:QI (match_operand:HI 1 "a_qi_operand" "Raa") 0)) 0) - (match_operand:QI 2 "memsym_operand" "0")))] + (match_dup 0)))] "TARGET_A16" "bset\t%0[%1]" [(set_attr "flags" "n")]