+2014-09-10 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/61654
+ * cgraphclones.c (duplicate_thunk_for_node): Copy arguments of the
+ new decl properly. Analyze the new thunk if it is expanded.
+
2014-09-10 Andreas Schwab <schwab@suse.de>
* coretypes.h (struct _dont_use_rtx_insn_here_, rtx_insn)
node->clone.args_to_skip,
false);
}
+
+ tree *link = &DECL_ARGUMENTS (new_decl);
+ int i = 0;
+ for (tree pd = DECL_ARGUMENTS (thunk->decl); pd; pd = DECL_CHAIN (pd), i++)
+ {
+ if (!node->clone.args_to_skip
+ || !bitmap_bit_p (node->clone.args_to_skip, i))
+ {
+ tree nd = copy_node (pd);
+ DECL_CONTEXT (nd) = new_decl;
+ *link = nd;
+ link = &DECL_CHAIN (nd);
+ }
+ }
+ *link = NULL_TREE;
+
gcc_checking_assert (!DECL_STRUCT_FUNCTION (new_decl));
gcc_checking_assert (!DECL_INITIAL (new_decl));
gcc_checking_assert (!DECL_RESULT (new_decl));
symtab->call_edge_duplication_hooks (thunk->callees, e);
if (!new_thunk->expand_thunk (false, false))
new_thunk->analyzed = true;
+ else
+ {
+ new_thunk->thunk.thunk_p = false;
+ new_thunk->analyze ();
+ }
symtab->call_cgraph_duplication_hooks (thunk, new_thunk);
return new_thunk;
+2014-09-10 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/61654
+ * g++.dg/ipa/pr61654.C: New test.
+
2014-09-10 Jakub Jelinek <jakub@redhat.com>
* c-c++-common/ubsan/attrib-3.c: New test.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+/* The bug only presented itself on a 32 bit i386 but in theory it might also
+ pop up elsewhere and we do not want to put -m32 options to testcase
+ options. */
+
+struct A
+{
+ virtual int a (int, int = 0) = 0;
+ void b ();
+ void c ();
+ int d;
+};
+
+struct B : virtual A
+{
+ int a (int, int);
+ int e;
+};
+
+int f;
+
+void
+A::b ()
+{
+ a (0);
+}
+
+void
+A::c ()
+{
+ a (f);
+}
+
+int
+B::a (int, int)
+{
+ return e;
+}