Commit 49d801d3 by Jan Hubicka Committed by Jan Hubicka

dbxout.c (dbxout_symbol_location): Update call of alter_subreg.

	* dbxout.c (dbxout_symbol_location): Update call of alter_subreg.
	* final.c (walk_alter_subreg): Take pointer; update call of alter_subreg.
	(final_scan_insn): Update call of alter_subreg.
	(cleanup_subreg_operands): Likewise.
	(alter_subreg): Rewrite using simplify_subreg.
	(output_address, output_operand): Update call of alter_subreg.
	* output.h (alter_subreg): Update prototype.
	* sdbout.c (sdbout_symbol): Update call of alter_subreg.
	* simplify-rtx.c (simplify_subreg): Copy ORIGINAL_REGNO.
	* Makefile.in (final.o): Add depdendancy on expr.h

From-SVN: r47013
parent 373bd0fa
Wed Nov 14 14:17:05 CET 2001 Jan Hubicka <jh@suse.cz>
* dbxout.c (dbxout_symbol_location): Update call of alter_subreg.
* final.c (walk_alter_subreg): Take pointer; update call of alter_subreg.
(final_scan_insn): Update call of alter_subreg.
(cleanup_subreg_operands): Likewise.
(alter_subreg): Rewrite using simplify_subreg.
(output_address, output_operand): Update call of alter_subreg.
* output.h (alter_subreg): Update prototype.
* sdbout.c (sdbout_symbol): Update call of alter_subreg.
* simplify-rtx.c (simplify_subreg): Copy ORIGINAL_REGNO.
* Makefile.in (final.o): Add depdendancy on expr.h
Wed Nov 14 06:37:54 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Wed Nov 14 06:37:54 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* c-lang.c (finish_file): Make I unsigned to eliminate warning. * c-lang.c (finish_file): Make I unsigned to eliminate warning.
......
...@@ -1575,7 +1575,7 @@ sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) sched-int.h \ ...@@ -1575,7 +1575,7 @@ sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) sched-int.h \
final.o : final.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h intl.h \ final.o : final.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h intl.h \
$(REGS_H) $(RECOG_H) conditions.h insn-config.h $(INSN_ATTR_H) function.h \ $(REGS_H) $(RECOG_H) conditions.h insn-config.h $(INSN_ATTR_H) function.h \
real.h output.h hard-reg-set.h except.h debug.h xcoffout.h \ real.h output.h hard-reg-set.h except.h debug.h xcoffout.h \
toplev.h reload.h dwarf2out.h $(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H) toplev.h reload.h dwarf2out.h $(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H) $(EXPR_H)
recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) function.h $(BASIC_BLOCK_H) \ recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) function.h $(BASIC_BLOCK_H) \
$(REGS_H) $(RECOG_H) $(EXPR_H) hard-reg-set.h flags.h insn-config.h \ $(REGS_H) $(RECOG_H) $(EXPR_H) hard-reg-set.h flags.h insn-config.h \
$(INSN_ATTR_H) real.h toplev.h output.h reload.h $(TM_P_H) $(INSN_ATTR_H) real.h toplev.h output.h reload.h $(TM_P_H)
......
...@@ -2107,7 +2107,7 @@ dbxout_symbol_location (decl, type, suffix, home) ...@@ -2107,7 +2107,7 @@ dbxout_symbol_location (decl, type, suffix, home)
if (REGNO (value) >= FIRST_PSEUDO_REGISTER) if (REGNO (value) >= FIRST_PSEUDO_REGISTER)
return 0; return 0;
} }
home = alter_subreg (home); home = alter_subreg (&home);
} }
if (GET_CODE (home) == REG) if (GET_CODE (home) == REG)
{ {
......
...@@ -67,6 +67,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -67,6 +67,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "basic-block.h" #include "basic-block.h"
#include "target.h" #include "target.h"
#include "debug.h" #include "debug.h"
#include "expr.h"
#ifdef XCOFF_DEBUGGING_INFO #ifdef XCOFF_DEBUGGING_INFO
#include "xcoffout.h" /* Needed for external data #include "xcoffout.h" /* Needed for external data
...@@ -242,7 +243,7 @@ static void profile_after_prologue PARAMS ((FILE *)); ...@@ -242,7 +243,7 @@ static void profile_after_prologue PARAMS ((FILE *));
static void add_bb PARAMS ((FILE *)); static void add_bb PARAMS ((FILE *));
static int add_bb_string PARAMS ((const char *, int)); static int add_bb_string PARAMS ((const char *, int));
static void notice_source_line PARAMS ((rtx)); static void notice_source_line PARAMS ((rtx));
static rtx walk_alter_subreg PARAMS ((rtx)); static rtx walk_alter_subreg PARAMS ((rtx *));
static void output_asm_name PARAMS ((void)); static void output_asm_name PARAMS ((void));
static tree get_decl_from_op PARAMS ((rtx, int *)); static tree get_decl_from_op PARAMS ((rtx, int *));
static void output_asm_operand_names PARAMS ((rtx *, int *, int)); static void output_asm_operand_names PARAMS ((rtx *, int *, int));
...@@ -2634,15 +2635,15 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) ...@@ -2634,15 +2635,15 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
&& insn != last_ignored_compare) && insn != last_ignored_compare)
{ {
if (GET_CODE (SET_SRC (set)) == SUBREG) if (GET_CODE (SET_SRC (set)) == SUBREG)
SET_SRC (set) = alter_subreg (SET_SRC (set)); SET_SRC (set) = alter_subreg (&SET_SRC (set));
else if (GET_CODE (SET_SRC (set)) == COMPARE) else if (GET_CODE (SET_SRC (set)) == COMPARE)
{ {
if (GET_CODE (XEXP (SET_SRC (set), 0)) == SUBREG) if (GET_CODE (XEXP (SET_SRC (set), 0)) == SUBREG)
XEXP (SET_SRC (set), 0) XEXP (SET_SRC (set), 0)
= alter_subreg (XEXP (SET_SRC (set), 0)); = alter_subreg (&XEXP (SET_SRC (set), 0));
if (GET_CODE (XEXP (SET_SRC (set), 1)) == SUBREG) if (GET_CODE (XEXP (SET_SRC (set), 1)) == SUBREG)
XEXP (SET_SRC (set), 1) XEXP (SET_SRC (set), 1)
= alter_subreg (XEXP (SET_SRC (set), 1)); = alter_subreg (&XEXP (SET_SRC (set), 1));
} }
if ((cc_status.value1 != 0 if ((cc_status.value1 != 0
&& rtx_equal_p (SET_SRC (set), cc_status.value1)) && rtx_equal_p (SET_SRC (set), cc_status.value1))
...@@ -3004,21 +3005,21 @@ cleanup_subreg_operands (insn) ...@@ -3004,21 +3005,21 @@ cleanup_subreg_operands (insn)
for (i = 0; i < recog_data.n_operands; i++) for (i = 0; i < recog_data.n_operands; i++)
{ {
if (GET_CODE (recog_data.operand[i]) == SUBREG) if (GET_CODE (recog_data.operand[i]) == SUBREG)
recog_data.operand[i] = alter_subreg (recog_data.operand[i]); recog_data.operand[i] = alter_subreg (recog_data.operand_loc[i]);
else if (GET_CODE (recog_data.operand[i]) == PLUS else if (GET_CODE (recog_data.operand[i]) == PLUS
|| GET_CODE (recog_data.operand[i]) == MULT || GET_CODE (recog_data.operand[i]) == MULT
|| GET_CODE (recog_data.operand[i]) == MEM) || GET_CODE (recog_data.operand[i]) == MEM)
recog_data.operand[i] = walk_alter_subreg (recog_data.operand[i]); recog_data.operand[i] = walk_alter_subreg (recog_data.operand_loc[i]);
} }
for (i = 0; i < recog_data.n_dups; i++) for (i = 0; i < recog_data.n_dups; i++)
{ {
if (GET_CODE (*recog_data.dup_loc[i]) == SUBREG) if (GET_CODE (*recog_data.dup_loc[i]) == SUBREG)
*recog_data.dup_loc[i] = alter_subreg (*recog_data.dup_loc[i]); *recog_data.dup_loc[i] = alter_subreg (recog_data.dup_loc[i]);
else if (GET_CODE (*recog_data.dup_loc[i]) == PLUS else if (GET_CODE (*recog_data.dup_loc[i]) == PLUS
|| GET_CODE (*recog_data.dup_loc[i]) == MULT || GET_CODE (*recog_data.dup_loc[i]) == MULT
|| GET_CODE (*recog_data.dup_loc[i]) == MEM) || GET_CODE (*recog_data.dup_loc[i]) == MEM)
*recog_data.dup_loc[i] = walk_alter_subreg (*recog_data.dup_loc[i]); *recog_data.dup_loc[i] = walk_alter_subreg (recog_data.dup_loc[i]);
} }
} }
...@@ -3026,66 +3027,42 @@ cleanup_subreg_operands (insn) ...@@ -3026,66 +3027,42 @@ cleanup_subreg_operands (insn)
based on the thing it is a subreg of. */ based on the thing it is a subreg of. */
rtx rtx
alter_subreg (x) alter_subreg (xp)
rtx x; rtx *xp;
{ {
rtx x = *xp;
rtx y = SUBREG_REG (x); rtx y = SUBREG_REG (x);
if (GET_CODE (y) == SUBREG) /* simplify_subreg does not remove subreg from volatile references.
y = alter_subreg (y); We are required to. */
if (GET_CODE (y) == MEM)
/* If reload is operating, we may be replacing inside this SUBREG. *xp = adjust_address (y, GET_MODE (x), SUBREG_BYTE (x));
Check for that and make a new one if so. */ else
if (reload_in_progress && find_replacement (&SUBREG_REG (x)) != 0) *xp = simplify_subreg (GET_MODE (x), y, GET_MODE (y), SUBREG_BYTE (x));
x = copy_rtx (x); return *xp;
if (GET_CODE (y) == REG)
{
int regno = subreg_hard_regno (x, 1);
PUT_CODE (x, REG);
REGNO (x) = regno;
ORIGINAL_REGNO (x) = ORIGINAL_REGNO (y);
/* This field has a different meaning for REGs and SUBREGs. Make sure
to clear it! */
x->used = 0;
}
else if (GET_CODE (y) == MEM)
{
HOST_WIDE_INT offset = SUBREG_BYTE (x);
/* Catch these instead of generating incorrect code. */
if ((offset % GET_MODE_SIZE (GET_MODE (x))) != 0)
abort ();
PUT_CODE (x, MEM);
MEM_COPY_ATTRIBUTES (x, y);
XEXP (x, 0) = plus_constant (XEXP (y, 0), offset);
}
return x;
} }
/* Do alter_subreg on all the SUBREGs contained in X. */ /* Do alter_subreg on all the SUBREGs contained in X. */
static rtx static rtx
walk_alter_subreg (x) walk_alter_subreg (xp)
rtx x; rtx *xp;
{ {
rtx x = *xp;
switch (GET_CODE (x)) switch (GET_CODE (x))
{ {
case PLUS: case PLUS:
case MULT: case MULT:
XEXP (x, 0) = walk_alter_subreg (XEXP (x, 0)); XEXP (x, 0) = walk_alter_subreg (&XEXP (x, 0));
XEXP (x, 1) = walk_alter_subreg (XEXP (x, 1)); XEXP (x, 1) = walk_alter_subreg (&XEXP (x, 1));
break; break;
case MEM: case MEM:
XEXP (x, 0) = walk_alter_subreg (XEXP (x, 0)); XEXP (x, 0) = walk_alter_subreg (&XEXP (x, 0));
break; break;
case SUBREG: case SUBREG:
return alter_subreg (x); return alter_subreg (xp);
default: default:
break; break;
...@@ -3624,7 +3601,7 @@ output_operand (x, code) ...@@ -3624,7 +3601,7 @@ output_operand (x, code)
int code ATTRIBUTE_UNUSED; int code ATTRIBUTE_UNUSED;
{ {
if (x && GET_CODE (x) == SUBREG) if (x && GET_CODE (x) == SUBREG)
x = alter_subreg (x); x = alter_subreg (&x);
/* If X is a pseudo-register, abort now rather than writing trash to the /* If X is a pseudo-register, abort now rather than writing trash to the
assembler file. */ assembler file. */
...@@ -3643,7 +3620,7 @@ void ...@@ -3643,7 +3620,7 @@ void
output_address (x) output_address (x)
rtx x; rtx x;
{ {
walk_alter_subreg (x); walk_alter_subreg (&x);
PRINT_OPERAND_ADDRESS (asm_out_file, x); PRINT_OPERAND_ADDRESS (asm_out_file, x);
} }
......
...@@ -77,7 +77,7 @@ extern rtx final_scan_insn PARAMS ((rtx, FILE *, int, int, int)); ...@@ -77,7 +77,7 @@ extern rtx final_scan_insn PARAMS ((rtx, FILE *, int, int, int));
/* Replace a SUBREG with a REG or a MEM, based on the thing it is a /* Replace a SUBREG with a REG or a MEM, based on the thing it is a
subreg of. */ subreg of. */
extern rtx alter_subreg PARAMS ((rtx)); extern rtx alter_subreg PARAMS ((rtx *));
/* Report inconsistency between the assembler template and the operands. /* Report inconsistency between the assembler template and the operands.
In an `asm', it's the user's fault; otherwise, the compiler's fault. */ In an `asm', it's the user's fault; otherwise, the compiler's fault. */
......
...@@ -809,7 +809,7 @@ sdbout_symbol (decl, local) ...@@ -809,7 +809,7 @@ sdbout_symbol (decl, local)
if (REGNO (value) >= FIRST_PSEUDO_REGISTER) if (REGNO (value) >= FIRST_PSEUDO_REGISTER)
return; return;
} }
regno = REGNO (alter_subreg (DECL_RTL (decl))); regno = REGNO (alter_subreg (&DECL_RTL (decl)));
value = DECL_RTL (decl); value = DECL_RTL (decl);
} }
/* Don't output anything if an auto variable /* Don't output anything if an auto variable
......
...@@ -2587,7 +2587,18 @@ simplify_subreg (outermode, op, innermode, byte) ...@@ -2587,7 +2587,18 @@ simplify_subreg (outermode, op, innermode, byte)
arguments are passed on 32-bit Sparc and should be fixed. */ arguments are passed on 32-bit Sparc and should be fixed. */
if (HARD_REGNO_MODE_OK (final_regno, outermode) if (HARD_REGNO_MODE_OK (final_regno, outermode)
|| ! HARD_REGNO_MODE_OK (REGNO (op), innermode)) || ! HARD_REGNO_MODE_OK (REGNO (op), innermode))
return gen_rtx_REG (outermode, final_regno); {
rtx x = gen_rtx_REG (outermode, final_regno);
/* Propagate original regno. We don't have any way to specify
the offset inside orignal regno, so do so only for lowpart.
The information is used only by alias analysis that can not
grog partial register anyway. */
if (subreg_lowpart_offset (outermode, innermode) == byte)
ORIGINAL_REGNO (x) = ORIGINAL_REGNO (op);
return x;
}
} }
/* If we have a SUBREG of a register that we are replacing and we are /* If we have a SUBREG of a register that we are replacing and we are
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment