This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

[PATCH] Fix DW_CFA_restore handling


Hi!

DW_CFA_restore would be wrongly handled as DW_CFA_advance_loc
(because DW_CFA_restore & WD_CFA_advance_loc is nonzero).
Ok to commit?

2001-12-11  Jakub Jelinek  <jakub@redhat.com>

	* unwind-dw2.c (execute_cfa_program): Fix DW_CFA_restore handling.

--- gcc/unwind-dw2.c.jj	Mon Dec 10 19:13:39 2001
+++ gcc/unwind-dw2.c	Tue Dec 11 14:28:27 2001
@@ -711,9 +711,9 @@ execute_cfa_program (const unsigned char
       _Unwind_Word reg, utmp;
       _Unwind_Sword offset, stmp;
 
-      if (insn & DW_CFA_advance_loc)
+      if ((insn & 0xc0) == DW_CFA_advance_loc)
 	fs->pc += (insn & 0x3f) * fs->code_align;
-      else if (insn & DW_CFA_offset)
+      else if ((insn & 0xc0) == DW_CFA_offset)
 	{
 	  reg = insn & 0x3f;
 	  insn_ptr = read_uleb128 (insn_ptr, &utmp);
@@ -721,7 +721,7 @@ execute_cfa_program (const unsigned char
 	  fs->regs.reg[reg].how = REG_SAVED_OFFSET;
 	  fs->regs.reg[reg].loc.offset = offset;
 	}
-      else if (insn & DW_CFA_restore)
+      else if ((insn & 0xc0) == DW_CFA_restore)
 	{
 	  reg = insn & 0x3f;
 	  fs->regs.reg[reg].how = REG_UNSAVED;

	Jakub


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