This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Remove SUBREG_REGNO_OFFSET.
- From: Kazu Hirata <kazu at hxi dot com>
- To: gcc-patches at gcc dot gnu dot org
- Subject: [patch] Remove SUBREG_REGNO_OFFSET.
Hi,
Attached is a patch to remove SUBREG_REGNO_OFFSET. Although
documented, it does not appear in any port. The patch simply removes
it.
Tested on h8300 port.
OK to apply?
Kazu Hirata
2002-01-31 Kazu Hirata <kazu@hxi.com>
* rtlanal.c (subreg_regno_offset): Do not use
SUBREG_REGNO_OFFSET.
* system.h: Add SUBREG_REGNO_OFFSET to the GCC poison list.
* doc/tm.texi (SUBREG_REGNO_OFFSET): Remove.
Index: rtlanal.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtlanal.c,v
retrieving revision 1.123
diff -u -r1.123 rtlanal.c
--- rtlanal.c 2002/01/18 13:40:33 1.123
+++ rtlanal.c 2002/01/31 19:42:14
@@ -2947,9 +2947,7 @@
xmode - The mode of xregno.
offset - The byte offset.
ymode - The mode of a top level SUBREG (or what may become one).
- RETURN - The regno offset which would be used.
- This function can be overridden by defining SUBREG_REGNO_OFFSET,
- taking the same parameters. */
+ RETURN - The regno offset which would be used. */
unsigned int
subreg_regno_offset (xregno, xmode, offset, ymode)
unsigned int xregno;
@@ -2957,15 +2955,10 @@
unsigned int offset;
enum machine_mode ymode;
{
- unsigned ret;
int nregs_xmode, nregs_ymode;
int mode_multiple, nregs_multiple;
int y_offset;
-/* Check for an override, and use it instead. */
-#ifdef SUBREG_REGNO_OFFSET
- ret = SUBREG_REGNO_OFFSET (xregno, xmode, offset, ymode);
-#else
if (xregno >= FIRST_PSEUDO_REGISTER)
abort ();
@@ -2981,10 +2974,7 @@
y_offset = offset / GET_MODE_SIZE (ymode);
nregs_multiple = nregs_xmode / nregs_ymode;
- ret = (y_offset / (mode_multiple / nregs_multiple)) * nregs_ymode;
-#endif
-
- return ret;
+ return (y_offset / (mode_multiple / nregs_multiple)) * nregs_ymode;
}
/* Return the final regno that a subreg expression refers to. */
Index: system.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/system.h,v
retrieving revision 1.116
diff -u -r1.116 system.h
--- system.h 2002/01/22 14:33:35 1.116
+++ system.h 2002/01/31 19:42:14
@@ -605,7 +605,7 @@
OMIT_EH_TABLE EASY_DIV_EXPR IMPLICIT_FIX_EXPR \
LONGJMP_RESTORE_FROM_STACK MAX_INT_TYPE_SIZE ASM_IDENTIFY_GCC \
STDC_VALUE TRAMPOLINE_ALIGN ASM_IDENTIFY_GCC_AFTER_SOURCE \
- SLOW_ZERO_EXTEND
+ SLOW_ZERO_EXTEND SUBREG_REGNO_OFFSET
#endif /* IN_GCC */
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.95
diff -u -r1.95 tm.texi
--- tm.texi 2002/01/29 23:01:10 1.95
+++ tm.texi 2002/01/31 19:42:23
@@ -1953,25 +1953,6 @@
Define this macro if the compiler should avoid copies to/from @code{CCmode}
registers. You should only define this macro if support for copying to/from
@code{CCmode} is incomplete.
-
-@findex SUBREG_REGNO_OFFSET
-@item SUBREG_REGNO_OFFSET
-Define this macro if the compiler needs to handle subregs in a non-standard
-way. The macro returns the correct regno offset for mode @code{YMODE} given
-a subreg of type @code{XMODE}.
-This macro takes 4 parameters:
-@table @code
-@item XREGNO
-A regno of an inner hard subreg_reg (or what will become one).
-@item XMODE
-The mode of xregno.
-@item OFFSET
-The byte offset.
-@item YMODE
-The mode of a top level SUBREG (or what may become one).
-@end table
-The default function can be found in @file{rtlanal.c}, function
-@code{subreg_regno_offset}. Normally this does not need to be defined.
@end table
@node Leaf Functions