public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Robert Lipe <robertl@dgii.com>
To: egcs@cygnus.com
Subject: init1.C failure under study
Date: Sat, 29 Nov 1997 09:29:00 -0000	[thread overview]
Message-ID: <19971129112737.14113@dgii.com> (raw)

This test works on OpenServer ELF, but not COFF.   Whether this is
something in the way sco5.h handles initializers, I can't tell.

If I remove the word 'static' in the function f, this test passes
under COFF.   It also makes more of a difference in the assembly
than I'd have guessed.   This is one of only two g++ tests (p2736.C
is the other)that fails in COFF that doesn't fail in ELF.

Are there any other x86 COFF targets represented on the list?

Can anyone offer good hints where to look?

I stated earlier that this started failing around 1101.    That
is incorrect.   I just fixed the test fixture on 1101 and the
earlier results were the ones that printed "-mcoff" on the headers
but never bothered to pass it down to GCC.  So this problem likely
has tenure. 

Thanx,
RJL


int count;

extern "C" void _exit(int);

struct C {
  ~C() { if (count != 1) _exit(1); }
} c;

class A {
public:
  ~A () { ++count; }
};

void f() {
  static A a;
}

void g() {
  // Since this isn't constructed, we can't destruct it.
  static A a;
}

int main () {
  f();
}


             reply	other threads:[~1997-11-29  9:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-11-29  9:29 Robert Lipe [this message]
     [not found] <19971129112737.14113.cygnus.egcs@dgii.com>
1997-11-30  3:17 ` Jason Merrill
1997-11-30 20:14   ` Robert Lipe
1997-11-30 22:31   ` Robert Lipe

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=19971129112737.14113@dgii.com \
    --to=robertl@dgii.com \
    --cc=egcs@cygnus.com \
    /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).