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]

Re: [RHBZ#150115, s390] reload_out* patterns emit unrecognizable insn


On Mar  4, 2005, Alexandre Oliva <aoliva@redhat.com> wrote:

> libxml2 fails to build with current-ish GCC 4.0 branch on
> s390-linux-gnu because of an unrecognized insn while compiling it with
> -fprofile-generate.

> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=150115

> The problem is that there's an insn that needs a secondary output
> reload that uses the reload_outdi pattern.  This pattern calls
> s390_load_address, that calls gen_force_la_31 with an SImode register
> as the second operand, so the emitted instruction fails to match.  In
> other cases, the operand is not a register, but a (plus:SI), and even
> a (plus:SI (plus:SI)).  I don't see how you could ever get a QImode
> operand at that point, for the insn to stand a even chance to match.

> I realize this patch is more of a kludge than a proper fix, but it
> gets the pattern to match and bootstraps successfully.

This one feels more like a proper fix to me.  And it even fixes the
problem, now that I got a better grasp of it.  Bootstrap almost
complete, regtest to follow.  Ok to install?

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* config/s390/s390.c (s390_load_address): Don't use force_la_31 if
	we got a register as input.

Index: gcc/config/s390/s390.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.c,v
retrieving revision 1.217
diff -u -p -r1.217 s390.c
--- gcc/config/s390/s390.c 17 Feb 2005 20:40:12 -0000 1.217
+++ gcc/config/s390/s390.c 4 Mar 2005 04:08:01 -0000
@@ -3003,7 +3003,7 @@ preferred_la_operand_p (rtx op1, rtx op2
 void
 s390_load_address (rtx dst, rtx src)
 {
-  if (TARGET_64BIT)
+  if (TARGET_64BIT || REG_P (src))
     emit_move_insn (dst, src);
   else
     emit_insn (gen_force_la_31 (dst, src));
-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

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