diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-16 10:43:18 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-16 10:43:18 +0000 |
commit | 4e6677f80fed96013662adac6c9bb234d299f16d (patch) | |
tree | 6eba8425535818cb1b7315f03e20aef3130b2545 /gcc/dwarf2out.c | |
parent | 18c7fc85ff7698076d136e889348126f34c5d971 (diff) | |
download | gcc-4e6677f80fed96013662adac6c9bb234d299f16d.tar.gz |
PR debug/41717
* cfgexpand.c (expand_debug_expr): Handle CONJ_EXPR.
* dwarf2out.c (mem_loc_descriptor): Don't handle
POST_INT/POST_DEC/POST_MODIFY like SUBREG. For SUBREG
punt if it is not lowpart subreg or if inner mode isn't
MODE_INT.
* gcc.dg/debug/pr41717.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152897 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 791ecd3c96a..b67bab3f8e4 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -12894,10 +12894,7 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode, case POST_INC: case POST_DEC: case POST_MODIFY: - /* POST_INC and POST_DEC can be handled just like a SUBREG. So we - just fall into the SUBREG code. */ - - /* ... fall through ... */ + return mem_loc_descriptor (XEXP (rtl, 0), mode, initialized); case SUBREG: /* The case of a subreg may arise when we have a local (register) @@ -12905,9 +12902,13 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode, up an entire register. For now, just assume that it is legitimate to make the Dwarf info refer to the whole register which contains the given subreg. */ - rtl = XEXP (rtl, 0); + if (!subreg_lowpart_p (rtl)) + break; + rtl = SUBREG_REG (rtl); if (GET_MODE_SIZE (GET_MODE (rtl)) > DWARF2_ADDR_SIZE) break; + if (GET_MODE_CLASS (GET_MODE (rtl)) != MODE_INT) + break; mem_loc_result = mem_loc_descriptor (rtl, mode, initialized); break; @@ -13392,12 +13393,19 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode, if (BITS_BIG_ENDIAN) shift = GET_MODE_BITSIZE (GET_MODE (XEXP (rtl, 0))) - shift - size; - add_loc_descr (&mem_loc_result, - int_loc_descriptor (DWARF2_ADDR_SIZE - shift - size)); - add_loc_descr (&mem_loc_result, new_loc_descr (DW_OP_shl, 0, 0)); - add_loc_descr (&mem_loc_result, - int_loc_descriptor (DWARF2_ADDR_SIZE - size)); - add_loc_descr (&mem_loc_result, new_loc_descr (op, 0, 0)); + if (shift + size != DWARF2_ADDR_SIZE) + { + add_loc_descr (&mem_loc_result, + int_loc_descriptor (DWARF2_ADDR_SIZE + - shift - size)); + add_loc_descr (&mem_loc_result, new_loc_descr (DW_OP_shl, 0, 0)); + } + if (size != DWARF2_ADDR_SIZE) + { + add_loc_descr (&mem_loc_result, + int_loc_descriptor (DWARF2_ADDR_SIZE - size)); + add_loc_descr (&mem_loc_result, new_loc_descr (op, 0, 0)); + } } break; |