]> git.ipfire.org Git - thirdparty/gcc.git/commit
ipa-sra: Prevent constructing debug info from wrong argument
authorMartin Jambor <mjambor@suse.cz>
Thu, 2 Jul 2020 12:30:50 +0000 (14:30 +0200)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 16:15:54 +0000 (13:15 -0300)
commit4868431f49cd23bd812af66f5a3e10c384e3e58f
treee0dd9d24146e5318b8ee444c15e4358e1d263ae4
parent12fb8a777407523da04d9a017b458d04855df17c
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.
gcc/ipa-param-manipulation.c
gcc/testsuite/gcc.dg/guality/pr95343.c [new file with mode: 0644]