public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ajd at gentrack dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/33704] AIX runs c++ constructors in incorrect order
Date: Tue, 09 Oct 2007 01:49:00 -0000	[thread overview]
Message-ID: <20071009014855.16552.qmail@sourceware.org> (raw)
In-Reply-To: <bug-33704-8038@http.gcc.gnu.org/bugzilla/>



------- Comment #2 from ajd at gentrack dot com  2007-10-09 01:48 -------
Created an attachment (id=14325)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14325&action=view)
testcase shows constructors running in incorrect order

Compile like:
g++ -shared -o liba1.a -D LIBNAME=LIB1 test_init_order.cpp
g++ -shared -L. -la1 -o liba2.a -D LIBNAME=LIB2 -DCALLEE=LIB1
test_init_order.cpp
g++ -shared -L. -la2 -o liba3.a -D LIBNAME=LIB3 -DCALLEE=LIB2
test_init_order.cpp
g++ -L. -la3 -o m -D LIBNAME=main -DCALLEE=LIB3 test_init_order.cpp

Creates libraries dependencies like:
m -> LIB3 -> LIB2 -> LIB1

Expected output is:
LIB1_init
LIB2_init
LIB3_init
main_init
main()
LIB3()
LIB2()
LIB1()
main_fini
LIB3_fini
LIB2_fini
LIB1_fini

Actual output is:
main_init
LIB3_init
LIB2_init
LIB1_init
main()
LIB3()
LIB2()
LIB1()
LIB1_fini
LIB2_fini
LIB3_fini
main_fini


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33704


  parent reply	other threads:[~2007-10-09  1:49 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-09  1:46 [Bug target/33704] New: " ajd at gentrack dot com
2007-10-09  1:48 ` [Bug target/33704] " pinskia at gcc dot gnu dot org
2007-10-09  1:49 ` ajd at gentrack dot com [this message]
2007-10-09  1:50 ` ajd at gentrack dot com
2007-10-09  1:50 ` ajd at gentrack dot com
2007-10-09  1:56 ` ajd at gentrack dot com
2007-10-09  1:59 ` pinskia at gcc dot gnu dot org
2007-10-09  2:43 ` ajd at gentrack dot com
2007-10-09  3:43 ` bangerth at dealii dot org
2007-10-09 12:50 ` dje at gcc dot gnu dot org
2007-10-09 14:54 ` bangerth at dealii dot org
2007-10-09 15:08 ` dje at gcc dot gnu dot org
2007-10-09 15:18 ` bangerth at dealii dot org
2007-10-09 20:06 ` ajd at gentrack dot com
2007-10-09 21:10 ` dje at gcc dot gnu dot org
2007-10-09 21:45 ` ajd at gentrack dot com
2007-10-10  3:17 ` dje at gcc dot gnu dot org
2007-10-10  4:04 ` ajd at gentrack dot com
2007-10-12 12:56 ` dje at gcc dot gnu dot org
2007-10-14 21:39 ` ajd at gentrack dot com
2007-10-18  0:48 ` dje at gcc dot gnu dot org
2007-10-19  1:44 ` ajd at gentrack dot com
2007-10-19  2:01 ` bkoz at gcc dot gnu dot org
     [not found] <bug-33704-4@http.gcc.gnu.org/bugzilla/>
2013-11-23 15:38 ` dje at gcc dot gnu.org
2015-03-18 12:42 ` dje at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071009014855.16552.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).