Bug 28419 - [4.1 regression] ICE using __FUNCTION__ in invalid code
Summary: [4.1 regression] ICE using __FUNCTION__ in invalid code
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.2.0
: P4 minor
Target Milestone: 4.2.0
Assignee: Jan Hubicka
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: error-recovery, ice-on-invalid-code, monitored, patch
Depends on:
Blocks:
 
Reported: 2006-07-18 10:37 UTC by Volker Reichelt
Modified: 2008-07-04 15:42 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 4.2.0
Known to fail: 4.1.3
Last reconfirmed: 2006-07-21 19:31:58


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2006-07-18 10:37:42 UTC
The following invalid code snippet triggers an ICE since GCC 4.1.0
(only with the C frontend):

========================================
void foo() x;

const char* p = __FUNCTION__;
========================================

bug.c: In function 'foo':
bug.c:1: error: expected declaration specifiers before 'x'
bug.c:3: error: parameter 'p' is initialized
bug.c:0: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]
Comment 1 Jan Hubicka 2006-07-21 19:31:58 UTC
Testing patch.
Honza
Comment 2 patchapp@dberlin.org 2006-07-21 19:35:20 UTC
Subject: Bug number PR c/28419

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00910.html
Comment 3 Joseph S. Myers 2006-08-15 16:07:50 UTC
The patch is OK.
Comment 4 Jan Hubicka 2006-10-13 07:42:03 UTC
Subject: Bug 28419

Author: hubicka
Date: Fri Oct 13 07:41:53 2006
New Revision: 117684

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117684
Log:
	PR c/28419
	* c-decl.c (c_make_fname_decl): Do not segfault in case where
	current_function_decl is set but current_function_scope is not.

	* gcc.dg/pr28319.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr28419.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-decl.c
    trunk/gcc/testsuite/ChangeLog

Comment 5 Jan Hubicka 2006-10-13 07:42:51 UTC
Fixed in mainline.
Comment 6 Joseph S. Myers 2008-07-04 15:42:39 UTC
Closing 4.1 branch.