This is the mail archive of the
mailing list for the GCC project.
Re: PATCH RFA: Better warnings for CONST_DOUBLE
On Thu, Jul 28, 2005 at 09:51:41AM -0700, Ian Lance Taylor wrote:
> ... but it ran into trouble with
> various functions which use the rtx format and actually access the
> real_value_format value as a sequence of HOST_WIDE_INT values. For
> example, exp_equiv_p in cse.c.
This is a serious bug. Not all of the fields of the real_value
are defined at all times. One MUST use the appropriate comparison
functions from real.h.
Fortunately, fixing this one case is as easy as adding a case to
the switch statement, CONST_DOUBLE right underneath the CONST_INT
case, since we now canonicalize all CONST_DOUBLEs.
> I don't currently have access to any non-i386 targets. Would anybody
> care to volunteer to test other targets? Geoff already volunteered to
> test PowerPC Darwin.
I can do ia64 and alpha.
> * rtl.h: Include "real.h".
> (struct rtx_def): Add rv field to union.
> (XCMWINT, XCNMWINT): Define.
> (rtl_check_failed_code_mode): Declare.
> (CONST_DOUBLE_LOW, CONST_DOUBLE_HIGH): Use XCWINT.
> (CONST_DOUBLE_REAL_VALUE): Use XCNMWINT.
> * rtl.c (rtl_check_failed_code_mode): New function.
> * Makefile.in (RTL_BASE_H): Add real.h.
Yes, this is a good start.