This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r262628 - in /trunk/gcc: ChangeLog testsuite/Ch...
- From: vries at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Fri, 13 Jul 2018 10:08:37 -0000
- Subject: r262628 - in /trunk/gcc: ChangeLog testsuite/Ch...
Author: vries
Date: Fri Jul 13 10:08:37 2018
New Revision: 262628
URL: https://gcc.gnu.org/viewcvs?rev=262628&root=gcc&view=rev
Log:
[debug] Reuse debug exprs generated in remap_ssa_name
When compiling gcc.dg/vla-1.c with -O3 -g, vla a and b in f1 are optimized
away, and f1 is cloned to a version f1.constprop with no parameters, eliminating
parameter i. Debug info is generated to describe the sizes of a and b, but
that process generates debug expressions that are not reused.
Fix the duplication by saving and reusing the generated debug expressions in
remap_ssa_name. Concretely: reuse D#7 here instead of generating D#8:
...
__attribute__((noinline))
f1.constprop ()
{
intD.6 iD.1935;
<bb 3>
# DEBUG D#10 s=> iD.1897
# DEBUG iD.1935 => D#10
<bb 2>
- # DEBUG D#8 s=> iD.1935
# DEBUG D#7 s=> iD.1935
saved_stack.2_1 = __builtin_stack_save ();
# DEBUG BEGIN_STMT
# DEBUG D#6 => D#7 + 1
# DEBUG D#5 => (long intD.8) D#6
# DEBUG D#4 => D#5 + -1
# DEBUG D.1937 => (sizetype) D#4
# DEBUG a.0D.1942 => NULL
# DEBUG BEGIN_STMT
- # DEBUG D#3 => D#8 + 2
+ # DEBUG D#3 => D#7 + 2
# DEBUG D#2 => (long intD.8) D#3
# DEBUG D#1 => D#2 + -1
# DEBUG D.1944 => (sizetype) D#1
# DEBUG b.1D.1949 => NULL
...
Bootstrapped and reg-tested on x86_64.
2018-07-13 Tom de Vries <tdevries@suse.de>
* tree-inline.c (remap_ssa_name): Save and reuse debug exprs generated
in remap_ssa_name.
* gcc.dg/vla-1.c: Update.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/vla-1.c
trunk/gcc/tree-inline.c