aboutsummaryrefslogtreecommitdiff
path: root/contrib/gcc-changelog/git_commit.py
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2025-10-01 12:28:59 +0200
committerMarc Poulhiès <dkm@gcc.gnu.org>2025-10-28 11:24:06 +0100
commitf6eb93dec5d355933cd0478db6bf43dfdb3aad06 (patch)
treeb0b1e24f019b0db9876e2ed0137410e615399f8f /contrib/gcc-changelog/git_commit.py
parent7ad3907689aed6a7937c3d82dc3e79fe8fc5b8cb (diff)
downloadgcc-f6eb93dec5d355933cd0478db6bf43dfdb3aad06.zip
gcc-f6eb93dec5d355933cd0478db6bf43dfdb3aad06.tar.gz
gcc-f6eb93dec5d355933cd0478db6bf43dfdb3aad06.tar.bz2
ada: Fix miscompilation at -O2 due to aliasing issue caused by -gnatVa
The problem is that the expanded code generated by -gnatVa (-gnatVc to be precise) violates strict aliasing rules, because it contains a 'Reference to an elementary component that is nonaliased ('Reference is equivalent to a pointer for code generation purposes and the "aliased" keyword is trusted for components whose type is elementary by code generators). Remove_Side_Effects already knows that it must make a copy for elementary types instead of taking 'Reference, but it is fooled by the private type of the expression. The fix is to still use the Etype to build new nodes, but to use its Underlying_Type to select the strategy to do so. gcc/ada/ChangeLog: * exp_util.adb (Remove_Side_Effects): Use separately the Etype of the expression to build new nodes and its Underlying_Type to drive part of the processing.
Diffstat (limited to 'contrib/gcc-changelog/git_commit.py')
0 files changed, 0 insertions, 0 deletions