widening_mul, i386: Optimize away NE_EXPR on IMAGPART_EXPR of *_OVERFLOW
GCC optimizes away unnecessary comparisons for overflow checks, improving generated code.
GCC now optimizes certain widening multiplication overflow checks by recognizing that the imaginary part of the result is always in a limited range (0 or 1). Previously, the generated GIMPLE code for these checks included unnecessary comparisons against zero that were not subsequently optimized away. This change propagates the known range information earlier in the compilation process, leading to cleaner and more efficient machine code, and fixes a regression in the i386 backend.
In Details
The widening_mul pattern matching for *_OVERFLOW intrinsics in GCC's GIMPLE IR was generating suboptimal code by retaining NE_EXPR operations on the imaginary part of the complex result. This patch modifies the pattern matching and optimization passes to propagate the known range [0, 1] of the imaginary part, allowing subsequent passes like VRP (Value Range Propagation) and DCE (Dead Code Elimination) to remove these unnecessary comparisons. This is particularly relevant for the i386 backend where prior transformations favored TImode comparisons, which were not being optimized effec…