Hi!

While working on PR70035, I've noticed that the clobbers at the start of
(certain) constructors are strangely emitted twice instead of just once.
The problem is that start_preparsed_function is first called on the
(abstract) constructor and then again on the cloned constructors (base or
complete ctor).  And in each case the clobber is emitted.

Fixed by only emitting it on the (abstract) constructor, not on the clones.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2016-03-04  Jakub Jelinek  <ja...@redhat.com>

        * decl.c (start_preparsed_function): Don't emit start clobber at the
        start of constructor clones.

--- gcc/decl.c.jj       2016-03-04 19:35:09.000000000 +0100
+++ gcc/decl.c  2016-03-04 19:38:17.040994718 +0100
@@ -14120,6 +14120,7 @@ start_preparsed_function (tree decl1, tr
   if (!processing_template_decl
       && (flag_lifetime_dse > 1)
       && DECL_CONSTRUCTOR_P (decl1)
+      && !DECL_CLONED_FUNCTION_P (decl1)
       /* We can't clobber safely for an implicitly-defined default constructor
         because part of the initialization might happen before we enter the
         constructor, via AGGR_INIT_ZERO_FIRST (c++/68006).  */

        Jakub

Reply via email to