diff options
author | Martin Liska <marxin@gcc.gnu.org> | 2018-04-17 05:41:40 +0000 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-04-17 05:41:40 +0000 |
commit | ec214f928cc0cab6c190ed414da7e81c067fb869 (patch) | |
tree | b4b0f0f4ed99857559052fca2b08986438aafcf3 /gcc/ipa-devirt.c | |
parent | 646cf2527541fb8928deee0d7eda9ca75a591328 (diff) | |
download | gcc-ec214f928cc0cab6c190ed414da7e81c067fb869.zip gcc-ec214f928cc0cab6c190ed414da7e81c067fb869.tar.gz gcc-ec214f928cc0cab6c190ed414da7e81c067fb869.tar.bz2 |
Support bitfields in Wodr machinery (PR lto/85405).
2018-04-17 Jan Hubicka <jh@suse.cz>
PR lto/85405
* ipa-devirt.c (odr_types_equivalent_p): Handle bit fields.
2018-04-17 Martin Liska <mliska@suse.cz>
PR lto/85405
* g++.dg/lto/pr85405_0.C: New test.
* g++.dg/lto/pr85405_1.C: New test.
From-SVN: r259429
Diffstat (limited to 'gcc/ipa-devirt.c')
-rw-r--r-- | gcc/ipa-devirt.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index fa9380c..5da0f72 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -1587,8 +1587,15 @@ odr_types_equivalent_p (tree t1, tree t2, bool warn, bool *warned, "in another translation unit")); return false; } - gcc_assert (DECL_NONADDRESSABLE_P (f1) - == DECL_NONADDRESSABLE_P (f2)); + if (DECL_BIT_FIELD (f1) != DECL_BIT_FIELD (f2)) + { + warn_odr (t1, t2, f1, f2, warn, warned, + G_ ("one field is bitfield while other is not ")); + return false; + } + else + gcc_assert (DECL_NONADDRESSABLE_P (f1) + == DECL_NONADDRESSABLE_P (f2)); } /* If one aggregate has more fields than the other, they |