This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] PR60822 (m68k, missing earlyclobber in extendplussidi)
- From: segher at kernel dot crashing dot org
- To: Jeff Law <law at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 16 Apr 2014 19:20:18 -0500
- Subject: Re: [PATCH] PR60822 (m68k, missing earlyclobber in extendplussidi)
- Authentication-results: sourceware.org; auth=none
- References: <50f4b5de5e870723c49d1bca41bffadc77eb849d dot 1397668443 dot git dot segher at kernel dot crashing dot org> <534EEBE8 dot 4010809 at redhat dot com>
On Wed, Apr 16, 2014 at 02:45:28PM -0600, Jeff Law wrote:
> Isn't the problem that operands 1 is a MEM which use the same register
> as operands 3 in the memory address?
> ISTM either removing the memory constraint entirely, or splitting it off
> into a separate alternative and only earlyclobbering that alternative
> would be better.
> Or am I missing something?
No, that does seem better :-)
I tried both your suggestions; the first results in better code. Here's
a new patch. As before, it builds and fixes the testcase, but I didn't
run the testsuite (I have no emulator set up).
2014-04-16 Segher Boessenkool <firstname.lastname@example.org>
* config/m68k/m68k.md (extendplussidi): Don't allow memory for
gcc/config/m68k/m68k.md | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index e61048b..57ba1a1 100644
@@ -1868,9 +1868,12 @@ (define_insn "extendsidi2"
;; Maybe there is a way to make that the general case, by forcing the
;; result of the SI tree to be in the lower register of the DI target
+;; Don't allow two memory operands: it needs an earlyclobber and will
+;; result in worse code.
[(set (match_operand:DI 0 "register_operand" "=d")
- (sign_extend:DI (plus:SI (match_operand:SI 1 "general_operand" "%rmn")
+ (sign_extend:DI (plus:SI (match_operand:SI 1 "nonmemory_operand" "%rn")
(match_operand:SI 2 "general_operand" "rmn"))))]