]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-object-size: Deterministic SSA generation [PR123351]
authorJakub Jelinek <jakub@redhat.com>
Tue, 6 Jan 2026 07:36:20 +0000 (08:36 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 6 Jan 2026 07:36:20 +0000 (08:36 +0100)
commitc6085ca0ed4cef3bcf4eb382cb71e44219c10f6e
treeb0c75c83bae43f52d96a6763fe0bd0a6d09c3b06
parente32c3fb4311bcaf767a87934d6495f05fbae7bc9
tree-object-size: Deterministic SSA generation [PR123351]

The order of evaluation of function arguments is unspecified in C++.
The function object_sizes_set_temp called object_sizes_set with two
calls to make_ssa_name() as arguments.  Since make_ssa_name() has the
side effect of incrementing the global SSA version counter, different
architectures of the same compiler evaluated these calls in different
orders.

This resulted in non-deterministic SSA version numbering between
x86_64 and aarch64 hosts during cross-compilation, leading to
divergent object files.

Sequencing the calls into separate statements ensures deterministic
evaluation order.

2026-01-06  Jakub Jelinek  <jakub@redhat.com>
    Marco Falke  <falke.marco@gmail.com>

PR tree-optimization/123351
* tree-object-size.cc (object_sizes_set_temp): Separate calls to
make_ssa_name to ensure deterministic execution order.
gcc/tree-object-size.cc