Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 85144 - gcc internal error (seg fault)
Summary: gcc internal error (seg fault)
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 8.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-02-26 00:17 UTC by andy
Modified: 2007-04-18 16:51 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-10-03 12:32:08 UTC


Attachments (Terms of Use)

Description andy 2003-02-26 00:17:00 UTC
Description of problem:

segmentation fault on this program "test.c":

#include <stdio.h>

int foo = 3;

int main(void)
{
    auto int bar(int);

    extern int foo;

    {
        int foo = 5;
        printf("foo is %d\n",foo);
    }

    bar(5);

    printf("foo is %d\n",foo);
}

void bar(void)
{
    printf("i am bar\n");
}


Version-Release number of selected component (if applicable):

% gcc --version
gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


How reproducible:

easy as pie.

Steps to Reproduce:
1. gcc test.c
2.
3.
    
Actual results:

% gcc test.c
test.c: In function `bar':
test.c:19: internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.


Expected results:

I think that line 7 should produce an error saying that local functions cannot
have "auto" storage class.

Additional info:

Comment 1 Richard Henderson 2004-10-03 12:32:08 UTC
GCC supports an extension called nested functions, by which functions
*can* have "auto" storage class.

With gcc 3.2.3-20, we no longer ICE, generate no warning, which results
in the rather obscure link error

: undefined reference to `bar.0'

Pushed upstream to
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17807


Note You need to log in before you can comment on or make changes to this bug.