diff options
author | Jakub Jelinek <jakub@redhat.com> | 2009-10-16 12:43:18 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2009-10-16 12:43:18 +0200 |
commit | d02a5a4b9abb043ff6a243bb4f9a9aaac2fb8656 (patch) | |
tree | 6eba8425535818cb1b7315f03e20aef3130b2545 /gcc/dwarf2out.c | |
parent | 200ab6fd4b218b3e9f5617bcf1d36857b68e0c1e (diff) | |
download | gcc-d02a5a4b9abb043ff6a243bb4f9a9aaac2fb8656.zip gcc-d02a5a4b9abb043ff6a243bb4f9a9aaac2fb8656.tar.gz gcc-d02a5a4b9abb043ff6a243bb4f9a9aaac2fb8656.tar.bz2 |
re PR debug/41717 (internal compiler error: in expand_debug_expr)
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.
From-SVN: r152897
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 791ecd3..b67bab3 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; |