]> git.ipfire.org Git - thirdparty/gcc.git/commit
cfgexpand: Handle integral vector types and constructors for scope conflicts [PR105769]
authorAndrew Pinski <quic_apinski@quicinc.com>
Sat, 16 Nov 2024 04:22:04 +0000 (20:22 -0800)
committerTamar Christina <tamar.christina@arm.com>
Tue, 7 Jan 2025 14:47:44 +0000 (14:47 +0000)
commit4f4722b0722ec343df70e5ec5fd9d5c682ff8149
tree4de01738adea0e1201033548b1290940b6aeefef
parent0014a858a14b825818d6b557c3d5193f85790bde
cfgexpand: Handle integral vector types and constructors for scope conflicts [PR105769]

This is an expansion of the last patch to also track pointers via vector types and the
constructor that are used with vector types.
In this case we had:
```
_15 = (long unsigned int) &bias;
_10 = (long unsigned int) &cov_jn;
_12 = {_10, _15};
...

MEM[(struct vec *)&cov_jn] ={v} {CLOBBER(bob)};
bias ={v} {CLOBBER(bob)};
MEM[(struct function *)&D.6156] ={v} {CLOBBER(bob)};

...
MEM <vector(2) long unsigned int> [(void *)&D.6172 + 32B] = _12;
MEM[(struct function *)&D.6157] ={v} {CLOBBER(bob)};
```

Anyways tracking the pointers via vector types to say they are alive
at the point where the store of the vector happens fixes the bug by saying
it is alive at the same time as another variable is alive.

Bootstrapped and tested on x86_64-linux-gnu.

PR tree-optimization/105769

gcc/ChangeLog:

* cfgexpand.cc (vars_ssa_cache::operator()): For constructors
walk over the elements.

gcc/testsuite/ChangeLog:

* g++.dg/torture/pr105769-1.C: New test.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/cfgexpand.cc
gcc/testsuite/g++.dg/torture/pr105769-1.C [new file with mode: 0644]