This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][C-Family] Disable bogus shortening of DFP vs FP compare


On Tue, 4 Nov 2014, Joseph Myers wrote:

> On Tue, 4 Nov 2014, Richard Biener wrote:
> 
> > 	c-family/
> > 	* c-common.c (shorten_compare): Do not shorten mixed
> > 	DFP and non-DFP compares.
> 
> OK.  I think it's also wrong for get_narrower to strip conversions between 
> binary and decimal floating point at all, as all such conversions for 
> supported pairs of types can change values.  (_Decimal128 can represent 
> all values of __fp16, but no target currently supports both types.)  And 
> if flag_signaling_nans (strictly, if HONOR_SNANS (source-mode)), no 
> floating-point conversions should be stripped in get_narrower at all.  And 
> even without signaling NaNs, TYPE_PRECISION may not be a reliable 
> indication of whether a conversion is widening - the only issue applying 
> at present might be the corner case that a conversion of a subnormal from 
> __float80 to __float128 is exact but still raises "underflow" if traps on 
> underflow are enabled, but when you have both binary128 and IBM long 
> double supported together then neither has a set of values that is a 
> superset of the other (it seems 
> <https://gcc.gnu.org/ml/gcc-patches/2014-07/msg01086.html> misses 
> get_narrower in the places that need addressing).

>From this and past issues it looks like most (if not all) conversions
between FP types use CONVERT_EXPR, not NOP_EXPR and thus may work
"as expected" here.  That's of course somewhat unreliable as the
middle-end happily uses NOP_EXPR for those.

Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]