This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH COMMITTED: More lower-subreg tweaks
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: aesok at post dot ru, zadeck at naturalbridge dot com
- Date: 06 Feb 2007 09:21:04 -0800
- Subject: PATCH COMMITTED: More lower-subreg tweaks
I've committed a couple of more tweaks to lower-subreg.c:
1) Another fix for size of pointer_mode > size of word_mode: don't
treat CONST as a simple move operand.
2) Use validate_change when changing the operand of a clobber, to work
better with dataflow-branch.
Bootstrapped and tested on i686-pc-linux-gnu. Committed.
Ian
2007-02-06 Ian Lance Taylor <iant@google.com>
* lower-subreg.c (simple_move_operand): Reject CONST.
(resolve_clobber): Call validate_change rather than directly
assigning to XEXP (pat, 0).
Index: lower-subreg.c
===================================================================
--- lower-subreg.c (revision 121651)
+++ lower-subreg.c (working copy)
@@ -80,7 +80,8 @@ simple_move_operand (rtx x)
if (GET_CODE (x) == LABEL_REF
|| GET_CODE (x) == SYMBOL_REF
- || GET_CODE (x) == HIGH)
+ || GET_CODE (x) == HIGH
+ || GET_CODE (x) == CONST)
return false;
if (MEM_P (x)
@@ -832,6 +833,7 @@ resolve_clobber (rtx pat, rtx insn)
rtx reg;
enum machine_mode orig_mode;
unsigned int words, i;
+ int ret;
reg = XEXP (pat, 0);
if (!resolve_reg_p (reg) && !resolve_subreg_p (reg))
@@ -841,7 +843,12 @@ resolve_clobber (rtx pat, rtx insn)
words = GET_MODE_SIZE (orig_mode);
words = (words + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
- XEXP (pat, 0) = simplify_gen_subreg_concatn (word_mode, reg, orig_mode, 0);
+ ret = validate_change (NULL_RTX, &XEXP (pat, 0),
+ simplify_gen_subreg_concatn (word_mode, reg,
+ orig_mode, 0),
+ 0);
+ gcc_assert (ret != 0);
+
for (i = words - 1; i > 0; --i)
{
rtx x;