]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cse.c (canon_hash): Reorder do_not_record test.
authorRichard Henderson <rth@redhat.com>
Mon, 20 May 2002 16:57:57 +0000 (09:57 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 20 May 2002 16:57:57 +0000 (09:57 -0700)
        * cse.c (canon_hash): Reorder do_not_record test.  Always
        allow pic_offset_table_rtx.

From-SVN: r53663

gcc/ChangeLog
gcc/cse.c

index a979e0f947abfd05724f882b5794ceee522fa755..94a36a0ac0487eff0672be0ecdb7e7e5af14f1fa 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-20  Richard Henderson  <rth@redhat.com>
+
+       * cse.c (canon_hash): Reorder do_not_record test.  Always
+       allow pic_offset_table_rtx.
+
 2002-05-19  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * doc/contrib.texi: Update my entry.
index a607b0c46f34987a73eaf2e9298c3201eb812274..570c61c3e2cc651523c7257016128b61734a7ca4 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -2254,10 +2254,11 @@ canon_hash (x, mode)
     case REG:
       {
        unsigned int regno = REGNO (x);
+       bool record;
 
        /* On some machines, we can't record any non-fixed hard register,
           because extending its life will cause reload problems.  We
-          consider ap, fp, and sp to be fixed for this purpose.
+          consider ap, fp, sp, gp to be fixed for this purpose.
 
           We also consider CCmode registers to be fixed for this purpose;
           failure to do so leads to failure to simplify 0<100 type of
@@ -2267,16 +2268,28 @@ canon_hash (x, mode)
           Nor should we record any register that is in a small
           class, as defined by CLASS_LIKELY_SPILLED_P.  */
 
-       if (regno < FIRST_PSEUDO_REGISTER
-           && (global_regs[regno]
-               || CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (regno))
-               || (SMALL_REGISTER_CLASSES
-                   && ! fixed_regs[regno]
-                   && x != frame_pointer_rtx
-                   && x != hard_frame_pointer_rtx
-                   && x != arg_pointer_rtx
-                   && x != stack_pointer_rtx
-                   && GET_MODE_CLASS (GET_MODE (x)) != MODE_CC)))
+       if (regno >= FIRST_PSEUDO_REGISTER)
+         record = true;
+       else if (x == frame_pointer_rtx
+                || x == hard_frame_pointer_rtx
+                || x == arg_pointer_rtx
+                || x == stack_pointer_rtx
+                || x == pic_offset_table_rtx)
+         record = true;
+       else if (global_regs[regno])
+         record = false;
+       else if (fixed_regs[regno])
+         record = true;
+       else if (GET_MODE_CLASS (GET_MODE (x)) == MODE_CC)
+         record = true;
+       else if (SMALL_REGISTER_CLASSES)
+         record = false;
+       else if (CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (regno)))
+         record = false;
+       else
+         record = true;
+           
+       if (!record)
          {
            do_not_record = 1;
            return 0;