On 10/30/2017 01:28 PM, Richard Biener wrote: > On October 30, 2017 8:22:52 PM GMT+01:00, Marc Glisse <marc.gli...@inria.fr> > wrote: >> On Mon, 30 Oct 2017, Jeff Law wrote: >> >>>> +/* Optimize various special cases of (FTYPE) N CMP (FTYPE) M. */ >>>> +(for cmp (lt le eq ne ge gt) >>>> + (simplify >>>> + (cmp (float@0 @1) (float @2)) >>> Since this runs on GENERIC as well as GIMPLE, I don't think you can >> rely >>> on the types of the float expressions being the same?!? Which >> implies >>> subsequent code will need and fmt1/fmt2 because you don't know >> they're >>> necessarily the same. >> >> Why would GENERIC have comparisons of operands with different types? >> The >> front-ends first convert both sides to the same type before sending it >> anywhere near the folding machinery. I am pretty sure we have a number >> of >> other places in match.pd where we assume that the existence of the >> expression "a OP b" implies that the types of a and b are the same. > > In fact GENERIC is more strict and requires equal types for operands. I always thought the type system didn't come into play until we hit GIMPLE and that in GENERIC we could have mismatched types. If I'm wrong, then obviously ignore the question/concern :-)
jeff