PATCH RFA: Better warnings for CONST_DOUBLE

Ian Lance Taylor ian@airs.com
Thu Jul 28 22:44:00 GMT 2005


Richard Henderson <rth@redhat.com> writes:

> 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.

In that case, here are the other potential trouble spots I found.  I
don't know that all of these can be called with a CONST_DOUBLE, but it
certainly looks like some of them can be:

exp_equiv_p in cse.c
rtx_equal_for_cselib_p in cselib.c
rtx_renumbered_equal_p in jump.c
rtx_equal_for_loop_p in loop.c
rtx_equal_for_prefetch_p in loop.c
operands_match_p in reload.c

Ian



More information about the Gcc-patches mailing list