[patch] Fix LTO warning on types with variable offsets
Eric Botcazou
ebotcazou@adacore.com
Fri May 14 21:57:00 GMT 2010
Hi,
this is exposed by ACATS cc54002. The LTO compiler fails to merge compatible
types when they contain a field with variable (self-referential) offset and
thus issues a warning. Such an offset is meaningless once gimplification is
done because it has been instantiated as operand #2 of the COMPONENT_REF
built for each access, and is therefore reset.
Tested on i586-suse-linux, Ok for mainline?
2010-05-14 Eric Botcazou <ebotcazou@adacore.com>
* gimple.h (compare_field_offset): Rename into...
(gimple_compare_field_offset): ...this.
* gimple.c (compare_field_offset): Rename into...
(gimple_compare_field_offset): ...this. Compare the full access if
the offset is self-referential.
(gimple_types_compatible_p): Adjust for above renaming.
* lto-streamer-in.c (input_gimple_stmt): Likewise. Also compare the
DECL_NONADDRESSABLE_P flag of fields before merging them.
2010-05-14 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/lto9.adb: New test.
* gnat.dg/lto9_pkg1.ads: New helper.
* gnat.dg/lto9_pkg2.ad[sb]: Likewise.
--
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 3474 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100514/6f0707ab/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lto9.adb
Type: text/x-adasrc
Size: 267 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100514/6f0707ab/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lto9_pkg1.ads
Type: text/x-adasrc
Size: 623 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100514/6f0707ab/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lto9_pkg2.adb
Type: text/x-adasrc
Size: 249 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100514/6f0707ab/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lto9_pkg2.ads
Type: text/x-adasrc
Size: 482 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100514/6f0707ab/attachment-0004.bin>
More information about the Gcc-patches
mailing list