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]

Patch: fix bug in variable-array patch


This adjust my earlier patch

http://gcc.gnu.org/ml/gcc-patches/2002-08/msg00838.html

to fix the bug reported by Rainer Orth.  It seems Ada creates
some memory clobbers that need to be deleted in reload, so this
changes the test in reload to look more specifically for those
clobbers that were introduced for variable arrays.  Bootstrapped
on Darwin, and Rainer Orth reports that it fixes his Ada problem.

Attachment: diffs
Description: Binary data



Index: reload1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload1.c,v
retrieving revision 1.354
diff -u -d -b -w -c -3 -p -r1.354 reload1.c
*** reload1.c 14 Aug 2002 17:41:47 -0000 1.354
--- reload1.c 5 Sep 2002 18:09:09 -0000
*************** reload (first, global)
*** 1180,1188 ****

/* Make a pass over all the insns and delete all USEs which we inserted
only to tag a REG_EQUAL note on them. Remove all REG_DEAD and REG_UNUSED
! notes. Delete all CLOBBER insns that don't refer to the return value
! or to memory (mem:BLK CLOBBERs must be retained to prevent the scheduler
! from misarranging variable-array code) and simplify (subreg (reg))
operands. Also remove all REG_RETVAL and REG_LIBCALL notes since they
are no longer useful or accurate. Strip and regenerate REG_INC notes
that may have been moved around. */
--- 1180,1188 ----

/* Make a pass over all the insns and delete all USEs which we inserted
only to tag a REG_EQUAL note on them. Remove all REG_DEAD and REG_UNUSED
! notes. Delete all CLOBBER insns, except those that refer to the return
! value and the special mem:BLK CLOBBERs added to prevent the scheduler
! from misarranging variable-array code, and simplify (subreg (reg))
operands. Also remove all REG_RETVAL and REG_LIBCALL notes since they
are no longer useful or accurate. Strip and regenerate REG_INC notes
that may have been moved around. */
*************** reload (first, global)
*** 1203,1209 ****
|| find_reg_note (insn, REG_EQUAL, NULL_RTX)))
|| (GET_CODE (PATTERN (insn)) == CLOBBER
&& (GET_CODE (XEXP (PATTERN (insn), 0)) != MEM
! || GET_MODE (XEXP (PATTERN (insn), 0)) != BLKmode)
&& (GET_CODE (XEXP (PATTERN (insn), 0)) != REG
|| ! REG_FUNCTION_VALUE_P (XEXP (PATTERN (insn), 0)))))
{
--- 1203,1212 ----
|| find_reg_note (insn, REG_EQUAL, NULL_RTX)))
|| (GET_CODE (PATTERN (insn)) == CLOBBER
&& (GET_CODE (XEXP (PATTERN (insn), 0)) != MEM
! || GET_MODE (XEXP (PATTERN (insn), 0)) != BLKmode
! || (GET_CODE (XEXP (XEXP (PATTERN (insn), 0), 0)) != SCRATCH
! && XEXP (XEXP (PATTERN (insn), 0), 0)
! != stack_pointer_rtx))
&& (GET_CODE (XEXP (PATTERN (insn), 0)) != REG
|| ! REG_FUNCTION_VALUE_P (XEXP (PATTERN (insn), 0)))))
{

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