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]

Re: c enable-checking failure


>>>>> Jim Wilson <wilson@cygnus.com> 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.

Jason


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