public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* init1.C failure under study
@ 1997-11-29  9:29 Robert Lipe
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Lipe @ 1997-11-29  9:29 UTC (permalink / raw)
  To: egcs

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();
}


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1997-11-30 22:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <19971129112737.14113.cygnus.egcs@dgii.com>
1997-11-30  3:17 ` init1.C failure under study Jason Merrill
1997-11-30 20:14   ` Robert Lipe
1997-11-30 22:31   ` Robert Lipe
1997-11-29  9:29 Robert Lipe

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).