]> gcc.gnu.org Git - gcc.git/commit
ipa-sra: Prevent constructing debug info from wrong argument
authorMartin Jambor <mjambor@suse.cz>
Fri, 3 Jul 2020 12:51:02 +0000 (14:51 +0200)
committerMartin Jambor <mjambor@suse.cz>
Fri, 3 Jul 2020 12:51:02 +0000 (14:51 +0200)
commit61e4ee3f2c0e3d77602c87866cd5c0cfb81d5da2
tree563b5d5d7c5005fd3c9d54ee6b0d8555ea423df9
parent034e7f1d295140344f3849ebba1d352cad01da27
ipa-sra: Prevent constructing debug info from wrong argument

The mechanism generating debug info for removed parameters did not
adjust index of the argument in the call statement to take into
account extra arguments IPA-SRA might have produced when splitting a
strucutre.  This patch addresses that omission and stops gdb from
showing incorrect value for the removed parameter and says "value
optimized out" instead.  The guality testcase will end up as
UNSUPPORTED in the results which is how Richi told me on IRC we deal
with this.

It is possible to generate debug info to actually show the value of
the removed parameter but so far my approaches to do just that seem
toocontroversial
(https://gcc.gnu.org/pipermail/gcc-patches/2020-May/546705.html), so
before I come up with something better I'd like to push this to master
and the gcc-10 branch in time for the GCC 10.2 release.

gcc/ChangeLog:

2020-07-01  Martin Jambor  <mjambor@suse.cz>

PR debug/95343
* ipa-param-manipulation.c (ipa_param_adjustments::modify_call): Adjust
argument index if necessary.

gcc/testsuite/ChangeLog:

2020-07-01  Martin Jambor  <mjambor@suse.cz>

PR debug/95343
* gcc.dg/guality/pr95343.c: New test.

(cherry picked from commit 053c88093a45f175f446eda009f3312e4e508514)
gcc/ipa-param-manipulation.c
gcc/testsuite/gcc.dg/guality/pr95343.c [new file with mode: 0644]
This page took 0.174102 seconds and 6 git commands to generate.