This is the mail archive of the
mailing list for the GCC project.
Re: c enable-checking failure
- To: Jim Wilson <wilson at cygnus dot com>
- Subject: Re: c enable-checking failure
- From: Jason Merrill <jason at cygnus dot com>
- Date: 11 Jul 1998 13:52:44 -0700
- Cc: law at cygnus dot com, Richard Henderson <rth at cygnus dot com>, egcs-patches at cygnus dot com
- References: <199807072029.NAA16663@rtl.cygnus.com>
>>>>> Jim Wilson <firstname.lastname@example.org> writes:
>> The exact situation was a NOP to the same integer type, so one
>> might wonder if fold isn't supposed to take care of that.
> Good question. Or maybe it's stripped out during tree->rtl conversion.
> The NOP_EXPRs are deliberately added so that we can tell the difference
> between a constant, and an expression that was reduced to a constant.
> This is needed to correctly handle C null pointer constants, which must
> be an integral constant expression. Ideally, there should be a NOP_EXPR
> at the end if and only if the original expression was not an integral
> constant expression. It is possible though that we are adding the
> NOP_EXPRs when they aren't strictly necessary.
We are. The code hits
if (integer_zerop (arg1))
return non_lvalue (convert (type, arg0));
and non_lvalue adds the NOP regardless of whether arg0 is constant or not.
That seems wrong.