Fix ICE with vectorizer and dead code elimination
Removes an assertion in the vectorizer that incorrectly assumed certain masked calls would prevail after dead code elimination.
This commit resolves an internal compiler error (ICE) related to the vectorizer and dead code elimination. An assertion in vect_transform_loop incorrectly assumed that only scalar .MASK_CALL instructions with side effects would remain after dead code elimination (-fno-tree-dce). The change removes this assertion, allowing the compiler to proceed correctly when such calls do not have side effects, and includes a new test case to cover this scenario.
In Details
The vectorizer in GCC, particularly in tree-vect-loop.cc, had an assertion that .MASK_CALL instructions, even scalar ones, would be preserved if they had side effects. This commit removes that assertion because, under specific flags (-fno-tree-dce -fno-tree-dse), such calls might be eliminated even if they don't have side effects. This prevents an ICE by relaxing the verification logic.
- ICE
- Internal Compiler Error. A severe error that causes the compiler to crash during the compilation process.
- vectorizer
- A compiler optimization component that transforms loops to operate on multiple data elements simultaneously using vector instructions.
- dead code elimination (DCE)
- A compiler optimization pass that removes code that does not affect the program's output.
- .MASK_CALL
- A pseudo-instruction or intrinsic used in some intermediate representations, often related to masked operations in SIMD or vector processing.