public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* Bug in egcs?
@ 1998-08-18  2:18 Martin Kahlert
  1998-10-31  4:38 ` Jeffrey A Law
  0 siblings, 1 reply; 10+ messages in thread
From: Martin Kahlert @ 1998-08-18  2:18 UTC (permalink / raw)
  To: egcs-bugs

Hi,
i have a problem, which occurs while compiling octave:
I tracked it down to that snipped:

m.cc:
static int try_info ()
{
  int status = 0;

  if (((( (__extension__ ({ union { __typeof(  status  ) __in; int __i; } __u;	__u.__in = (  status  ); __u.__i; }))  ) & 0xff) == 0)  )
    status = ((( (__extension__ ({ union { __typeof(  status  ) __in; int __i; } __u;	__u.__in = (  status  ); __u.__i; }))  ) & 0xff00) >> 8)  ;
  else
    status = 127;

  return status;
}

Do a 'g++ -c m.cc' and you get:

m.cc: In function `int try_info()':
m.cc:5: `status' undeclared (first use this function)
m.cc:5: (Each undeclared identifier is reported only once
m.cc:5: for each function it appears in.)
m.cc:5: warning: ANSI C++ forbids declaration `__in' with no type
m.cc:6: warning: ANSI C++ forbids declaration `__in' with no type

Could you please tell me, where the problem is, since status is declared?

Thanks,
Martin.

g++ -v:
Reading specs from /sw/egcs/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.54/specs
gcc version egcs-2.91.54 19980816 (gcc2 ss-980609 experimental)


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

* Re: Bug in egcs?
  1998-08-18  2:18 Bug in egcs? Martin Kahlert
@ 1998-10-31  4:38 ` Jeffrey A Law
  0 siblings, 0 replies; 10+ messages in thread
From: Jeffrey A Law @ 1998-10-31  4:38 UTC (permalink / raw)
  To: Martin Kahlert; +Cc: egcs-bugs

  In message <199808180916.LAA24073@keksy.mchp.siemens.de>you write:
  > Hi,
  > i have a problem, which occurs while compiling octave:
  > I tracked it down to that snipped:
  > 
  > m.cc:
  > static int try_info ()
  > {
  >   int status = 0;
  > 
  >   if (((( (__extension__ ({ union { __typeof(  status  ) __in; int __i; } _
  > _u;	__u.__in = (  status  ); __u.__i; }))  ) & 0xff) == 0)  )
  >     status = ((( (__extension__ ({ union { __typeof(  status  ) __in; int _
  > _i; } __u;	__u.__in = (  status  ); __u.__i; }))  ) & 0xff00) >> 8)  ;
  >   else
  >     status = 127;
  > 
  >   return status;
  > }
  > 
  > Do a 'g++ -c m.cc' and you get:
  > 
  > m.cc: In function `int try_info()':
  > m.cc:5: `status' undeclared (first use this function)
  > m.cc:5: (Each undeclared identifier is reported only once
  > m.cc:5: for each function it appears in.)
  > m.cc:5: warning: ANSI C++ forbids declaration `__in' with no type
  > m.cc:6: warning: ANSI C++ forbids declaration `__in' with no type
  > 
  > Could you please tell me, where the problem is, since status is declared?
This has been fixed for the upcoming egcs-1.1.1 release.  Your code should
compile without any errors.
jeff


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

* Bug in egcs?
@ 1999-05-31 21:06 Boris Klug
  1999-05-29  0:13 ` Martin v. Loewis
  0 siblings, 1 reply; 10+ messages in thread
From: Boris Klug @ 1999-05-31 21:06 UTC (permalink / raw)
  To: egcs-bugs

[-- Attachment #1: Type: text/plain, Size: 2289 bytes --]

Hi!

when I compile this:

#include <queue>
class classA {
  public:
    int A;
    bool operator< (const classA& x) const {return A < x.A;};
};
class classB {
  priority_queue<classA*, classA::operator< > mTaskQueue;
};

I get this:

egcs-bug.cpp:15: Internal compiler error.
egcs-bug.cpp:15: Please submit a full bug report to 
`egcs-bugs@egcs.cygnus.com'.
egcs-bug.cpp:15: See <URL: http://egcs.cygnus.com/faq.html#bugreport > for 
details.

I run Suse Linux 6.1 which is Linux/i386, Kernel 2.2.9. "gcc --version" 
gives me "egcs-2.91.66" - it seems to be egcs-1.1.2.

Here is the compiling run:

>ipl@bart:/pub > gcc -v --save-temps egcs-bug.cpp
>Reading specs from /usr/lib/gcc-lib/i486-linux/egcs-2.91.66/specs
>gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
> /usr/lib/gcc-lib/i486-linux/egcs-2.91.66/cpp -lang-c++ -v -undef 
>-D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -D__ELF__ 
>-Dunix -Di386 -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ 
>-D__i386__ -D__linux__ -D__unix -D__i386 -D__linux -Asystem(posix) 
>-D__EXCEPTIONS -Asystem(unix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 
>-D__i386__ -Di486 -D__i486 -D__i486__ egcs-bug.cpp egcs-bug.ii
>GNU CPP version egcs-2.91.66 19990314 (egcs-1.1.2 release) (i386 Linux/ELF)
>#include "..." search starts here:
>#include <...> search starts here:
> /usr/include/g++
> /usr/local/include
> /usr/i486-linux/include
> /usr/lib/gcc-lib/i486-linux/egcs-2.91.66/include
> /usr/include
>End of search list.
> /usr/lib/gcc-lib/i486-linux/egcs-2.91.66/cc1plus egcs-bug.ii -quiet 
>-dumpbase egcs-bug.cc -version -o egcs-bug.s
>GNU C++ version egcs-2.91.66 19990314 (egcs-1.1.2 release) (i486-linux) 
>compiled by GNU C version egcs-2.91.66 19990314 (egcs-1.1.2 release).
>egcs-bug.cpp:15: Internal compiler error.
>egcs-bug.cpp:15: Please submit a full bug report to 
>`egcs-bugs@egcs.cygnus.com'.
>egcs-bug.cpp:15: See <URL: http://egcs.cygnus.com/faq.html#bugreport > for 
>details.

Find attached the egcs-bug.ii file, zipped with gzip

--
Reality: |)      |/       Fon: +49-261-4090577 | Developing for the
         |_)oris |\lug    Fax: +49-261-4090578 | Macintosh & Internet
Email: < mailto:boris@klg.de >                   |
Web:   < http://klg.de >                         | Ask T-shirts, not ties


[-- Attachment #2: egcs-bug.ii.gz --]
[-- Type: application/x-gzip, Size: 32289 bytes --]

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

* Re: Bug in egcs?
  1999-05-31 21:06 Boris Klug
@ 1999-05-29  0:13 ` Martin v. Loewis
  0 siblings, 0 replies; 10+ messages in thread
From: Martin v. Loewis @ 1999-05-29  0:13 UTC (permalink / raw)
  To: boris; +Cc: egcs-bugs

> egcs-bug.cpp:15: Internal compiler error.

Thanks for your bug report. gcc-2.95 19990523 reports

a.cc:8: type/value mismatch at argument 2 in template parameter list for `template <class _Tp, class _Sequence = class vector<_Tp,allocator<_Tp1> >, class _Compare = struct less<typename _Sequence::value_type> > priority_queue<_Tp,_Sequence,_Compare>'
a.cc:8:   expected a type, got `classA::operator <'
a.cc:8: template argument 1 is invalid
a.cc:8: template argument 3 is invalid
a.cc:8: ANSI C++ forbids declaration `mTaskQueue' with no type

so it seems that the bug has been fixed.

Regards,
Martin
>From cat@zip.com.au Sat May 29 00:25:00 1999
From: CaT <cat@zip.com.au>
To: "Martin v. Loewis" <martin@mira.isdn.cs.tu-berlin.de>
Cc: egcs-bugs@egcs.cygnus.com
Subject: Re: C++ bug in egcs 1.1.2
Date: Sat, 29 May 1999 00:25:00 -0000
Message-id: <19990529172317.A13387@kinder.schnitzel.cx>
References: <199905280631.QAA18583@zip.com.au> <199905290711.JAA00641@mira.isdn.cs.tu-berlin.de> <199905290711.JAA00641@mira.isdn.cs.tu-berlin.de>
X-SW-Source: 1999-05/msg00768.html
Content-length: 795

On Sat, May 29, 1999 at 09:11:08AM +0200, Martin v. Loewis wrote:
> > Howdy. Just got the following result while trying to compile
> > libstdc++ 2.90.5:
> 
> Thanks for your bug report. gcc-2.95 19990523 compiles it just fine,
> so it seems that the bug has been fixed. I believe the libstdc++
> snapshots point out the need for a recent egcs somewhere.

ARgh. Yes. So it does. Botton of the RELEASE-NOTES file (just found
that :).

Hmm... would it be possible to get a patch that fixes this hassle in
egcs1.1.2? Or alternatively, can I get patches that bring me upto the
current snapshot version of egcs from egcs 1.1.2? It would be real
nice to be able to do such catchups.

Thanks for your reply though. :)

-- 
CaT (cat@zip.com.au)                    URL: http://zipper.zip.com.au/dev/null


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

* Re: Bug in egcs?
  1997-12-16 10:34     ` Jason Merrill
@ 1997-12-16 12:08       ` Marius Kjeldahl
  0 siblings, 0 replies; 10+ messages in thread
From: Marius Kjeldahl @ 1997-12-16 12:08 UTC (permalink / raw)
  To: Jason Merrill; +Cc: egcs-bugs, egcs

>>>>> "Jason" == Jason Merrill <jason@cygnus.com> writes:

    >> Nope, it yields another error:

    >> test.cpp:13: sorry, not implemented: `cleanup_point_expr' not
    >> supported by dump_expr

    Jason> Ah.

[patch removed]

Your last patch almost fix it (I tested it with 971207 patched up to
971215). As before, by commenting out the line:

  SomeClass_t () : x (11) {}

it will compile fine. With your latest patch, the compiler does not
complain about that constructor, but it suddenly complains about the
following line instead:

  DynamicOnly_t* ptr = DynamicOnly_t::create ();

The message it gives is:

test.cpp:26: sorry, not implemented: initializer contains unrecognized
tree code

For completeness sake, I have included another copy of the test
program.

Anyway - thanks for helping out!

Marius

-- Test program test.cpp --

#include <string.h>

class SomeClass_t {
public:
  SomeClass_t () : x (11) {}
protected:
  float x;
};

class DynamicOnly_t {
public:
  static DynamicOnly_t* create (const char* name = "UNDEF",
				const SomeClass_t& somec = *(new SomeClass_t ())) {
    return new DynamicOnly_t (name, somec);
  }
  DynamicOnly_t (const char* name, const SomeClass_t& somec) :
    m_somec (somec) {
    strncpy (m_Name, name, sizeof (m_Name));
  }
private:
  SomeClass_t m_somec;
  char m_Name[255];
};

int main (int argc, char* argv[]) {
  DynamicOnly_t* ptr = DynamicOnly_t::create ();
  return 0;
}



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

* Re: Bug in egcs?
  1997-12-16  0:37   ` Marius Kjeldahl
@ 1997-12-16 10:34     ` Jason Merrill
  1997-12-16 12:08       ` Marius Kjeldahl
  0 siblings, 1 reply; 10+ messages in thread
From: Jason Merrill @ 1997-12-16 10:34 UTC (permalink / raw)
  To: Marius Kjeldahl; +Cc: egcs-bugs, egcs

>>>>> Marius Kjeldahl <marius@ace.funcom.com> writes:

>>>>> "Jason" == Jason Merrill <jason@cygnus.com> writes:
>>>>> Marius Kjeldahl <marius@ace.funcom.com> writes:

>>> test.cpp:13: sorry, not implemented: `try_catch_expr' not
>>> supported by dump_expr

Jason> Does this fix the problem?

> [patch removed]

> Nope, it yields another error:

> test.cpp:13: sorry, not implemented: `cleanup_point_expr' not
> supported by dump_expr

Ah.

Tue Dec 16 10:31:20 1997  Jason Merrill  <jason@yorick.cygnus.com>

	* error.c (dump_expr): And CLEANUP_POINT_EXPR.

Mon Dec 15 12:22:04 1997  Jason Merrill  <jason@yorick.cygnus.com>

	* error.c (dump_expr): Handle TRY_CATCH_EXPR.

Index: error.c
===================================================================
RCS file: /cvs/cvsfiles/egcs/gcc/cp/error.c,v
retrieving revision 1.15
diff -c -r1.15 error.c
*** error.c	1997/12/08 00:33:00	1.15
--- error.c	1997/12/16 18:31:18
***************
*** 1534,1539 ****
--- 1534,1545 ----
        OB_PUTS ("{unparsed}");
        break;
  
+     case TRY_CATCH_EXPR:
+     case WITH_CLEANUP_EXPR:
+     case CLEANUP_POINT_EXPR:
+       dump_expr (TREE_OPERAND (t, 0), nop);
+       break;
+ 
      case TREE_LIST:
        if (TREE_VALUE (t) && TREE_CODE (TREE_VALUE (t)) == FUNCTION_DECL)
  	{


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

* Re: Bug in egcs?
  1997-12-15 15:06 ` Jason Merrill
@ 1997-12-16  0:37   ` Marius Kjeldahl
  1997-12-16 10:34     ` Jason Merrill
  0 siblings, 1 reply; 10+ messages in thread
From: Marius Kjeldahl @ 1997-12-16  0:37 UTC (permalink / raw)
  To: egcs-bugs; +Cc: egcs, jason

>>>>> "Jason" == Jason Merrill <jason@cygnus.com> writes:

>>>>> Marius Kjeldahl <marius@ace.funcom.com> writes:
    >> test.cpp:13: sorry, not implemented: `try_catch_expr' not
    >> supported by dump_expr

    Jason> Does this fix the problem?

[patch removed]

Nope, it yields another error:

test.cpp:13: sorry, not implemented: `cleanup_point_expr' not
supported by dump_expr

Any other suggestions?

Marius


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

* Re: Bug in egcs?
       [not found] <52lnxmz6px.fsf.cygnus.egcs@ace.funcom.com>
@ 1997-12-15 15:06 ` Jason Merrill
  1997-12-16  0:37   ` Marius Kjeldahl
  0 siblings, 1 reply; 10+ messages in thread
From: Jason Merrill @ 1997-12-15 15:06 UTC (permalink / raw)
  To: egcs, egcs-bugs

>>>>> Marius Kjeldahl <marius@ace.funcom.com> writes:

> test.cpp:13: sorry, not implemented: `try_catch_expr' not supported by
> dump_expr

Does this fix the problem?

Mon Dec 15 12:22:04 1997  Jason Merrill  <jason@yorick.cygnus.com>

	* error.c (dump_expr): Handle TRY_CATCH_EXPR.

Index: error.c
===================================================================
RCS file: /cvs/cvsfiles/egcs/gcc/cp/error.c,v
retrieving revision 1.15
diff -c -r1.15 error.c
*** error.c	1997/12/08 00:33:00	1.15
--- error.c	1997/12/15 23:04:56
***************
*** 1534,1539 ****
--- 1534,1544 ----
        OB_PUTS ("{unparsed}");
        break;
  
+     case TRY_CATCH_EXPR:
+     case WITH_CLEANUP_EXPR:
+       dump_expr (TREE_OPERAND (t, 0), nop);
+       break;
+ 
      case TREE_LIST:
        if (TREE_VALUE (t) && TREE_CODE (TREE_VALUE (t)) == FUNCTION_DECL)
  	{


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

* Re: Bug in egcs?
  1997-12-15 12:34 Marius Kjeldahl
@ 1997-12-15 13:47 ` H.J. Lu
  0 siblings, 0 replies; 10+ messages in thread
From: H.J. Lu @ 1997-12-15 13:47 UTC (permalink / raw)
  To: egcs; +Cc: egcs-bugs

> 
> While porting some code from Visual C++ 5.0 to egcs (I've tried both
> 1.0 and the 971207 release) I came across a problem compiling some of
> the code. I have been able to narrow it down to the 30 lines attached
> to this mail. The relevant error message I get while compiling if I
> _remove_ the comment from the SomeClass_t constructor is:
> 
> test.cpp:13: sorry, not implemented: `try_catch_expr' not supported by
> dump_expr
> 
> If the constructor is commented out, everything works fine and
> dandy. On Microsoft Visual C++ a similar piece of code (which emits
> the same error on the same construction under egcs on linux) compiles
> and runs without any problems.
> 
> Regardless, the error message does not really give me much help in
> figuring this one out. Is there anybody out there with a clue?
> 
> Thanks in advance..
> 
> Marius
> 
> -----8< Code snippet follows -----8<-----8<-----8<-----8<-----8<
> #include <string.h>
> 
> class SomeClass_t {
> public:
>   //  SomeClass_t () : x (11) {}
> protected:
>   float x;
> };
> 
> class DynamicOnly_t {
> public:
>   static DynamicOnly_t* create (const char* name = "UNDEF",
> 				const SomeClass_t& somec = *(new SomeClass_t ())) {
>     return new DynamicOnly_t (name, somec);
>   }
>   DynamicOnly_t (const char* name, const SomeClass_t& somec) :
>     m_somec (somec) {
>     strncpy (m_Name, name, sizeof (m_Name));
>   }
> private:
>   SomeClass_t m_somec;
>   char m_Name[255];
> };
> 
> int main (int argc, char* argv[]) {
>   DynamicOnly_t* ptr = DynamicOnly_t::create ();
>   return 0;
> }
> 
> // compiled with 'gcc test.cpp' where gcc = egcs 1.0 and 971207
> 

I have no problem to compile it with egcs 1.0 on Linux/x86.

-- 
H.J. Lu (hjl@gnu.org)


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

* Bug in egcs?
@ 1997-12-15 12:34 Marius Kjeldahl
  1997-12-15 13:47 ` H.J. Lu
  0 siblings, 1 reply; 10+ messages in thread
From: Marius Kjeldahl @ 1997-12-15 12:34 UTC (permalink / raw)
  To: egcs, egcs-bugs

While porting some code from Visual C++ 5.0 to egcs (I've tried both
1.0 and the 971207 release) I came across a problem compiling some of
the code. I have been able to narrow it down to the 30 lines attached
to this mail. The relevant error message I get while compiling if I
_remove_ the comment from the SomeClass_t constructor is:

test.cpp:13: sorry, not implemented: `try_catch_expr' not supported by
dump_expr

If the constructor is commented out, everything works fine and
dandy. On Microsoft Visual C++ a similar piece of code (which emits
the same error on the same construction under egcs on linux) compiles
and runs without any problems.

Regardless, the error message does not really give me much help in
figuring this one out. Is there anybody out there with a clue?

Thanks in advance..

Marius

-----8< Code snippet follows -----8<-----8<-----8<-----8<-----8<
#include <string.h>

class SomeClass_t {
public:
  //  SomeClass_t () : x (11) {}
protected:
  float x;
};

class DynamicOnly_t {
public:
  static DynamicOnly_t* create (const char* name = "UNDEF",
				const SomeClass_t& somec = *(new SomeClass_t ())) {
    return new DynamicOnly_t (name, somec);
  }
  DynamicOnly_t (const char* name, const SomeClass_t& somec) :
    m_somec (somec) {
    strncpy (m_Name, name, sizeof (m_Name));
  }
private:
  SomeClass_t m_somec;
  char m_Name[255];
};

int main (int argc, char* argv[]) {
  DynamicOnly_t* ptr = DynamicOnly_t::create ();
  return 0;
}

// compiled with 'gcc test.cpp' where gcc = egcs 1.0 and 971207


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

end of thread, other threads:[~1999-05-31 21:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-08-18  2:18 Bug in egcs? Martin Kahlert
1998-10-31  4:38 ` Jeffrey A Law
  -- strict thread matches above, loose matches on Subject: below --
1999-05-31 21:06 Boris Klug
1999-05-29  0:13 ` Martin v. Loewis
     [not found] <52lnxmz6px.fsf.cygnus.egcs@ace.funcom.com>
1997-12-15 15:06 ` Jason Merrill
1997-12-16  0:37   ` Marius Kjeldahl
1997-12-16 10:34     ` Jason Merrill
1997-12-16 12:08       ` Marius Kjeldahl
1997-12-15 12:34 Marius Kjeldahl
1997-12-15 13:47 ` H.J. Lu

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