public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* erase operation in STL
@ 1997-08-31 18:57 Weiwen Liu
  1997-08-31 18:57 ` Results for haifa-enabled egcs-970828 g++ testsuite on sparc-sun-sunos4.1.3 Alexandre Oliva
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Weiwen Liu @ 1997-08-31 18:57 UTC (permalink / raw)
  To: egcs

I have a problem when class vector of STL is used with egcs-970828.

In the following program, a vector av of two elements is created.
Then the first element is erased.  Naturally I expect the destructor
for the first element is called, but instead STL calls the destructor
of the second element.  When the program exits, the destructor for the
second element (now becoming the first element) is called again.

I have no access of other implementation of STL.  Could someone tell
me if this behavior is correct?

Weiwen
=====================
#include 
#include 

class A
{
public:
    A(int n)
            :itsA(n)
    {}
    ~A()
    {cout  av;
    cout 

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

* Results for haifa-enabled egcs-970828 gcc testsuite on sparc-sun-sunos4.1.3
  1997-08-31 18:57 erase operation in STL Weiwen Liu
  1997-08-31 18:57 ` Results for haifa-enabled egcs-970828 g++ testsuite on sparc-sun-sunos4.1.3 Alexandre Oliva
@ 1997-08-31 18:57 ` Alexandre Oliva
  1997-08-31 19:45 ` My m68k-unknown-netbsd1.2g patch Allen Briggs
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Alexandre Oliva @ 1997-08-31 18:57 UTC (permalink / raw)
  To: egcs

Test Run By oliva on Sun Aug 31 03:35:32 1997
Native configuration is sparc-sun-sunos4.1.3

		=== gcc tests ===

FAIL: gcc.c-torture/compile/961203-1.c,  -O0  
FAIL: gcc.c-torture/compile/961203-1.c,  -O1  
FAIL: gcc.c-torture/compile/961203-1.c,  -O2  
FAIL: gcc.c-torture/compile/961203-1.c,  -O2 -fomit-frame-pointer -finline-functions  
FAIL: gcc.c-torture/execute/920501-8.c compilation,  -O0 
FAIL: gcc.c-torture/execute/920501-8.c compilation,  -O1 
FAIL: gcc.c-torture/execute/920501-8.c compilation,  -O2 
FAIL: gcc.c-torture/execute/920501-8.c compilation,  -O2 -fomit-frame-pointer -finline-functions 
FAIL: gcc.c-torture/execute/loop-2f.c execution,  -O0 
FAIL: gcc.c-torture/execute/loop-2f.c execution,  -O1 
FAIL: gcc.c-torture/execute/loop-2f.c execution,  -O2 
FAIL: gcc.c-torture/execute/loop-2f.c execution,  -O2 -fomit-frame-pointer -finline-functions 
FAIL: gcc.c-torture/execute/loop-2f.c execution,  -O2 -fomit-frame-pointer -finline-functions -funroll-loops 
FAIL: gcc.c-torture/execute/loop-2f.c execution,  -O2 -fomit-frame-pointer -finline-functions -funroll-all-loops 

		=== gcc Summary ===

# of expected passes		4863
# of unexpected failures	14
# of expected failures		4
# of untested testcases		4
# of unsupported tests		6
/n/temp1/gcctest/bin/egcshc version egcs-2.90.03 970828 (gcc2-970802 experimental)
configure flags: --with-gnu-as --enable-shared --enable-haifa
BOOT_CFLAGS: -O4 -g -DFFEPROJ_STRTOUL=0

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

* Re: Results for haifa-enabled egcs-970828 g++ testsuite on sparc-sun-sunos4.1.3
  1997-08-31 18:57 erase operation in STL Weiwen Liu
@ 1997-08-31 18:57 ` Alexandre Oliva
  1997-08-31 18:57 ` Results for haifa-enabled egcs-970828 gcc " Alexandre Oliva
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Alexandre Oliva @ 1997-08-31 18:57 UTC (permalink / raw)
  To: egcs

Joe Buck writes:

> The following tests seem to get XPASS on all platforms tested.  Evidently
> a bug or two has been fixed.  Should they be changed to "expected pass"
> for next time?

I think so.  It was fixed in ss-970803, as far as I remember.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
Universidade Estadual de Campinas, SP, Brasil

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

* My m68k-unknown-netbsd1.2g patch
  1997-08-31 18:57 erase operation in STL Weiwen Liu
  1997-08-31 18:57 ` Results for haifa-enabled egcs-970828 g++ testsuite on sparc-sun-sunos4.1.3 Alexandre Oliva
  1997-08-31 18:57 ` Results for haifa-enabled egcs-970828 gcc " Alexandre Oliva
@ 1997-08-31 19:45 ` Allen Briggs
  1997-08-31 20:05 ` Small patch for NetBSD Jeffrey A Law
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Allen Briggs @ 1997-08-31 19:45 UTC (permalink / raw)
  To: egcs

A note about my last patch.  It looks like my inclusion of 
in netbsd.h causes some redefinitions of symbols from glimits.h because
 includes  which is not currently
protected against multiple inclusion (that will be rectified shortly).
This is a problem because it follows the inclusion of glimits.h.

The problems only appear in the fortran subdirectory--it appears that
config.h isn't included very early at all...  I'm also seeing
a lot of warnings about "subscript has type 'char'" in there...

Anyway, I don't know how many pre-NetBSD-1.0 machines are out there
wanting to compile gcc/egcs, or if these warnings are important.

I see the following options if we want things to work on current
and future versions of NetBSD:

	* Apply my patch as-is.  NetBSD 1.3 and NetBSD-current after
	  today or so will be OK, but earlier versions will get these
	  warnings in gcc/f.

	* Apply my patch as-is and fix gcc/f to include config.h before
	  glimits.h.  I don't know enough to get into fortran.

	* Do not support pre-NetBSD-1.0 systems at all and just define
	  DONT_DECLARE_SYS_SIGLIST (or whatever it was) in netbsd.h.
	  This will break on pre-1.0 systems, but it should be easy to
	  figure out why or put a note in the release notes.

I'll have test results whenever I can get through a "all-bootstrap"
successfully...  ;-)

-allen

-- 
              Allen Briggs - end killing - briggs@macbsd.com

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

* Re: Small patch for NetBSD
  1997-08-31 18:57 erase operation in STL Weiwen Liu
                   ` (2 preceding siblings ...)
  1997-08-31 19:45 ` My m68k-unknown-netbsd1.2g patch Allen Briggs
@ 1997-08-31 20:05 ` Jeffrey A Law
  1997-08-31 21:31 ` erase operation in STL YMP Consulting Inc.
  1997-08-31 21:31 ` egcs 970828 and X11 on linux/x86 Jeffrey A Law
  5 siblings, 0 replies; 7+ messages in thread
From: Jeffrey A Law @ 1997-08-31 20:05 UTC (permalink / raw)
  To: egcs

  In message you write:
  > NetBSD declares sys_errlist--this caused the texinfo compile to break
  > since it also declares sys_errlist (for mystrerror()).  I won't bother
  > sending in a patch for that since I compiled the current texinfo with
  > no trouble recently.  However,
  > 
  > NetBSD has defined sys_siglist since version 1.0.  Here is a patch
  > that allows the 970828 collect2.c to compile when configured for
  > m68k-unknown-netbsd1.2g:
  > 
  > Sun Aug 31 11:38:55 1997  Allen Briggs (briggs@macbsd.com)
  > 
  > 	* netbsd.h: Define DONT_DECLARE_SYS_SIGLIST if >= NetBSD 1.0.
The way to go is to use autoconf to detect when SYS_SIGLIST and
friends need to be declared.  I'm actively working on a patch for
this problem.

Jeff

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

* Re: erase operation in STL
  1997-08-31 18:57 erase operation in STL Weiwen Liu
                   ` (3 preceding siblings ...)
  1997-08-31 20:05 ` Small patch for NetBSD Jeffrey A Law
@ 1997-08-31 21:31 ` YMP Consulting Inc.
  1997-08-31 21:31 ` egcs 970828 and X11 on linux/x86 Jeffrey A Law
  5 siblings, 0 replies; 7+ messages in thread
From: YMP Consulting Inc. @ 1997-08-31 21:31 UTC (permalink / raw)
  To: egcs

What is happening is 2 is being assinged to 1, and then the old
2 is destroyed.

In vectors erase causes later objects to be shifted down.

I Hope this helps.

Weiwen Liu wrote:
> 
> I have a problem when class vector of STL is used with egcs-970828.
> 
> In the following program, a vector av of two elements is created.
> Then the first element is erased.  Naturally I expect the destructor
> for the first element is called, but instead STL calls the destructor
> of the second element.  When the program exits, the destructor for the
> second element (now becoming the first element) is called again.
> 
> I have no access of other implementation of STL.  Could someone tell
> me if this behavior is correct?
> 
> Weiwen
> =====================
> #include 
> #include 
> 
> class A
> {
> public:
>     A(int n)
>             :itsA(n)
>     {}
>     ~A()
>     {cout  
> private:
>     int itsA;
> };
> 
> int main()
> {
>     vector av;
>     cout  
>     A a1(1);
>     av.push_back(a1);
>     cout      A a2(2);
>     av.push_back(a2);
>     cout  
>     cout      av.erase(av.begin());
>     cout  
>     return 0;
> }
> 
> The program outputs:
> 
> destroy1
> begin erase: destroy2 end erase
> destroy2 destroy1 destroy2

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

* Re: egcs 970828 and X11 on linux/x86
  1997-08-31 18:57 erase operation in STL Weiwen Liu
                   ` (4 preceding siblings ...)
  1997-08-31 21:31 ` erase operation in STL YMP Consulting Inc.
@ 1997-08-31 21:31 ` Jeffrey A Law
  5 siblings, 0 replies; 7+ messages in thread
From: Jeffrey A Law @ 1997-08-31 21:31 UTC (permalink / raw)
  To: egcs

  In message you write:
  > On linux/x86, I bootstapped egcs 970828 with -O -g and used that egcs
  > to compile egcs with -O6 -fomit-frame-pointer. Then I used that
  > compiler to compile XFree86 3.3.1 with -O6 -fno-exceptions. I didn't
  > see any problems with the rebuilt XFree86 3.3.1.
  > 
  > BTW, I applied Jim's patch to i386.c:
  > 
  > Wed Aug 27 14:52:54 1997  Jim Wilson  
  > 
  > 	* i386.c (ix86_expand_epilogue): Emit blockage instruction when pic.
  > 
  > Without it, shared libraries may be miscompiled with -O2/-O3 or above.
Jim installed this patch on thursday; it will be in the next
snapshot.

jeff

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

end of thread, other threads:[~1997-08-31 21:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-08-31 18:57 erase operation in STL Weiwen Liu
1997-08-31 18:57 ` Results for haifa-enabled egcs-970828 g++ testsuite on sparc-sun-sunos4.1.3 Alexandre Oliva
1997-08-31 18:57 ` Results for haifa-enabled egcs-970828 gcc " Alexandre Oliva
1997-08-31 19:45 ` My m68k-unknown-netbsd1.2g patch Allen Briggs
1997-08-31 20:05 ` Small patch for NetBSD Jeffrey A Law
1997-08-31 21:31 ` erase operation in STL YMP Consulting Inc.
1997-08-31 21:31 ` egcs 970828 and X11 on linux/x86 Jeffrey A Law

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