public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* egcs and exceptions
@ 1998-10-22  5:46 Andris Pavenis
  1998-10-30  3:25 ` Alexandre Oliva
       [not found] ` <orpvbbt1mq.fsf.cygnus.egcs@araguaia.dcc.unicamp.br>
  0 siblings, 2 replies; 8+ messages in thread
From: Andris Pavenis @ 1998-10-22  5:46 UTC (permalink / raw)
  To: djgpp-workers, egcs

Hi!

When I found problems with exceptions with DJGPP port of egcs-1.1
I tried to study more detailed what works and what fails. 

I used for tests:
	egcs-1.1:
		native compiler for Linux (i586-pc-linux-gnulibc1)
		native compiler for DJGPP (i386-pc-msdosdjgpp)
		cross-compiler from Linux to DJGPP

	egcs-2.92.16 19981019 
		native compiler for Linux
		cross-compiler from Linux to DJGPP (it was more easy
                      for me to build cross-compiler than the native
                      one) 

Here are some results:

with -fsjlj-exceptions : I was not able to get exceptions working
	for both Linux and DJGPP and with stable release (egcs-1.1)
	and with later development snapshot of egcs (egcs-2.92.16).
	Only thing I get from throwing exception is SIGABRT

	So it's seems that -fsjlj-exceptions is broken with egcs-1.1
	and later snapshots

without -fsjlj-exceptions

	Linux (i586-pc-linux-gnulibc1) and egcs-1.1 release

		works. No evident problems

	Linux (i586-pc-msdos-gnulibc1) and snapshot egcs-2.92.16
	
		works when -fomit-frame-pointer is not specified
		SIGABRT with -fomit-frame-pointer

	DJGPP and egcs-1.1 release (both native compiler for DJGPP 
	and cross-compiler from Linux)

		generally works but there are serious problems.
		I have send messages about them egcs mailing list
		and these problems are already discussed in djgpp
		mailing lists

	DJGPP and egcs-2.92.16 (cross-compiler from Linux only)

		does not work at all. I'm getting only SIGABRT


	DJGPP and gcc-2.8.1

		works without problems.

Here is example I used for tests:

-----------------------------------------------------------
#include <iostream>
#include <string>

// Test example for exceptions problem with DJGPP port of egcs-1.1

// If the next line is uncommented all 4 exceptions are catched
//#define  D(x)  x

// If the next line is uncommented only first 3 exceptions are catched.
// The last one ends with abort
#define  D(x)

// With gcc-2.8.1 both tests works Ok

class xx {};

class test
  {
  public:
         string text;

         test (const char * x) : text(x)
           {
               cout << "test::test(\"" << text << "\")\n";
           }

         ~test ()
           {
               cout << "test::~test() : \"" << text << "\"\n";
           }
  };

void  touch ( test & x ); /* Let's fool gcc to think this object is 
                             really used */

void x1 (void) throw (xx)
  {
     D(test w1 ("void x1 (void) throw (xx)"));
     D(touch (w1));
     xx a;
     throw(a);
  }

void x2 (void)
  {
     D(test w2 ("void x2 (void)"));
     D(touch (w2));
     xx a;
//   #ifdef __MSDOS__
//     if (biostime(0,0L)!=0)
//   #endif
        throw(a);
     return;
  }

void x1a (void)
  {
     D(test w3 ("void x1a (void)"));
     D(touch (w3));
     x1 ();
  }

void x1b (void) throw (xx)
  {
     D(test w3 ("void x1b (void)"));
     D(touch (w3));
     x1 ();
  }

int main (void)
{
   try { x1(); } catch (xx w) { cout << "catched from x1()\n"; }
   cout << "----------------\n";
   try { x1b(); } catch (xx w) { cout << "catched from x1b()\n"; }
   cout << "----------------\n";
   try { x1a(); } catch (xx w) { cout << "catched from x1a()\n"; }
   cout << "----------------\n";
   try { x2(); } catch (xx w) { cout << "catched from x2()\n"; }
   cout << "----------------\n";
   return 0;
}

void  touch ( test & )
{
}


--------------------------------------------------------------

Andris


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: egcs and exceptions
@ 1998-11-04  2:20 Klaus-Georg Adams
  0 siblings, 0 replies; 8+ messages in thread
From: Klaus-Georg Adams @ 1998-11-04  2:20 UTC (permalink / raw)
  To: oliva; +Cc: egcs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1469 bytes --]

Alexandre wrote:

> You know...  The more I think about these options that require the
> whole library to be rebuilt, the more I believe we should require them 
> to be specified at some point in compile-time in order to enable them
> at run-time.  Perhaps some additional configure switch that causes
> them to be used to build the library and enables the switch by
> default, or something that causes multilibs to be created to support
> both variants (enabled and disabled) of the particular flag...

I can only support that comment. I have tried to run the bench++ suite
with -sjlj once (maybe Feb-1998) and it was _hard_ to figure out 
- what has to be built with that flag
- and how to reliably do that without having to edit the Makefiles
(that's what I ended up doing).

At one point I had most of the things together, but still some of the
tests crashed (and I wasn't sure if it was another goof of yours truly
or a bug in the EH of egcs).

IMHO things like -fnew-abi or -fsjlj-exceptions should be a
configuretime option (setting them to be the default and building all
the runtime stuff with the Right Flags).

-- kga
-------------------------------------------------------------------------
Klaus-Georg Adams        Email: Klaus-Georg.Adams@chemie.uni-karlsruhe.de
Institut f. Anorg. Chemie, Lehrstuhl II            Tel: 49(0)721 608 3485
Universität Karlsruhe, D-76128 Karlsruhe
-------------------------------------------------------------------------

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

end of thread, other threads:[~1998-11-04  2:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-10-22  5:46 egcs and exceptions Andris Pavenis
1998-10-30  3:25 ` Alexandre Oliva
1998-10-30 14:39   ` Mumit Khan
     [not found] ` <orpvbbt1mq.fsf.cygnus.egcs@araguaia.dcc.unicamp.br>
1998-10-31  2:52   ` Jason Merrill
1998-10-31  5:02     ` Alexandre Oliva
1998-11-02 22:42       ` Jason Merrill
1998-11-03  6:36         ` Alexandre Oliva
1998-11-04  2:20 Klaus-Georg Adams

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