aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c38
1 files changed, 33 insertions, 5 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index f396997..b8f4e48 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -13783,10 +13783,14 @@ const_ok_for_output_1 (rtx rtl)
We should really identify / validate expressions
enclosed in CONST that can be handled by assemblers on various
targets and only handle legitimate cases here. */
- if (GET_CODE (rtl) != SYMBOL_REF)
+ switch (GET_CODE (rtl))
{
- if (GET_CODE (rtl) == NOT)
- return false;
+ case SYMBOL_REF:
+ break;
+ case NOT:
+ case NEG:
+ return false;
+ default:
return true;
}
@@ -14959,8 +14963,32 @@ mem_loc_descriptor (rtx rtl, machine_mode mode,
if (!const_ok_for_output (rtl))
{
if (GET_CODE (rtl) == CONST)
- mem_loc_result = mem_loc_descriptor (XEXP (rtl, 0), int_mode,
- mem_mode, initialized);
+ switch (GET_CODE (XEXP (rtl, 0)))
+ {
+ case NOT:
+ op = DW_OP_not;
+ goto try_const_unop;
+ case NEG:
+ op = DW_OP_neg;
+ goto try_const_unop;
+ try_const_unop:
+ rtx arg;
+ arg = XEXP (XEXP (rtl, 0), 0);
+ if (!CONSTANT_P (arg))
+ arg = gen_rtx_CONST (int_mode, arg);
+ op0 = mem_loc_descriptor (arg, int_mode, mem_mode,
+ initialized);
+ if (op0)
+ {
+ mem_loc_result = op0;
+ add_loc_descr (&mem_loc_result, new_loc_descr (op, 0, 0));
+ }
+ break;
+ default:
+ mem_loc_result = mem_loc_descriptor (XEXP (rtl, 0), int_mode,
+ mem_mode, initialized);
+ break;
+ }
break;
}