c/6643: gcc fails in tree check for assignment to variable sized array

pthomas@suse.de pthomas@suse.de
Mon May 13 04:06:00 GMT 2002


>Number:         6643
>Category:       c
>Synopsis:       gcc fails in tree check for assignment to variable sized array
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 13 04:06:05 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Philipp Thomas, SuSE Linux Ag
>Release:        3.1 20020506
>Organization:
>Environment:
axp-suse-linux
>Description:
Given this test case:

void foo (unsigned int len)
{
    char str[len];
    str[0] = '\0';
}

gcc with checking enabled fails with:

t.c: In function `foo':
t.c:5: tree check: expected integer_cst, have plus_expr in tree_int_cst_sgn, at tree.c:3513

>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list