public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/29175]  New: ICE on invalid: C++ static variable length array
@ 2006-09-21 21:35 ian at airs dot com
  2006-09-28  1:18 ` [Bug c++/29175] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: ian at airs dot com @ 2006-09-21 21:35 UTC (permalink / raw)
  To: gcc-bugs

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

Compiling this invalid C++ code with current mainline:

void foo() { static int c = 2; static const char *a[][c] = { { "1", "2" } }; }

gives me:

foo.cc: In function ‘void foo()’:
foo.cc:1: internal compiler error: in tree_low_cst, at tree.c:4519
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

It should instead say something along the lines of

foo.cc:1: error: array bound is not an integer constant


-- 
           Summary: ICE on invalid: C++ static variable length array
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ian at airs dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29175


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

* [Bug c++/29175] ICE on invalid: C++ static variable length array
  2006-09-21 21:35 [Bug c++/29175] New: ICE on invalid: C++ static variable length array ian at airs dot com
@ 2006-09-28  1:18 ` pinskia at gcc dot gnu dot org
  2006-09-28  5:59 ` [Bug c++/29175] [4.0/4.1/4.2 regression] " bangerth at dealii dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-28  1:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-09-28 01:18 -------
*** Bug 29257 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cfurman at lbl dot gov


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29175


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

* [Bug c++/29175] [4.0/4.1/4.2 regression] ICE on invalid: C++ static variable length array
  2006-09-21 21:35 [Bug c++/29175] New: ICE on invalid: C++ static variable length array ian at airs dot com
  2006-09-28  1:18 ` [Bug c++/29175] " pinskia at gcc dot gnu dot org
@ 2006-09-28  5:59 ` bangerth at dealii dot org
  2006-10-01 22:58 ` mmitchel at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bangerth at dealii dot org @ 2006-09-28  5:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from bangerth at dealii dot org  2006-09-28 05:59 -------
Confirmed. This actually worked in gcc2.95 to my surprise:

g/x> /home/bangerth/bin/gcc-2.95.3/bin/c++ -c x.cc
x.cc: In function `void foo()':
x.cc:1: variable-sized object of type `const char *[((c - 1) + 1)]' may not be
initialized
x.cc:1: storage size of `a' isn't constant

All later gcc versions ICE, however.

W.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at dealii dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|                            |3.3.5 3.4.4 4.0.1 4.1.0
                   |                            |4.2.0
      Known to work|                            |2.95
   Last reconfirmed|0000-00-00 00:00:00         |2006-09-28 05:59:32
               date|                            |
            Summary|ICE on invalid: C++ static  |[4.0/4.1/4.2 regression] ICE
                   |variable length array       |on invalid: C++ static
                   |                            |variable length array
   Target Milestone|---                         |4.2.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29175


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

* [Bug c++/29175] [4.0/4.1/4.2 regression] ICE on invalid: C++ static variable length array
  2006-09-21 21:35 [Bug c++/29175] New: ICE on invalid: C++ static variable length array ian at airs dot com
  2006-09-28  1:18 ` [Bug c++/29175] " pinskia at gcc dot gnu dot org
  2006-09-28  5:59 ` [Bug c++/29175] [4.0/4.1/4.2 regression] " bangerth at dealii dot org
@ 2006-10-01 22:58 ` mmitchel at gcc dot gnu dot org
  2006-10-08 20:29 ` [Bug c++/29175] [4.0/4.1/4.2 regression] ICE on invalid C++ " reichelt at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-10-01 22:58 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29175


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

* [Bug c++/29175] [4.0/4.1/4.2 regression] ICE on invalid C++ variable length array
  2006-09-21 21:35 [Bug c++/29175] New: ICE on invalid: C++ static variable length array ian at airs dot com
                   ` (2 preceding siblings ...)
  2006-10-01 22:58 ` mmitchel at gcc dot gnu dot org
@ 2006-10-08 20:29 ` reichelt at gcc dot gnu dot org
  2006-10-11 22:37 ` mmitchel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-10-08 20:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from reichelt at gcc dot gnu dot org  2006-10-08 20:29 -------
Shorter testcase (the array doesn't have to be static):

=========================
void foo(int i)
{
  int x[][i] = { 0 };
}
=========================

The bug appeared with GCC 3.3.


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org
           Keywords|                            |monitored
      Known to fail|3.3.5 3.4.4 4.0.1 4.1.0     |3.3 3.4.6 4.0.3 4.1.1 4.2.0
                   |4.2.0                       |
      Known to work|2.95                        |2.95 3.0.4 3.2.3
            Summary|[4.0/4.1/4.2 regression] ICE|[4.0/4.1/4.2 regression] ICE
                   |on invalid: C++ static      |on invalid C++ variable
                   |variable length array       |length array
   Target Milestone|4.2.0                       |4.0.4


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29175


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

* [Bug c++/29175] [4.0/4.1/4.2 regression] ICE on invalid C++ variable length array
  2006-09-21 21:35 [Bug c++/29175] New: ICE on invalid: C++ static variable length array ian at airs dot com
                   ` (3 preceding siblings ...)
  2006-10-08 20:29 ` [Bug c++/29175] [4.0/4.1/4.2 regression] ICE on invalid C++ " reichelt at gcc dot gnu dot org
@ 2006-10-11 22:37 ` mmitchel at gcc dot gnu dot org
  2006-10-12  4:36 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-10-11 22:37 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29175


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

* [Bug c++/29175] [4.0/4.1/4.2 regression] ICE on invalid C++ variable length array
  2006-09-21 21:35 [Bug c++/29175] New: ICE on invalid: C++ static variable length array ian at airs dot com
                   ` (4 preceding siblings ...)
  2006-10-11 22:37 ` mmitchel at gcc dot gnu dot org
@ 2006-10-12  4:36 ` mmitchel at gcc dot gnu dot org
  2006-10-12  4:40 ` [Bug c++/29175] [4.0/4.1 " mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-10-12  4:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from mmitchel at gcc dot gnu dot org  2006-10-12 04:36 -------
Subject: Bug 29175

Author: mmitchel
Date: Thu Oct 12 04:35:56 2006
New Revision: 117658

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117658
Log:
        PR c++/29175
        * decl.c (check_initializer): Issue errors about trying to
        initialize arrays whose elements have variable size.
        PR c++/29175
        * g++.dg/init/array24.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/init/array24.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29175


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

* [Bug c++/29175] [4.0/4.1 regression] ICE on invalid C++ variable length array
  2006-09-21 21:35 [Bug c++/29175] New: ICE on invalid: C++ static variable length array ian at airs dot com
                   ` (5 preceding siblings ...)
  2006-10-12  4:36 ` mmitchel at gcc dot gnu dot org
@ 2006-10-12  4:40 ` mmitchel at gcc dot gnu dot org
  2006-10-12 23:53 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-10-12  4:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from mmitchel at gcc dot gnu dot org  2006-10-12 04:39 -------
Fixed in 4.2.0.


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.0/4.1/4.2 regression] ICE|[4.0/4.1 regression] ICE on
                   |on invalid C++ variable     |invalid C++ variable length
                   |length array                |array


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29175


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

* [Bug c++/29175] [4.0/4.1 regression] ICE on invalid C++ variable length array
  2006-09-21 21:35 [Bug c++/29175] New: ICE on invalid: C++ static variable length array ian at airs dot com
                   ` (6 preceding siblings ...)
  2006-10-12  4:40 ` [Bug c++/29175] [4.0/4.1 " mmitchel at gcc dot gnu dot org
@ 2006-10-12 23:53 ` mmitchel at gcc dot gnu dot org
  2006-10-12 23:54 ` [Bug c++/29175] [4.0 " mmitchel at gcc dot gnu dot org
  2007-02-03 20:20 ` gdr at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-10-12 23:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from mmitchel at gcc dot gnu dot org  2006-10-12 23:53 -------
Subject: Bug 29175

Author: mmitchel
Date: Thu Oct 12 23:53:04 2006
New Revision: 117677

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117677
Log:
        PR c++/29175
        * decl.c (check_initializer): Issue errors about trying to
        initialize arrays whose elements have variable size.
        PR c++/29175
        * g++.dg/init/array24.C: New test.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/init/array24.C
Modified:
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/decl.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29175


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

* [Bug c++/29175] [4.0 regression] ICE on invalid C++ variable length array
  2006-09-21 21:35 [Bug c++/29175] New: ICE on invalid: C++ static variable length array ian at airs dot com
                   ` (7 preceding siblings ...)
  2006-10-12 23:53 ` mmitchel at gcc dot gnu dot org
@ 2006-10-12 23:54 ` mmitchel at gcc dot gnu dot org
  2007-02-03 20:20 ` gdr at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-10-12 23:54 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|mark at codesourcery dot com|unassigned at gcc dot gnu
                   |                            |dot org
             Status|ASSIGNED                    |NEW
            Summary|[4.0/4.1 regression] ICE on |[4.0 regression] ICE on
                   |invalid C++ variable length |invalid C++ variable length
                   |array                       |array


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29175


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

* [Bug c++/29175] [4.0 regression] ICE on invalid C++ variable length array
  2006-09-21 21:35 [Bug c++/29175] New: ICE on invalid: C++ static variable length array ian at airs dot com
                   ` (8 preceding siblings ...)
  2006-10-12 23:54 ` [Bug c++/29175] [4.0 " mmitchel at gcc dot gnu dot org
@ 2007-02-03 20:20 ` gdr at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: gdr at gcc dot gnu dot org @ 2007-02-03 20:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from gdr at gcc dot gnu dot org  2007-02-03 20:20 -------
Fixed in GCC-4.1.2


-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.0.4                       |4.1.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29175


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

end of thread, other threads:[~2007-02-03 20:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-21 21:35 [Bug c++/29175] New: ICE on invalid: C++ static variable length array ian at airs dot com
2006-09-28  1:18 ` [Bug c++/29175] " pinskia at gcc dot gnu dot org
2006-09-28  5:59 ` [Bug c++/29175] [4.0/4.1/4.2 regression] " bangerth at dealii dot org
2006-10-01 22:58 ` mmitchel at gcc dot gnu dot org
2006-10-08 20:29 ` [Bug c++/29175] [4.0/4.1/4.2 regression] ICE on invalid C++ " reichelt at gcc dot gnu dot org
2006-10-11 22:37 ` mmitchel at gcc dot gnu dot org
2006-10-12  4:36 ` mmitchel at gcc dot gnu dot org
2006-10-12  4:40 ` [Bug c++/29175] [4.0/4.1 " mmitchel at gcc dot gnu dot org
2006-10-12 23:53 ` mmitchel at gcc dot gnu dot org
2006-10-12 23:54 ` [Bug c++/29175] [4.0 " mmitchel at gcc dot gnu dot org
2007-02-03 20:20 ` gdr at gcc dot gnu dot org

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