Preserve character-array and enum DSE test coverage
GCC testsuite retains DSE coverage for character-array and enum initializations.
This commit adjusts GCC’s testsuite to preserve Dead Store Elimination (DSE) coverage for character arrays and enums. The character-array test now correctly asserts that DSE removes a whole-object clear overwritten by a string assignment, including implicit trailing zeros. An enum variant is moved to a separate test to maintain its specific DSE assertion.
In Details
This change modifies GCC's SSA-based Dead Store Elimination (DSE) test suite. Specifically, ssa-dse-1.C is updated to re-enable assertions for whole-object clears of character arrays that are subsequently overwritten by string assignments. The enum test case, previously in ssa-dse-1.C, is moved to ssa-dse-4.C to isolate its regression test for partial DSE behavior. This ensures DSE correctly handles implicit zero-initialization of aggregates.
- DSE
- Dead Store Elimination is a compiler optimization that removes assignments to variables that are never subsequently read. In GCC, this is often performed on the SSA (Static Single Assignment) form of the code.
- SSA
- Static Single Assignment form is an intermediate representation used in compilers where every variable is assigned a value exactly once. This simplifies many optimization passes, including DSE.
- STRING_CST
- A constant string used in GCC's internal representation (tree). It represents a sequence of characters, often used for aggregate initializations.