ifcvt: Factor: Turn asserts about abnormals to conditional
The ifcvt pass now avoids factoring in cases where SSA names are used in abnormal edges.
The if-conversion pass in GCC now avoids factoring operations when SSA names are used in abnormal edges, preventing potential issues. Previously, this condition would trigger an assertion, but now the factoring is skipped instead. A new test case has been added to verify this behavior.
In Details
The factor_out_operators function in tree-if-conv.cc is part of the if-conversion pass. This commit changes assertions about abnormalities (SSA names used in abnormal edges) into a conditional that rejects the factoring. This prevents issues when factoring might look further up and encounter statements with SSA names used in abnormal edges.
For Context
If-conversion is a compiler optimization technique that transforms conditional branches (if/else statements) into sequences of straight-line code, often using predicated instructions. This commit modifies the if-conversion process in GCC to handle specific cases where certain variables (SSA names) are used in unusual ways (abnormal edges). Instead of crashing (assertion failure), the compiler will now skip the optimization in these cases, ensuring more robust code generation.