Frame notes for pa.c

Alan Modra alan@linuxcare.com.au
Tue Apr 3 18:35:00 GMT 2001


On Tue, 3 Apr 2001, Mark Mitchell wrote:

> OK -- but please update the documentation for
> dwarf2out_debug_frame_expr accordingly.  Jeffrey worked very hard to

Rats, I thought I was going to get away with it.  Who reads documentation
anyway?  :-)  Committing the following in addition to the previous patch.

Alan Modra
-- 
Linuxcare

--- gcc-new/gcc/dwarf2out.c	Wed Apr  4 09:44:21 2001
+++ gcc-current/gcc/dwarf2out.c	Wed Apr  4 10:57:54 2001
@@ -1133,11 +1133,13 @@ static dw_cfa_location cfa_temp;
 	       cfa_store.reg to the actual CFA
   cfa_temp     register holding an integral value.  cfa_temp.offset
 	       stores the value, which will be used to adjust the
-	       stack pointer.
+	       stack pointer.  cfa_temp is also used like cfa_store,
+	       to track stores to the stack via fp or a temp reg.
  
   Rules  1- 4: Setting a register's value to cfa.reg or an expression
   	       with cfa.reg as the first operand changes the cfa.reg and its
-	       cfa.offset.
+	       cfa.offset.  Rule 1 and 4 also set cfa_temp.reg and
+	       cfa_temp.offset.
 
   Rules  6- 9: Set a non-cfa.reg register value to a constant or an
 	       expression yielding a constant.  This sets cfa_temp.reg
@@ -1146,9 +1148,9 @@ static dw_cfa_location cfa_temp;
   Rule 5:      Create a new register cfa_store used to save items to the
 	       stack.
 
-  Rules 10-13: Save a register to the stack.  Define offset as the
+  Rules 10-14: Save a register to the stack.  Define offset as the
 	       difference of the original location and cfa_store's
-	       location.
+	       location (or cfa_temp's location if cfa_temp is used).
 
   The Rules
 
@@ -1157,26 +1159,30 @@ static dw_cfa_location cfa_temp;
 
   Rule 1:
   (set <reg1> <reg2>:cfa.reg)
-  effects: cfa.reg = <REG1>
+  effects: cfa.reg = <reg1>
            cfa.offset unchanged
+	   cfa_temp.reg = <reg1>
+	   cfa_temp.offset = cfa.offset
 
   Rule 2:
-  (set sp ({minus,plus} {sp,fp}:cfa.reg {<const_int>,<reg>:cfa_temp.reg}))
+  (set sp ({minus,plus,losum} {sp,fp}:cfa.reg {<const_int>,<reg>:cfa_temp.reg}))
   effects: cfa.reg = sp if fp used
  	   cfa.offset += {+/- <const_int>, cfa_temp.offset} if cfa.reg==sp
 	   cfa_store.offset += {+/- <const_int>, cfa_temp.offset}
 	     if cfa_store.reg==sp
 
   Rule 3:
-  (set fp ({minus,plus} <reg>:cfa.reg <const_int>))
+  (set fp ({minus,plus,losum} <reg>:cfa.reg <const_int>))
   effects: cfa.reg = fp
   	   cfa_offset += +/- <const_int>
 
   Rule 4:
-  (set <reg1> (plus <reg2>:cfa.reg <const_int>))
+  (set <reg1> ({plus,losum} <reg2>:cfa.reg <const_int>))
   constraints: <reg1> != fp
   	       <reg1> != sp
   effects: cfa.reg = <reg1>
+	   cfa_temp.reg = <reg1>
+	   cfa_temp.offset = cfa.offset
 
   Rule 5:
   (set <reg1> (plus <reg2>:cfa_temp.reg sp:cfa.reg))
@@ -1208,30 +1214,31 @@ static dw_cfa_location cfa_temp;
   (set (mem (pre_modify sp:cfa_store (???? <reg1> <const_int>))) <reg2>)
   effects: cfa_store.offset -= <const_int>
 	   cfa.offset = cfa_store.offset if cfa.reg == sp
-	   offset = -cfa_store.offset
 	   cfa.reg = sp
-	   cfa.base_offset = offset
+	   cfa.base_offset = -cfa_store.offset
 
   Rule 11:
   (set (mem ({pre_inc,pre_dec} sp:cfa_store.reg)) <reg>)
   effects: cfa_store.offset += -/+ mode_size(mem)
 	   cfa.offset = cfa_store.offset if cfa.reg == sp
-	   offset = -cfa_store.offset
 	   cfa.reg = sp
-	   cfa.base_offset = offset
+	   cfa.base_offset = -cfa_store.offset
 
   Rule 12:
-  (set (mem ({minus,plus} <reg1>:cfa_store <const_int>)) <reg2>)
-  effects: cfa_store.offset += -/+ <const_int>
-	   offset = -cfa_store.offset
-	   cfa.reg = <reg1
-	   cfa.base_offset = offset
+  (set (mem ({minus,plus,losum} <reg1>:{cfa_store,cfa_temp} <const_int>)) <reg2>)
+  effects: cfa.reg = <reg1>
+	   cfa.base_offset = -/+ <const_int> - {cfa_store,cfa_temp}.offset
 
   Rule 13:
-  (set (mem <reg1>:cfa_store) <reg2>)
-  effects: offset = -cfa_store.offset
-	   cfa.reg = <reg1>
-	   cfa.base_offset = offset */
+  (set (mem <reg1>:{cfa_store,cfa_temp}) <reg2>)
+  effects: cfa.reg = <reg1>
+	   cfa.base_offset = -{cfa_store,cfa_temp}.offset
+
+  Rule 14:
+  (set (mem (postinc <reg1>:cfa_temp <const_int>)) <reg2>)
+  effects: cfa.reg = <reg1>
+	   cfa.base_offset = -cfa_temp.offset
+	   cfa_temp.offset -= mode_size(mem)  */
 
 static void
 dwarf2out_frame_debug_expr (expr, label)
@@ -1501,6 +1508,7 @@ dwarf2out_frame_debug_expr (expr, label)
 	    abort ();
 	  break;
 
+	  /* Rule 14 */
 	case POST_INC:
 	  if (cfa_temp.reg != (unsigned) REGNO (XEXP (XEXP (dest, 0), 0)))
 	    abort ();



More information about the Gcc-patches mailing list