On 03/22/2011 05:01 PM, Richard Henderson wrote:
> On 03/22/2011 05:31 AM, Bernd Schmidt wrote:
>> On 03/21/2011 09:50 PM, Richard Henderson wrote:
>>> Ok to commit?
>>
>> As far as the dwarf2out bits are concerned, yes but please change it to
>> also accept POST_MODIFY - your patch is identical to some code I need
>> for a new target except for the rtx code.
> 
> I can't quite.  It's more than a 1-liner, and I'd prefer to test.
> I *think* it also belongs in rule 10, not rule 11, but I'm not quite sure.

Ah yes. I didn't notice that you were modifying a different case; the
surrounding code looked identical. Ok to apply the following on top?


Bernd

        * dwarf2out.c (dwarf2out_frame_debug_expr): Handle POST_MODIFY stores
        through the stack pointer.

Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c     (revision 316201)
+++ gcc/dwarf2out.c     (revision 316202)
@@ -2440,6 +2440,7 @@ dwarf2out_frame_debug_expr (rtx expr, co
          /* Rule 10 */
          /* With a push.  */
        case PRE_MODIFY:
+       case POST_MODIFY:
          /* We can't handle variable size modifications.  */
          gcc_assert (GET_CODE (XEXP (XEXP (XEXP (dest, 0), 1), 1))
                      == CONST_INT);
@@ -2452,7 +2453,10 @@ dwarf2out_frame_debug_expr (rtx expr, co
          if (cfa.reg == STACK_POINTER_REGNUM)
            cfa.offset = cfa_store.offset;
 
-         offset = -cfa_store.offset;
+         if (GET_CODE (XEXP (dest, 0)) == POST_MODIFY)
+           offset -= cfa_store.offset;
+         else
+           offset = -cfa_store.offset;
          break;
 
          /* Rule 11 */

Reply via email to