This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Committed, MMIX: fix PR43889, missing earlyclobber exposed by r154688


After revision 154688, a clobber in the moddi3 insn was regrenamed to
be the same as the destination, as exposed by the test-cases below,
supposedly because of the missing earlyclobber.  Hilarity ensued.
I must have missed the context of the earlyclobber at the time; it
must be stated for each alternative, not just once for the operand.
That's the only two insns with both more than one alternative as well
as an earlyclobber requirement in this port.  That revision has now
exposed bugs in (IIRC at least) three different ports!

No regressions for trunk r158717, 4.5 branch r158707, fixing
these regressions:

FAIL: gcc.c-torture/execute/arith-rand-ll.c execution,  -O3 -fomit-frame-pointer -funroll-loops
FAIL: gcc.c-torture/execute/arith-rand-ll.c execution,  -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions
FAIL: gcc.c-torture/execute/arith-rand.c execution,  -O3 -fomit-frame-pointer -funroll-loops
FAIL: gcc.c-torture/execute/arith-rand.c execution,  -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions

Committed to trunk and 4.5-branch.  It can be argued that this should
be committed to all open branches.

gcc:
	PR target/43889
	* config/mmix/mmix.md ("*divdi3_nonknuth", "*moddi3_nonknuth"):
	Add missing earlyclobber for second alternative.

Index: gcc/config/mmix/mmix.md
===================================================================
--- gcc/config/mmix/mmix.md	(revision 158753)
+++ gcc/config/mmix/mmix.md	(working copy)
@@ -333,7 +333,7 @@
 ;; The %2-is-%1-case is there just to make sure things don't fail.  Could
 ;; presumably happen with optimizations off; no evidence.
 (define_insn "*divdi3_nonknuth"
-  [(set (match_operand:DI 0 "register_operand" "=&r,r")
+  [(set (match_operand:DI 0 "register_operand" "=&r,&r")
 	(div:DI (match_operand:DI 1 "register_operand" "r,r")
 		(match_operand:DI 2 "register_operand" "1,r")))
    (clobber (match_scratch:DI 3 "=1,1"))
@@ -359,7 +359,7 @@
 ;; The %2-is-%1-case is there just to make sure things don't fail.  Could
 ;; presumably happen with optimizations off; no evidence.
 (define_insn "*moddi3_nonknuth"
-  [(set (match_operand:DI 0 "register_operand" "=&r,r")
+  [(set (match_operand:DI 0 "register_operand" "=&r,&r")
 	(mod:DI (match_operand:DI 1 "register_operand" "r,r")
 		(match_operand:DI 2 "register_operand" "1,r")))
    (clobber (match_scratch:DI 3 "=1,1"))

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]