This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Check precision rather than machine mode in STRIP_NOPS and STRIP_SIGN_NOPS
Eric Botcazou writes:
> > Based on verify_gimple_assign_unary we can only have conversion between
> > ENUM_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, OFFSET_TYPE, POINTER_TYPE and
> > REFERENCE_TYPE here which I think can be removed as long as they have the
> > same precision.
>
> You can have conversions for basically everything, e.g between the const and
> the non-const version of an aggregate type.
Do you mean here conversions that are processed by STRIP_NOPS? STRIP_NOPS is
not used to process all conversions. There are things that are converted with
other operators like FLOAT_EXPR, FIX_TRUNC_EXPR, VIEW_CONVERT_EXPR, etc. This
code solely handles NOP_EXPR, CONVERT_EXPR and NON_LVALUE_EXPR.
And even if this type of conversion were used for your example, how would
keeping the check for TYPE_MODE change anything? I am assuming that the same
machine mode and precision is used for an aggregate type regardless of its
constness.
Speaking of converting between const and non-const version of an aggregate
type, I guess I should really test this patch with Ada as well.
Adam