]> gcc.gnu.org Git - gcc.git/commit
middle-end/111818 - failed DECL_NOT_GIMPLE_REG_P setting of volatile
authorRichard Biener <rguenther@suse.de>
Mon, 16 Oct 2023 10:50:46 +0000 (12:50 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 15 Dec 2023 12:17:33 +0000 (13:17 +0100)
commit45c296f2d81f6259e268e07707b4aa87dffba20a
treee30816361beafd762167ca4d6e07466187546c92
parent0e332ee568739448a9439c7074d2a29badba60f2
middle-end/111818 - failed DECL_NOT_GIMPLE_REG_P setting of volatile

The following addresses a missed DECL_NOT_GIMPLE_REG_P setting of
a volatile declared parameter which causes inlining to substitute
a constant parameter into a context where its address is required.

The main issue is in update_address_taken which clears
DECL_NOT_GIMPLE_REG_P from the parameter but fails to rewrite it
because is_gimple_reg returns false for volatiles.  The following
changes maybe_optimize_var to make the 1:1 correspondence between
clearing DECL_NOT_GIMPLE_REG_P of a register typed decl and
actually rewriting it to SSA.

PR middle-end/111818
* tree-ssa.c (maybe_optimize_var): When clearing
DECL_NOT_GIMPLE_REG_P always rewrite into SSA.

* gcc.dg/torture/pr111818.c: New testcase.

(cherry picked from commit ce55521bcd149fdc431f1d78e706b66d470210ae)
gcc/testsuite/gcc.dg/torture/pr111818.c [new file with mode: 0644]
gcc/tree-ssa.c
This page took 0.068546 seconds and 6 git commands to generate.