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]
Other format: [Raw text]

Re: [PATCH][LTO] Re-set boolean_type_node in free_lang_data


On Wed, Oct 14, 2009 at 1:53 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> Sure, but that's a different boolean_type_node then. ?And I don't
>> see a problem with that - do you?
>
> Yes, I do, I don't see what will prevent an optimizer from rewriting a boolean
> expression, say a condition, originally in 8-bit boolean, into an equivalent
> boolean expression in 1-bit boolean; this will change the semantics of the
> code, admittedly in rare corner cases but still.

Well, that would be a bug in the optimizer.  Optimizers cannot simply
change types of variables.  What optimizers do is if they build new
tcc_comparison expressions, simply use boolean_type_node as the
result type.  Which will be ok.  If that is assigned to an existing
formerly-boolean-type-node
typed variable the type verifier will complain unless the optimizer adds
a conversion.

>> I'm not convinced there is any breakage. ?I guess you do not
>> have a testcase as otherwise you'd have shown it already, no?
>
> Right, I haven't found any yet. ?But I nevertheless think that the hack should
> be eliminated sooner than later.

It's not a hack!  It's by design - and even correct!  Even the sizetype
case is correct - just the middle-end cannot deal at all with two
different sizetypes because of the awkward POINTER_PLUS_EXPR choice
(we simply could make it take either sizetype or ssizetype though).

Richard.


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