This service will be undergoing maintenance at 20:00 UTC, 2017-04-03. It is expected to last about 30 minutes
Bug 85144 - gcc internal error (seg fault)
gcc internal error (seg fault)
Status: CLOSED UPSTREAM
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
8.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-02-25 19:17 EST by andy
Modified: 2007-04-18 12:51 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-03 08:32:08 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description andy 2003-02-25 19:17:00 EST
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 08:32:08 EDT
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.