https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103221
--- Comment #11 from Andrew Macleod <amacleod at redhat dot com> --- Created attachment 64584 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64584&action=edit Patch to add a copy prop pass EVRP produces: signed char f (signed char a) { signed char v; <bb 2> : if (a_2(D) < 0) goto <bb 3>; [INV] else goto <bb 4>; [INV] <bb 3> : v_4 = a_2(D); <bb 4> : # v_1 = PHI <a_2(D)(2), v_4(3)> return v_1; } And adding a copy prop pass right after EVRP produces : signed char f (signed char a) { signed char v; <bb 2> : return a_2(D); } I think something to that effect is your solution.
