This is the mail archive of the gcc@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]

Merged ARM-Thumb branch...


Hi guys,

I've been through my patches for gcc-2.95.2, and checked to see if they were in
the branch.  My earlier patch was not sufficient.  I came up with the following
list of problems/questions.  This list was generated from a visual inspection of
my patches only.  Some of the stuff below requires further investigation, which
I will do in the next little while as I have time.  In the meantime I'd
appreciate your comments.  Feel free to solve my problems however :).

1) gcc/config/arm/linux-oldld.h is in my 2.95.2 patches and the mainline, but
not in the branch.  It should have been moved over I believe.  I can generate a
patch if needed.

2) My java patches were accepted and made it to the mainline code, but not to
the branch.  Could they be applied to the branch as well?  See
http://gcc.gnu.org/ml/gcc-patches/2000-01/msg01157.html for the details.

3) FUNCTION_PROFILER is defined in arm.h.  It uses two other defines
(ARM_FUNCTION_PROFILER, THUMB_FUNCTION_PROFILER).  In linux-elf.h
FUNCTION_PROFILER is undefined, then redefined.  I need to test this again, but
the definition in linux-elf.h is the one I have been using since 2.8.1 with
glibc 2.x.  I think it should probably undefine ARM_FUNCTION_PROFILER then
redefine it, rather than FUNCTION_PROFILER.  The other alternative is the
current definition of ARM_PROFILER is broken, or needed for other platforms. 
Comments?

4) The following patch to arm.md is needed for pic mode.  I have no changelog,
and I think Phil made it, but I am not sure.  

Index: arm.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/arm/arm.md,v
retrieving revision 1.34.2.11
diff -u -p -r1.34.2.11 arm.md
--- arm.md      2000/02/02 19:55:48     1.34.2.11
+++ arm.md      2000/02/09 15:17:40
@@ -3793,7 +3793,8 @@
         }
     }
     
-  if (CONSTANT_P (operands[1]) && flag_pic)
+  if (CONSTANT_P (operands[1]) || symbol_mentioned_p (operands[1])
+       || label_mentioned_p (operands[1]) && flag_pic)
     operands[1] = legitimize_pic_address
       (operands[1], SImode, ((reload_in_progress || reload_completed)
                             ? operands[0] : 0));

5) The following patch fixed a problem with purge_addressof_1.  It is not in the
mainline or the branch.  This needs to be checked, and integrated if necessary. 
Unless there is some other reason it shouldn't be.  The original bug report is
here http://gcc.gnu.org/ml/gcc-bugs/1999-06/msg00773.html.

Fri Jul 16 10:29:48 1999  Philip Blundell  <pb@futuretv.com>
        * function.c (rtx_equal_for_addressof_p): New function.
        (purge_addressof_1): Use it instead of rtx_equal_p.

diff -uNpr gcc-2.95.2.orig/gcc/function.c gcc-2.95.2/gcc/function.c
--- gcc-2.95.2.orig/gcc/function.c      Tue Sep  7 03:34:04 1999
+++ gcc-2.95.2/gcc/function.c   Sat Feb  5 07:56:05 2000
@@ -3043,6 +3043,105 @@ static rtx purge_bitfield_addressof_repl
    extracted by usage MEM with narrower mode. */
 static rtx purge_addressof_replacements;
 
+/* Return 1 if X and Y are identical-looking rtx's.
+   This is the Lisp function EQUAL for rtx arguments.  */
+
+int
+rtx_equal_for_addressof_p (x, y)
+     rtx x, y;
+{
+  register int i;
+  register int j;
+  register enum rtx_code code;
+  register char *fmt;
+
+  if (x == y)
+    return 1;
+  if (x == 0 || y == 0)
+    return 0;
+
+  code = GET_CODE (x);
+  /* Rtx's of different codes cannot be equal.  */
+  if (code != GET_CODE (y))
+    return 0;
+
+  /* (MULT:SI x y) and (MULT:HI x y) are NOT equivalent.
+     (REG:SI x) and (REG:HI x) are NOT equivalent. 
+     But (MEM:SI x) and (MEM:HI x) are equivalent for our purposes.  */
+
+  if (code != MEM && (GET_MODE (x) != GET_MODE (y)))
+    return 0;
+
+  /* REG, LABEL_REF, and SYMBOL_REF can be compared nonrecursively.  */
+
+  if (code == REG)
+    return REGNO (x) == REGNO (y);
+  else if (code == LABEL_REF)
+    return XEXP (x, 0) == XEXP (y, 0);
+  else if (code == SYMBOL_REF)
+    return XSTR (x, 0) == XSTR (y, 0);
+  else if (code == SCRATCH || code == CONST_DOUBLE)
+    return 0;
+
+  /* Compare the elements.  If any pair of corresponding elements
+     fail to match, return 0 for the whole things.  */
+
+  fmt = GET_RTX_FORMAT (code);
+  for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
+    {
+      switch (fmt[i])
+       {
+       case 'w':
+         if (XWINT (x, i) != XWINT (y, i))
+           return 0;
+         break;
+
+       case 'n':
+       case 'i':
+         if (XINT (x, i) != XINT (y, i))
+           return 0;
+         break;
+
+       case 'V':
+       case 'E':
+         /* Two vectors must have the same length.  */
+         if (XVECLEN (x, i) != XVECLEN (y, i))
+           return 0;
+
+         /* And the corresponding elements must match.  */
+         for (j = 0; j < XVECLEN (x, i); j++)
+           if (rtx_equal_p (XVECEXP (x, i, j), XVECEXP (y, i, j)) == 0)
+             return 0;
+         break;
+
+       case 'e':
+         if (rtx_equal_p (XEXP (x, i), XEXP (y, i)) == 0)
+           return 0;
+         break;
+
+       case 'S':
+       case 's':
+         if (strcmp (XSTR (x, i), XSTR (y, i)))
+           return 0;
+         break;
+
+       case 'u':
+         /* These are just backpointers, so they don't matter.  */
+         break;
+
+       case '0':
+         break;
+
+         /* It is believed that rtx's at this level will never
+            contain anything but integers and other rtx's,
+            except for within LABEL_REFs and SYMBOL_REFs.  */
+       default:
+         abort ();
+       }
+    }
+  return 1;
+}
+


-- 
Scott Bambrough - Software Engineer
REBEL.COM    http://www.rebel.com
NetWinder    http://www.netwinder.org

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