Re: [committed] [P1][PR target/94238] Don't create invalid comparisons

2020-03-30 Thread Jeff Law via Gcc-patches
On Tue, 2020-03-24 at 10:50 +0100, Jakub Jelinek wrote: > On Mon, Mar 23, 2020 at 06:00:06PM -0600, Jeff Law via Gcc-patches wrote: > > +/* Return true if CODE is valid for comparisons of mode MODE, false > > + otherwise. > > + > > + It is always safe to return false, even if the code was valid

Re: [committed] [P1][PR target/94238] Don't create invalid comparisons

2020-03-24 Thread Jakub Jelinek via Gcc-patches
On Mon, Mar 23, 2020 at 06:00:06PM -0600, Jeff Law via Gcc-patches wrote: > +/* Return true if CODE is valid for comparisons of mode MODE, false > + otherwise. > + > + It is always safe to return false, even if the code was valid for the > + given mode as that will merely suppress optimizatio

[committed] [P1][PR target/94238] Don't create invalid comparisons

2020-03-23 Thread Jeff Law via Gcc-patches
As outlined in the BZ simplify_logical_relational_operation does not validate that the comparison code it selects is ultimately valid for the mode of the comparison. So we could have something like: (ior (lt (...)) (gt (...)) Which it happily turns into (ltgt (...)) Which is not valid for int