public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/7261: ICE when reporting on passing variable-sized struct to function
@ 2002-07-11  8:26 lerdsuwa
  0 siblings, 0 replies; 2+ messages in thread
From: lerdsuwa @ 2002-07-11  8:26 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, richard.myers

Synopsis: ICE when reporting on passing variable-sized struct to function

State-Changed-From-To: open->closed
State-Changed-By: lerdsuwa
State-Changed-When: Thu Jul 11 08:26:41 2002
State-Changed-Why:
    Fixed in GCC 3.0 and newer.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7261


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

* c++/7261: ICE when reporting on passing variable-sized struct to function
@ 2002-07-10  7:06 richard.myers
  0 siblings, 0 replies; 2+ messages in thread
From: richard.myers @ 2002-07-10  7:06 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7261
>Category:       c++
>Synopsis:       ICE when reporting on passing variable-sized struct to function
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 10 07:06:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Richard Myers
>Release:        2.95.3-6 (mingw special)
>Organization:
>Environment:
MinGW on WIndows 2000
>Description:
gcc falls over when reporting the errors with the code shown below. The code declares a variable-sized struct of indeterminate size and then passes it to a function.

Output of gcc -v in attached

C:>gcc error.cpp
error.cpp:10: variable-size type declared outside of any function
error.cpp: In function `int main(int, char **)':
error.cpp:16: Internal compiler error in `find_function_data', at function.c:543

Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
>How-To-Repeat:
extern const int x;

typedef struct {
  int  data[x+1];
} Y_t;

extern const int x = 4;

void foo(Y_t y)
{
  y.data[0] = 0;
}

int main(int argc, char **argv)
{
  Y_t  y;

  foo(y);
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="gcc-report.txt"
Content-Disposition: inline; filename="gcc-report.txt"

C:>gcc -v -save-temps error.cpp
Reading specs from C:/MinGW/bin/../lib/gcc-lib/mingw32/2.95.3-6/specs
gcc version 2.95.3-6 (mingw special)
 C:\MinGW\bin\..\lib\gcc-lib\mingw32\2.95.3-6\cpp0.exe -lang-c++ -v -iprefix C:\
MinGW\bin/../lib/gcc-lib/mingw32/2.95.3-6/ -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MI
NOR__=95 -D__cplusplus -Di386 -D_WIN32 -DWIN32 -D__WIN32__ -D__MINGW32__=1.0 -D_
_MSVCRT__ -DWINNT -D_X86_=1 -D__STDC__=1 -D__stdcall=__attribute__((__stdcall__)
) -D_stdcall=__attribute__((__stdcall__)) -D__cdecl=__attribute__((__cdecl__)) -
D__declspec(x)=__attribute__((x)) -D__i386__ -D_WIN32 -D__WIN32__ -D__WIN32__ -D
__MINGW32__=1.0 -D__MSVCRT__ -D__WINNT__ -D_X86_=1 -D__STDC__=1 -D__stdcall=__at
tribute__((__stdcall__)) -D___stdcall__=__attribute__((__stdcall__)) -D__cdecl=_
_attribute__((__cdecl__)) -D__declspec(x)=__attribute__((x)) -D__i386 -D__WIN32
-D__WINNT -D___stdcall=__attribute__((__stdcall__)) -Asystem(winnt) -Acpu(i386)
-Amachine(i386) -D__EXCEPTIONS -remap -Acpu(i386) -Amachine(i386) -Di386 -D__i38
6 -D__i386__ error.cpp error.ii
GNU CPP version 2.95.3-6 (mingw special) (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
 C:/MinGW/bin/../lib/gcc-lib/mingw32/2.95.3-6/../../../../include/g++-3
 C:/MinGW/bin/../lib/gcc-lib/mingw32/2.95.3-6/../../../../include
 C:/MinGW/bin/../lib/gcc-lib/mingw32/2.95.3-6/../../../../mingw32/include
 C:/MinGW/bin/../lib/gcc-lib/mingw32/2.95.3-6/include
 /mingw/lib/gcc-lib/mingw32/2.95.3-6/../../../../include/g++-3
 /mingw/lib/gcc-lib/mingw32/2.95.3-6/../../../../include
 /mingw/lib/gcc-lib/mingw32/2.95.3-6/../../../../mingw32/include
 /mingw/lib/gcc-lib/mingw32/2.95.3-6/include
End of search list.
The following default directories have been omitted from the search path:
 /usr/local/mingw32/include
End of omitted list.
 C:\MinGW\bin\..\lib\gcc-lib\mingw32\2.95.3-6\cc1plus.exe error.ii -quiet -dumpb
ase error.cc -version -o error.s
GNU C++ version 2.95.3-6 (mingw special) (mingw32) compiled by GNU C version 2.9
5.3-6 (mingw special).
error.cpp:10: variable-size type declared outside of any function
error.cpp: In function `int main(int, char **)':
error.cpp:16: Internal compiler error in `find_function_data', at function.c:543

Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.



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

end of thread, other threads:[~2002-07-11 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-11  8:26 c++/7261: ICE when reporting on passing variable-sized struct to function lerdsuwa
  -- strict thread matches above, loose matches on Subject: below --
2002-07-10  7:06 richard.myers

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