]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Allow the (scratch) frame pointer to be initialised from the stack pointer
authorNick Clifton <nickc@redhat.com>
Fri, 22 Dec 2000 17:55:09 +0000 (17:55 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Fri, 22 Dec 2000 17:55:09 +0000 (17:55 +0000)
plus a constant.

From-SVN: r38466

gcc/ChangeLog
gcc/dwarf2out.c

index d1568bb84109c2f7b665bbc6808699df4f381a80..35823fab234e5d7c4049019d16266c9abfeb4c80 100644 (file)
@@ -1,3 +1,9 @@
+2000-12-22  Nick Clifton  <nickc@redhat.com>
+
+       * dwarf2out_frame_debug_expr: Allow the (scratch) frame
+       pointer to be initialised from the stack pointer plus a
+       constant.
+
 2000-12-22  Bernd Schmidt  <bernds@redhat.com>
 
        * regrename.c (struct du_chain): New field "earlyclobber".
index 8c6b6ce5a4bd5a881705d548df54e41e870b96eb..344fe4d19129a73f0498b709f6bd4d0bcadcf597 100644 (file)
@@ -1355,16 +1355,27 @@ dwarf2out_frame_debug_expr (expr, label)
            }
          else
            {
-             if (GET_CODE (src) != PLUS
-                 || XEXP (src, 1) != stack_pointer_rtx)
+             if (GET_CODE (src) != PLUS)
                abort ();
-             if (GET_CODE (XEXP (src, 0)) != REG
-                 || (unsigned) REGNO (XEXP (src, 0)) != cfa_temp_reg)
-               abort ();
-             if (cfa.reg != STACK_POINTER_REGNUM)
-               abort ();
-             cfa_store.reg = REGNO (dest);
-             cfa_store.offset = cfa.offset - cfa_temp_value;
+
+             if (GET_CODE (XEXP (src, 0)) == REG
+                 && REGNO (XEXP (src, 0)) == cfa.reg
+                 && GET_CODE (XEXP (src, 1)) == CONST_INT)
+               /* Setting the FP (or a scratch that will be copied into the FP
+                  later on) from SP + const.  */
+               cfa.reg = REGNO (dest);
+             else
+               {
+                 if (XEXP (src, 1) != stack_pointer_rtx)
+                   abort ();
+                 if (GET_CODE (XEXP (src, 0)) != REG
+                     || (unsigned) REGNO (XEXP (src, 0)) != cfa_temp_reg)
+                   abort ();
+                 if (cfa.reg != STACK_POINTER_REGNUM)
+                   abort ();
+                 cfa_store.reg = REGNO (dest);
+                 cfa_store.offset = cfa.offset - cfa_temp_value;
+               }
            }
          break;