This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: A patch to constify gcc.c (Really, summarizing remaining warnings)
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: A patch to constify gcc.c (Really, summarizing remaining warnings)
- From: Zack Weinberg <zack at rabi dot columbia dot edu>
- Date: Thu, 11 Mar 1999 11:19:42 -0500
- cc: egcs-patches at cygnus dot com
On Thu, 11 Mar 1999 11:08:45 -0500 (EST), "Kaveh R. Ghazi" wrote:
> I attempted to figure this out myself and I poked around one
>of the places where the warning occurs. One triggering site is in
>cse.c:simplify_relational_operation, where it calls setjmp(). The
>particular code in question does this:
>
> > else if (GET_CODE (op0) == CONST_DOUBLE && GET_CODE (op1) == CONST_DOUBLE
> > && GET_MODE_CLASS (GET_MODE (op0)) == MODE_FLOAT)
> > {
> > REAL_VALUE_TYPE d0, d1;
> > jmp_buf handler;
> >
> > if (setjmp (handler))
> > return 0;
> >
> > set_float_handler (handler);
> > REAL_VALUE_FROM_CONST_DOUBLE (d0, op0);
> > REAL_VALUE_FROM_CONST_DOUBLE (d1, op1);
> > equal = REAL_VALUES_EQUAL (d0, d1);
> > op0lt = op0ltu = REAL_VALUES_LESS (d0, d1);
> > op1lt = op1ltu = REAL_VALUES_LESS (d1, d0);
> > set_float_handler (NULL_PTR);
> > }
I bet something like this will have the same effect as rth's suggestion:
{
jmp_buf handler;
if (setjmp (handler))
return 0;
set_float_handler (handler);
{
REAL_VALUE_TYPE d0, d1;
REAL_VALUE_FROM_CONST_DOUBLE (d0, op0);
REAL_VALUE_FROM_CONST_DOUBLE (d1, op1);
equal = REAL_VALUES_EQUAL (d0, d1);
op0lt = op0ltu = REAL_VALUES_LESS (d0, d1);
op1lt = op1ltu = REAL_VALUES_LESS (d1, d0);
}
set_float_handler (NULL_PTR);
}
d0 and d1 are out of scope of the longjmp target, so it should be
clear to gcc that we don't care about the values if we jump.
zw