aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.cc
diff options
context:
space:
mode:
authorNathaniel Shead <nathanieloshead@gmail.com>2024-01-03 09:28:43 +1100
committerNathaniel Shead <nathanieloshead@gmail.com>2024-01-07 21:07:29 +1100
commita71c3977d24722ac8ee28d8844c4f96a151f75ab (patch)
tree4f1372e33971edda54b2581d05e963b9a4918c84 /gcc/tree-vect-loop.cc
parent63b531e6f8783e8624502d890dc422379de47a9a (diff)
downloadgcc-a71c3977d24722ac8ee28d8844c4f96a151f75ab.zip
gcc-a71c3977d24722ac8ee28d8844c4f96a151f75ab.tar.gz
gcc-a71c3977d24722ac8ee28d8844c4f96a151f75ab.tar.bz2
c++: Fix ICE when writing nontrivial variable initializers
The attached testcase Patrick found in PR c++/112899 ICEs because it is attempting to write a variable initializer that is no longer in the static_aggregates map. The issue is that, for non-header modules, the loop in c_parse_final_cleanups prunes the static_aggregates list, which means that by the time we get to emitting module information those initialisers have been lost. However, we don't actually need to write non-trivial initialisers for non-header modules, because they've already been emitted as part of the module TU itself. Instead let's just only write the initializers from header modules (which skipped writing them in c_parse_final_cleanups). gcc/cp/ChangeLog: * module.cc (trees_out::write_var_def): Only write initializers in header modules. gcc/testsuite/ChangeLog: * g++.dg/modules/init-5_a.C: New test. * g++.dg/modules/init-5_b.C: New test. Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Diffstat (limited to 'gcc/tree-vect-loop.cc')
0 files changed, 0 insertions, 0 deletions