Commit 2689fcc8 by Alexandre Oliva Committed by Alexandre Oliva

[PR89528] reset debug uses of return value when dropping dead RTL call

When we remove an RTL call, we wouldn't clean up references to the
return value of the call in debug insns.  Make it so that we do.


for  gcc/ChangeLog

	PR debug/89528
	* valtrack.c (dead_debug_insert_temp): Reset debug references
	to the return value of a call being removed.

for  gcc/testsuite/ChangeLog

	PR debug/89528
	* gcc.dg/guality/pr89528.c: New.

From-SVN: r270389
parent 1ce6a0f5
2019-04-16 Alexandre Oliva <aoliva@redhat.com>
PR debug/89528
* valtrack.c (dead_debug_insert_temp): Reset debug references
to the return value of a call being removed.
2019-04-16 Claudiu Zissulescu <claziss@synopsys.com> 2019-04-16 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc-protos.h (arc_register_move_cost): Remove. * config/arc/arc-protos.h (arc_register_move_cost): Remove.
......
2019-04-16 Alexandre Oliva <aoliva@redhat.com> 2019-04-16 Alexandre Oliva <aoliva@redhat.com>
PR debug/89528
* gcc.dg/guality/pr89528.c: New.
PR rtl-optimization/86438 PR rtl-optimization/86438
* gcc.dg/torture/pr86438.c: Split up too-wide shift. * gcc.dg/torture/pr86438.c: Split up too-wide shift.
......
/* PR debug/89528 */
/* { dg-do run } */
/* { dg-options "-g" } */
#include <stdio.h>
char b;
int d, e;
static int i = 1;
void a(int l) { printf("", l); }
char c(char l) { return l || b && l == 1 ? b : b % l; }
short f(int l, int m) { return l * m; }
short g(short l, short m) { return m || l == 767 && m == 1; }
int h(int l, int m) { return (l ^ m & l ^ (m & 647) - m ^ m) < m; }
static int j(int l) { return d == 0 || l == 647 && d == 1 ? l : l % d; }
short k(int l) { return l >= 2 >> l; }
void optimize_me_not() { asm(""); }
static short n(void) {
int l_1127 = ~j(9 || 0) ^ 65535;
optimize_me_not(); /* { dg-final { gdb-test . "l_1127+1" "-65534" } } */
f(l_1127, i && e ^ 4) && g(0, 0);
e = 0;
return 5;
}
int main() { n(); }
...@@ -657,22 +657,12 @@ dead_debug_insert_temp (struct dead_debug_local *debug, unsigned int uregno, ...@@ -657,22 +657,12 @@ dead_debug_insert_temp (struct dead_debug_local *debug, unsigned int uregno,
{ {
dest = SET_DEST (set); dest = SET_DEST (set);
src = SET_SRC (set); src = SET_SRC (set);
/* Lose if the REG-setting insn is a CALL. */ /* Reset uses if the REG-setting insn is a CALL. Asm in
if (GET_CODE (src) == CALL) DEBUG_INSN is never useful, we can't emit debug info for
{ that. And for volatile_insn_p, it is actually harmful -
while (uses) DEBUG_INSNs shouldn't have any side-effects. */
{ if (GET_CODE (src) == CALL || GET_CODE (src) == ASM_OPERANDS
cur = uses->next; || volatile_insn_p (src))
XDELETE (uses);
uses = cur;
}
return 0;
}
/* Asm in DEBUG_INSN is never useful, we can't emit debug info for
that. And for volatile_insn_p, it is actually harmful
- DEBUG_INSNs shouldn't have any side-effects. */
else if (GET_CODE (src) == ASM_OPERANDS
|| volatile_insn_p (src))
set = NULL_RTX; set = NULL_RTX;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment