On Sun, Oct 2, 2011 at 11:51 AM, Jason Merrill <ja...@redhat.com> wrote: > On 10/02/2011 12:10 PM, Gabriel Dos Reis wrote: >> >> The comment wasn't about comparison of typedefs -- the patch did not >> compare >> typedefs. > >> *Value* representations should not change just because a type name was >> introduced via a typedef. > > Values (and expressions in general) have types.
Yes, values have types. A value has exactly one type, not two, or three, etc, typedef notwithstanding. So a value representation should be unique too. > If the types aren't ==, then neither are two equal values with those types. Hmm, I do not think that follows. A value is unique. We do not have zillion boolean values "true". We only have one. So, when we reduce a well-formed boolean expression to a value, it should be either the boolean "true" or the "boolean "false". In my opinion, we should not be looking at the integer representation, we should just compare it (with ==) against one of the canonical boolean nodes. > Are you suggesting we strip typedefs for constant values? I guess it amounts to that, yes. For a given type, we should have only one node for a given value, without having to compare representations. -- Gaby