This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix LTO warning on types with variable offsets
On Sun, May 16, 2010 at 12:15 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> Note that merging too many types is as problematic as merging not enough
>> types. ?I at least wanted to ask why you compare DECL_SIZE in
>> gimple_compare_field_offset when it explicitely says it will compare
>> the offset only.
>
> That's explained in the comment, isn't it?
Is it?
+ /* Once gimplification is done, self-referential offsets are
+ instantiated as operand #2 of the COMPONENT_REF built for
+ each access and reset. Therefore, they are not relevant
+ anymore and fields are interchangeable provided that they
+ represent the same access. */
This function is not about field interchangability but about fields
having the same offset.
>> The size check should be covered by the caller comparing the type of the
>> field, no?
Which means the represent the same access if the types are equal.
> No, think of bitfields.
I don't see how bitfields are any different. We might want to compare
DECL_BIT_FIELD as well in the callers, and also compare
DECL_BIT_FIELD_TYPE in that case.
Richard.
> --
> Eric Botcazou
>