diff options
author | Jakub Jelinek <jakub@redhat.com> | 2012-12-18 10:50:47 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2012-12-18 10:50:47 +0000 |
commit | 5f60490e3c4d020d7f80a3559ced5b6c78b8a4b7 (patch) | |
tree | aa9c6427dcc97a3b76b02ae4b8e5bfd7aa409495 /gcc/dwarf2out.c | |
parent | 192b7b4a1273938bad3b779e8b402b5893bfac47 (diff) |
PR debug/55717
* rtlhooks-def.h (RTL_HOOKS_GEN_LOWPART_NO_EMIT): Define to
gen_lowpart_if_possible.
(gen_lowpart_no_emit_general): Remove prototype.
* rtlhooks.c (gen_lowpart_no_emit_general): Removed.
* simplify-rtx.c (simplify_unary_operation_1,
simplify_binary_operation_1): Continue simplifying if
rtl_hooks.gen_lowpart_no_emit returns NULL_RTX.
* dwarf2out.c (mem_loc_descriptor) <case TRUNCATE>: Handle
truncation like lowpart SUBREG.
* testsuite/g++.dg/opt/pr55717.C: New test.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@194575 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index c92fa4bd4b5..a284eed6977 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -11840,6 +11840,7 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode, dw_loc_descr_ref mem_loc_result = NULL; enum dwarf_location_atom op; dw_loc_descr_ref op0, op1; + rtx inner = NULL_RTX; if (mode == VOIDmode) mode = GET_MODE (rtl); @@ -11869,35 +11870,39 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode, contains the given subreg. */ if (!subreg_lowpart_p (rtl)) break; + inner = SUBREG_REG (rtl); + case TRUNCATE: + if (inner == NULL_RTX) + inner = XEXP (rtl, 0); if (GET_MODE_CLASS (mode) == MODE_INT - && GET_MODE_CLASS (GET_MODE (SUBREG_REG (rtl))) == MODE_INT + && GET_MODE_CLASS (GET_MODE (inner)) == MODE_INT && (GET_MODE_SIZE (mode) <= DWARF2_ADDR_SIZE #ifdef POINTERS_EXTEND_UNSIGNED || (mode == Pmode && mem_mode != VOIDmode) #endif ) - && GET_MODE_SIZE (GET_MODE (SUBREG_REG (rtl))) <= DWARF2_ADDR_SIZE) + && GET_MODE_SIZE (GET_MODE (inner)) <= DWARF2_ADDR_SIZE) { - mem_loc_result = mem_loc_descriptor (SUBREG_REG (rtl), - GET_MODE (SUBREG_REG (rtl)), + mem_loc_result = mem_loc_descriptor (inner, + GET_MODE (inner), mem_mode, initialized); break; } if (dwarf_strict) break; - if (GET_MODE_SIZE (mode) > GET_MODE_SIZE (GET_MODE (SUBREG_REG (rtl)))) + if (GET_MODE_SIZE (mode) > GET_MODE_SIZE (GET_MODE (inner))) break; - if (GET_MODE_SIZE (mode) != GET_MODE_SIZE (GET_MODE (SUBREG_REG (rtl))) + if (GET_MODE_SIZE (mode) != GET_MODE_SIZE (GET_MODE (inner)) && (GET_MODE_CLASS (mode) != MODE_INT - || GET_MODE_CLASS (GET_MODE (SUBREG_REG (rtl))) != MODE_INT)) + || GET_MODE_CLASS (GET_MODE (inner)) != MODE_INT)) break; else { dw_die_ref type_die; dw_loc_descr_ref cvt; - mem_loc_result = mem_loc_descriptor (SUBREG_REG (rtl), - GET_MODE (SUBREG_REG (rtl)), + mem_loc_result = mem_loc_descriptor (inner, + GET_MODE (inner), mem_mode, initialized); if (mem_loc_result == NULL) break; @@ -11909,7 +11914,7 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode, break; } if (GET_MODE_SIZE (mode) - != GET_MODE_SIZE (GET_MODE (SUBREG_REG (rtl)))) + != GET_MODE_SIZE (GET_MODE (inner))) cvt = new_loc_descr (DW_OP_GNU_convert, 0, 0); else cvt = new_loc_descr (DW_OP_GNU_reinterpret, 0, 0); @@ -12666,7 +12671,6 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode, break; case COMPARE: - case TRUNCATE: /* In theory, we could implement the above. */ /* DWARF cannot represent the unsigned compare operations natively. */ |