Commit ec214f92 by Martin Liska

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
parent 646cf252
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 ipa/85329
......
......@@ -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
......
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.
2018-04-17 Martin Liska <mliska@suse.cz>
PR ipa/85329
* g++.dg/ext/pr85329-2.C: New test.
* g++.dg/ext/pr85329.C: New test.
......
// { dg-lto-do link }
// { dg-lto-options {{-fPIC -shared -flto}} }
class VclReferenceBase { // { dg-lto-warning "7: type 'struct VclReferenceBase' violates the C\\+\\+ One Definition Rule" }
int mnRefCnt;
bool mbDisposed : 1;
virtual ~VclReferenceBase();
};
class a;
class b {
a &e;
bool c();
};
class B {
VclReferenceBase d;
};
class a : B {};
bool b::c() { return false; }
class VclReferenceBase {
int mnRefCnt;
bool mbDisposed;
protected:
virtual ~VclReferenceBase();
};
class : VclReferenceBase {
} a;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment