Bug 9936 - [3.2 regression] ICE with local function and variable-length 2d array
Summary: [3.2 regression] ICE with local function and variable-length 2d array
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 3.2.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
: 8730 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-03-04 11:56 UTC by douze
Modified: 2003-07-25 17:33 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description douze 2003-03-04 11:56:00 UTC
/* not preprocessed */

int foo() {
  int yd;
  float in[1][yd];
  
  static void bar() {
    printf("%p\n",in[0]);
  }
}

Release:
version 3.2.1, 3.2.2

Environment:
Linux 2.4.18, Mac OS X 10.2.4

How-To-Repeat:
gcc -c test0.c
test0.c: In function `bar':
test0.c:7: Internal compiler error in expand_expr, at expr.c:6454
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
Comment 1 douze 2003-03-04 11:56:00 UTC
Fix:
Fixed in GCC 3.3 with:

http://gcc.gnu.org/ml/gcc-patches/2003-04/msg00018.html
Comment 2 Wolfgang Bangerth 2003-03-04 15:38:02 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed also on x86 linux. Works with 3.0 and mainline,
    but fails with 3.2 and 3.3:
    
    g/x> /home/bangerth/bin/gcc-3.0.4/bin/gcc -c x.c
    
    g/x> /home/bangerth/bin/gcc-3.2.2-pre/bin/gcc -c x.c
    x.c: In function `bar':
    x.c:6: Internal compiler error in expand_expr, at expr.c:6464
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
    
    g/x> /home/bangerth/bin/gcc-3.3-pre/bin/gcc -c x.c
    x.c: In function `bar':
    x.c:6: internal compiler error: in expand_expr, at expr.c:6818
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
    
    g/x> /home/bangerth/bin/gcc-3.4-pre/bin/gcc -c x.c
Comment 3 Joe Buck 2003-04-25 21:26:44 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed for 3.3.