From 682d5372669bc117cabe1c44a205ad6acca72730 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 19 Jan 2010 12:38:31 -0800 Subject: Use signed division for DW_OP_div. * loc2c.c (translate): Use signed division for DW_OP_div. --- loc2c.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'loc2c.c') diff --git a/loc2c.c b/loc2c.c index 161df763..4633e739 100644 --- a/loc2c.c +++ b/loc2c.c @@ -479,7 +479,6 @@ translate (struct obstack *pool, int indent, Dwarf_Addr addrbias, UNOP (abs, op_abs); BINOP (and, &); - BINOP (div, /); BINOP (minus, -); BINOP (mod, %); BINOP (mul, *); @@ -512,6 +511,16 @@ translate (struct obstack *pool, int indent, Dwarf_Addr addrbias, break; } + case DW_OP_div: + { + POP (b); + POP (a); + push ("(%s) " STACKFMT " / (%s)" STACKFMT, + stack_slot_type (loc, true), a, + stack_slot_type (loc, true), b); + break; + } + case DW_OP_plus_uconst: { POP (x); -- cgit From 5d580c21bf940ab8c8006a6efe37eb3fca1d191d Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 19 Jan 2010 12:44:05 -0800 Subject: Swap DW_OP_shr and DW_OP_shra. * loc2c.c (translate): DW_OP_shr is unsigned, DW_OP_shra is signed. --- loc2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'loc2c.c') diff --git a/loc2c.c b/loc2c.c index 4633e739..818e9e49 100644 --- a/loc2c.c +++ b/loc2c.c @@ -487,7 +487,7 @@ translate (struct obstack *pool, int indent, Dwarf_Addr addrbias, BINOP (or, |); BINOP (plus, +); BINOP (shl, <<); - BINOP (shra, >>); + BINOP (shr, >>); BINOP (xor, ^); /* Comparisons are binary operators too. */ @@ -501,7 +501,7 @@ translate (struct obstack *pool, int indent, Dwarf_Addr addrbias, #undef UNOP #undef BINOP - case DW_OP_shr: + case DW_OP_shra: { POP (b); POP (a); -- cgit