summaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-01 01:09:35 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-01 01:09:35 +0000
commit1a6a0f2a8b031758448b9f00219811342cb433a1 (patch)
treeef18ae23759d8cebf30524fd23a40023979adb9e /gcc/emit-rtl.c
parentae8bbff506d08a4a512f533c0e9e916ee44dd205 (diff)
downloadgcc-1a6a0f2a8b031758448b9f00219811342cb433a1.tar.gz
gcc/:
* lower-subreg.c: New file. * rtl.def (CONCATN): Define. * passes.c (init_optimization_passes): Add pass_lower_subreg and pass_lower_subreg2. * emit-rtl.c (update_reg_offset): New static function, broken out of gen_rtx_REG_offset. (gen_rtx_REG_offset): Call update_reg_offset. (gen_reg_rtx_offset): New function. * regclass.c: Revert patch of 2006-03-05, restoring reg_scan_update. (clear_reg_info_regno): New function. * dwarf2out.c (concatn_loc_descriptor): New static function. (loc_descriptor): Handle CONCATN. * common.opt (fsplit_wide_types): New option. * opts.c (decode_options): Set flag_split_wide_types when optimizing. * timevar.def (TV_LOWER_SUBREG): Define. * rtl.h (gen_reg_rtx_offset): Declare. (reg_scan_update): Declare. * regs.h (clear_reg_info_regno): Declare. * tree-pass.h (pass_lower_subreg): Declare. (pass_lower_subreg2): Declare. * doc/invoke.texi (Option Summary): List -fno-split-wide-types. (Optimize Options): Add -fsplit-wide-types to -O1 list. Document -fsplit-wide-types. * doc/rtl.texi (Regs and Memory): Document concat and concatn. * Makefile.in (OBJS-common): Add lower-subreg.o. (lower-subreg.o): New target. gcc/testsuite/: * gcc.dg/lower-subreg-1.c (test): New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121453 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index aba4b7f7166..871ca386b02 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -1,6 +1,6 @@
/* Emit RTL for the GCC expander.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of GCC.
@@ -812,13 +812,12 @@ gen_reg_rtx (enum machine_mode mode)
return val;
}
-/* Generate a register with same attributes as REG, but offsetted by OFFSET.
+/* Update NEW with the same attributes as REG, but offsetted by OFFSET.
Do the big endian correction if needed. */
-rtx
-gen_rtx_REG_offset (rtx reg, enum machine_mode mode, unsigned int regno, int offset)
+static void
+update_reg_offset (rtx new, rtx reg, int offset)
{
- rtx new = gen_rtx_REG (mode, regno);
tree decl;
HOST_WIDE_INT var_size;
@@ -860,7 +859,7 @@ gen_rtx_REG_offset (rtx reg, enum machine_mode mode, unsigned int regno, int off
if ((BYTES_BIG_ENDIAN || WORDS_BIG_ENDIAN)
&& decl != NULL
&& offset > 0
- && GET_MODE_SIZE (GET_MODE (reg)) > GET_MODE_SIZE (mode)
+ && GET_MODE_SIZE (GET_MODE (reg)) > GET_MODE_SIZE (GET_MODE (new))
&& ((var_size = int_size_in_bytes (TREE_TYPE (decl))) > 0
&& var_size < GET_MODE_SIZE (GET_MODE (reg))))
{
@@ -904,6 +903,30 @@ gen_rtx_REG_offset (rtx reg, enum machine_mode mode, unsigned int regno, int off
REG_ATTRS (new) = get_reg_attrs (REG_EXPR (reg),
REG_OFFSET (reg) + offset);
+}
+
+/* Generate a register with same attributes as REG, but offsetted by
+ OFFSET. */
+
+rtx
+gen_rtx_REG_offset (rtx reg, enum machine_mode mode, unsigned int regno,
+ int offset)
+{
+ rtx new = gen_rtx_REG (mode, regno);
+
+ update_reg_offset (new, reg, offset);
+ return new;
+}
+
+/* Generate a new pseudo-register with the same attributes as REG, but
+ offsetted by OFFSET. */
+
+rtx
+gen_reg_rtx_offset (rtx reg, enum machine_mode mode, int offset)
+{
+ rtx new = gen_reg_rtx (mode);
+
+ update_reg_offset (new, reg, offset);
return new;
}