public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [RS6000] PR61231 lwa_operand related fix
@ 2014-05-22  0:13 Alan Modra
  2014-05-22  0:59 ` David Edelsohn
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Modra @ 2014-05-22  0:13 UTC (permalink / raw)
  To: gcc-patches; +Cc: David Edelsohn, Peter Bergner

This fixes another case where we use the wrong memory constraint.  See
the analysis in the PR.  The rule for operand predicate and
constraints is simply that the union of all constraints must exactly
match the operand predicate.

Bootstrapped and regression tested powerpc64-linux and
powerpc64le-linux.  OK for mainline and active branches?

Note that I didn't see the bootstrap miscompares reported in the PR,
so perhaps there is some other issue to fix besides this one..

	PR target/61231
	* config/rs6000/rs6000.c (mem_operand_gpr): Handle SImode.
	* config/rs6000/rs6000.md (extendsidi2_lfiwax, extendsidi2_nocell):
	Use "Y" constraint rather than "m".

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 210661)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -6124,7 +6127,8 @@ mem_operand_gpr (rtx op, enum machine_mode mode)
     return false;
 
   extra = GET_MODE_SIZE (mode) - UNITS_PER_WORD;
-  gcc_assert (extra >= 0);
+  if (extra < 0)
+    extra = 0;
 
   if (GET_CODE (addr) == LO_SUM)
     /* For lo_sum addresses, we must allow any offset except one that
Index: gcc/config/rs6000/rs6000.md
===================================================================
--- gcc/config/rs6000/rs6000.md	(revision 210661)
+++ gcc/config/rs6000/rs6000.md	(working copy)
@@ -745,7 +745,7 @@
 
 (define_insn "*extendsidi2_lfiwax"
   [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,??wm,!wl,!wu")
-	(sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r,r,Z,Z")))]
+	(sign_extend:DI (match_operand:SI 1 "lwa_operand" "Y,r,r,Z,Z")))]
   "TARGET_POWERPC64 && TARGET_LFIWAX"
   "@
    lwa%U1%X1 %0,%1
@@ -758,7 +758,7 @@
 
 (define_insn "*extendsidi2_nocell"
   [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
-	(sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r")))]
+	(sign_extend:DI (match_operand:SI 1 "lwa_operand" "Y,r")))]
   "TARGET_POWERPC64 && rs6000_gen_cell_microcode && !TARGET_LFIWAX"
   "@
    lwa%U1%X1 %0,%1

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RS6000] PR61231 lwa_operand related fix
  2014-05-22  0:13 [RS6000] PR61231 lwa_operand related fix Alan Modra
@ 2014-05-22  0:59 ` David Edelsohn
  0 siblings, 0 replies; 2+ messages in thread
From: David Edelsohn @ 2014-05-22  0:59 UTC (permalink / raw)
  To: GCC Patches, Peter Bergner, Alan Modra

On Wed, May 21, 2014 at 8:13 PM, Alan Modra <amodra@gmail.com> wrote:
> This fixes another case where we use the wrong memory constraint.  See
> the analysis in the PR.  The rule for operand predicate and
> constraints is simply that the union of all constraints must exactly
> match the operand predicate.
>
> Bootstrapped and regression tested powerpc64-linux and
> powerpc64le-linux.  OK for mainline and active branches?
>
> Note that I didn't see the bootstrap miscompares reported in the PR,
> so perhaps there is some other issue to fix besides this one..
>
>         PR target/61231
>         * config/rs6000/rs6000.c (mem_operand_gpr): Handle SImode.
>         * config/rs6000/rs6000.md (extendsidi2_lfiwax, extendsidi2_nocell):
>         Use "Y" constraint rather than "m".

Okay.

Thanks, David

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-22  0:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-22  0:13 [RS6000] PR61231 lwa_operand related fix Alan Modra
2014-05-22  0:59 ` David Edelsohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).