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

--- Comment #5 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
>               /* We should be able to reverse all conditions.  */
>               gcc_assert (inv_cond_code != UNKNOWN);
> 
> Obvious this code is broken because The quiet UN* was converted into the an
> unordered-signalling comparison which was bad.
> 
> Quote from the recent change:
> And it would do the same in reverse: convert a quiet UN* into an
> unordered-signalling comparison.
> 
> So obvious this code in aarch64_do_track_speculation was broken when it was
> added, just the aarch64 back-end was broken to do the wrong thing in the
> first place so we never able to hit the assert before hand.

At least as far as Arm hardware is concerned, there is no such thing as an
unreversible comparison.  The Arm condition codes (except AL, which isn't
really a condition) are all 100% reversisble.

The problem here is GCC's insane convolution of the comparison phase with the
final condition and hence its insistance that reversing, say LT to UNGE is not
possible because the associated comparison must change.  This is frankly
bonkers.  If we want to force the choice of a trapping/non-trapping comparison,
it really, Really, REALLY should be described independently of the condition
under which the branch is taken.

Reply via email to