This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/82692] [8 Regression] Ordered comparisons used for unordered built-ins
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 25 Oct 2017 11:59:23 +0000
- Subject: [Bug rtl-optimization/82692] [8 Regression] Ordered comparisons used for unordered built-ins
- Auto-submitted: auto-generated
- References: <bug-82692-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82692
--- Comment #14 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Uroš Bizjak from comment #13)
> (In reply to Segher Boessenkool from comment #12)
> > But why only do this for FLOAT_MODE_P? Either the logic here isn't
> > correct, or cc_modes_compatible isn't the correct hook (we'll need
> > a new hook then?), or determining ordered/unordered by CC mode does
> > not work (does not fit into how RTL works).
>
> Non-FP compares can select different mode depending on their operands (e.g.
> CCmode to CCZmode when one operand is zero) without secondary effects. But
> when reversing the condition from UNGE -> LT, SELECT_CC_MODE will return
> trapping mode (LT), whereas original, non-reversed mode (UNGE) was
> non-trapping. Please see how targets depend mode of their FP compares on the
> condition code.
>
> The solution here is to keep the original comparison mode for FP compares
> (as was proposed in the first version of the patch): when qNaN is
> encountered at this point, an exception has to be generated, no matter how
> the condition was changed.
... an exception should not be generated ... in the above case, when UNGE is
reversed to LT.