diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-12-17 19:30:58 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-12-17 19:30:58 +0000 |
commit | 3e8731671d242b66251c050dab3b1bf3bff33854 (patch) | |
tree | 7de22c79741e0248541d337275089b1d426b896f /gcc/var-tracking.c | |
parent | 0ca9d0092a132029117b381ef2a7f3c222f5ad40 (diff) | |
download | gcc-3e8731671d242b66251c050dab3b1bf3bff33854.tar.gz |
PR debug/41679
* var-tracking.c (add_stores): Avoid value mode mismatch for
promoted declarations.
* gcc.target/arm/pr41679.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155322 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/var-tracking.c')
-rw-r--r-- | gcc/var-tracking.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index 8267df825ee..11e3aa213a9 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -4815,13 +4815,15 @@ add_stores (rtx loc, const_rtx expr, void *cuip) } else { + rtx xexpr = CONST_CAST_RTX (expr); + if (SET_SRC (expr) != src) - expr = gen_rtx_SET (VOIDmode, loc, src); + xexpr = gen_rtx_SET (VOIDmode, loc, src); if (same_variable_part_p (src, REG_EXPR (loc), REG_OFFSET (loc))) mo->type = MO_COPY; else mo->type = MO_SET; - mo->u.loc = CONST_CAST_RTX (expr); + mo->u.loc = xexpr; } } mo->insn = cui->insn; @@ -4872,15 +4874,17 @@ add_stores (rtx loc, const_rtx expr, void *cuip) } else { + rtx xexpr = CONST_CAST_RTX (expr); + if (SET_SRC (expr) != src) - expr = gen_rtx_SET (VOIDmode, loc, src); - if (same_variable_part_p (SET_SRC (expr), + xexpr = gen_rtx_SET (VOIDmode, loc, src); + if (same_variable_part_p (SET_SRC (xexpr), MEM_EXPR (loc), INT_MEM_OFFSET (loc))) mo->type = MO_COPY; else mo->type = MO_SET; - mo->u.loc = CONST_CAST_RTX (expr); + mo->u.loc = xexpr; } } mo->insn = cui->insn; @@ -4901,7 +4905,14 @@ add_stores (rtx loc, const_rtx expr, void *cuip) if (resolve && GET_CODE (mo->u.loc) == SET) { - nloc = replace_expr_with_values (SET_SRC (mo->u.loc)); + nloc = replace_expr_with_values (SET_SRC (expr)); + + /* Avoid the mode mismatch between oexpr and expr. */ + if (!nloc && mode != mode2) + { + nloc = SET_SRC (expr); + gcc_assert (oloc == SET_DEST (expr)); + } if (nloc) oloc = gen_rtx_SET (GET_MODE (mo->u.loc), oloc, nloc); @@ -4940,7 +4951,8 @@ add_stores (rtx loc, const_rtx expr, void *cuip) (concat (concat val dstv) (set dst src)): dst now holds val, copied from src. dstv is a value-based representation of dst, if - it differs from dst. If resolution is needed, src is a REG. + it differs from dst. If resolution is needed, src is a REG, and + its mode is the same as that of val. (concat (concat val (set dstv srcv)) (set dst src)): src copied to dst, holding val. dstv and srcv are value-based |