https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24021

--- Comment #19 from Andrew Macleod <amacleod at redhat dot com> ---
We can use the original testcase as the litmus test for basic support if we
compile it with

-O2  -fno-tree-fre  -fno-tree-dominator-opts

The unroller will unroll the loop and the VRP2 pass will be presented with:

 <bb 2> [local count: 97603129]:
 i_1 = 1.1000000149011611438876201418679556809365749359130859375e-1;
 i_17 = i_1 + 1.00000001490116119384765625e-1;
 i_22 = i_17 + 1.00000001490116119384765625e-1;
 i_27 = i_22 + 1.00000001490116119384765625e-1;
 i_32 = i_27 + 1.00000001490116119384765625e-1;
 i_37 = i_32 + 1.00000001490116119384765625e-1;
 i_42 = i_37 + 1.00000001490116119384765625e-1;
 i_47 = i_42 + 1.00000001490116119384765625e-1;
 i_52 = i_47 + 1.00000001490116119384765625e-1;
 if (i_52 == 0.0)
   goto <bb 4>; [50.00%]
 else
   goto <bb 3>; [50.00%]

 <bb 3> [local count: 48801565]:

 <bb 4> [local count: 97603129]:
 # lastPoint_12 = PHI <i_52(2), 2.0e+0(3)>
 return lastPoint_12;

Which is we can track floating point ranges in VRP and simplification,
recognize that i_52 != 0.0 and VRP2 should be able to resolve this to 

return 2.0e+0;

Reply via email to