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]

S/390: Fix Ada bootstrap on s390x (reload problem)


Hello,

Ada bootstrap failed with an ICE on s390x.  The reason was that a
secondary reload was required for a reload generated by 
LEGITIMIZE_RELOAD_ADDRESS.  Unfortunately such reloads contain
temporarily invalid memory RTX expressions; while this is normally
not a problem as they are fixed after reload, it caused the predicate
check of the reload_outti pattern to fail.  Thus reload choose a
simple move as secondary reload insn, which of course failed.

This patch fixes the problem by simply removing the memory_operand
predicate check in the secondary output reload patterns; the check
is redundant anyway since only memory operands are ever flagged
for requiring a secondary output reload.

Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux.
Applied to mainline.

Bye,
Ulrich


ChangeLog:

	* config/s390/s390.md ("reload_outti"): Remove predicate for
	output operand.  Abort if operand is not a MEM.
	("reload_outdi", "reload_outdf"): Likewise.


Index: gcc/config/s390/s390.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.md,v
retrieving revision 1.149
diff -c -p -r1.149 s390.md
*** gcc/config/s390/s390.md	30 Nov 2004 15:31:12 -0000	1.149
--- gcc/config/s390/s390.md	15 Jan 2005 12:59:11 -0000
***************
*** 827,837 ****
  })
  
  (define_expand "reload_outti"
!   [(parallel [(match_operand:TI 0 "memory_operand" "")
                (match_operand:TI 1 "register_operand" "d")
                (match_operand:DI 2 "register_operand" "=&a")])]
    "TARGET_64BIT"
  {
    s390_load_address (operands[2], XEXP (operands[0], 0));
    operands[0] = replace_equiv_address (operands[0], operands[2]);
    emit_move_insn (operands[0], operands[1]);
--- 827,838 ----
  })
  
  (define_expand "reload_outti"
!   [(parallel [(match_operand:TI 0 "" "")
                (match_operand:TI 1 "register_operand" "d")
                (match_operand:DI 2 "register_operand" "=&a")])]
    "TARGET_64BIT"
  {
+   gcc_assert (MEM_P (operands[0]));
    s390_load_address (operands[2], XEXP (operands[0], 0));
    operands[0] = replace_equiv_address (operands[0], operands[2]);
    emit_move_insn (operands[0], operands[1]);
***************
*** 985,995 ****
  })
  
  (define_expand "reload_outdi"
!   [(parallel [(match_operand:DI 0 "memory_operand" "")
                (match_operand:DI 1 "register_operand" "d")
                (match_operand:SI 2 "register_operand" "=&a")])]
    "!TARGET_64BIT"
  {
    s390_load_address (operands[2], XEXP (operands[0], 0));
    operands[0] = replace_equiv_address (operands[0], operands[2]);
    emit_move_insn (operands[0], operands[1]);
--- 986,997 ----
  })
  
  (define_expand "reload_outdi"
!   [(parallel [(match_operand:DI 0 "" "")
                (match_operand:DI 1 "register_operand" "d")
                (match_operand:SI 2 "register_operand" "=&a")])]
    "!TARGET_64BIT"
  {
+   gcc_assert (MEM_P (operands[0]));
    s390_load_address (operands[2], XEXP (operands[0], 0));
    operands[0] = replace_equiv_address (operands[0], operands[2]);
    emit_move_insn (operands[0], operands[1]);
***************
*** 1443,1453 ****
  })
  
  (define_expand "reload_outdf"
!   [(parallel [(match_operand:DF 0 "memory_operand" "")
                (match_operand:DF 1 "register_operand" "d")
                (match_operand:SI 2 "register_operand" "=&a")])]
    "!TARGET_64BIT"
  {
    s390_load_address (operands[2], XEXP (operands[0], 0));
    operands[0] = replace_equiv_address (operands[0], operands[2]);
    emit_move_insn (operands[0], operands[1]);
--- 1445,1456 ----
  })
  
  (define_expand "reload_outdf"
!   [(parallel [(match_operand:DF 0 "" "")
                (match_operand:DF 1 "register_operand" "d")
                (match_operand:SI 2 "register_operand" "=&a")])]
    "!TARGET_64BIT"
  {
+   gcc_assert (MEM_P (operands[0]));
    s390_load_address (operands[2], XEXP (operands[0], 0));
    operands[0] = replace_equiv_address (operands[0], operands[2]);
    emit_move_insn (operands[0], operands[1]);
-- 
  Dr. Ulrich Weigand
  Linux on zSeries Development
  Ulrich.Weigand@de.ibm.com


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