Bug 53702 - [4.8 Regression] ICE with -Wall and nested functions and unused typedef
Summary: [4.8 Regression] ICE with -Wall and nested functions and unused typedef
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: 4.8.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2012-06-17 09:29 UTC by David Binderman
Modified: 2012-06-21 20:48 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-06-17 00:00:00


Attachments
C source code (114.98 KB, text/x-csrc)
2012-06-17 09:29 UTC, David Binderman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2012-06-17 09:29:31 UTC
Created attachment 27638 [details]
C source code

I just tried to compile the package gstreamer-plugins-espeak-0.3.5-2
on gcc-4.8 trunk dated 20120617 on an AMD x86_64 box.

The compiler said

espeak.c:245:5: internal compiler error: Segmentation fault
     g_atomic_int_set (&spin->state, PLAY);
     ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Preprocessed source code attached. Flag -Wall required.
Comment 1 Markus Trippelsdorf 2012-06-17 11:02:23 UTC
void fn1 ()
{
    void fn2 ()
    {
    }
    typedef int pt;
}
Comment 2 Markus Trippelsdorf 2012-06-17 14:16:27 UTC
Started with revision 187979:

commit e4a33abd20e349979e77e2881fcd29dac9825ed6
Author: jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Tue May 29 19:07:04 2012 +0000

    2012-05-29  Meador Inge  <meadori@codesourcery.com>
    
        * c-decl.c (c_push_function_context): Always create a new language
        function.
        (c_pop_function_context): Clear the language function created in
        c_push_function_context.
    
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187979 138bc75d-0d04-0410-961f-82ee72b054a4
Comment 3 Meador Inge 2012-06-17 16:15:51 UTC
I will look into this one.
Comment 4 meadori 2012-06-21 20:20:36 UTC
Author: meadori
Date: Thu Jun 21 20:20:30 2012
New Revision: 188860

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188860
Log:
	PR c/53702

	* c-decl.c (c_push_function_context): Restore the behavior to reuse
	the language function allocated for -Wunused-local-typedefs.
	(c_pop_function_context): If necessary, clear the language function
	created in c_push_function_context.  Always clear out the
	x_cur_stmt_list field of the restored language function.

testsuite/
	* gcc.dg/Wunused-local-typedefs.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/Wunused-local-typedefs.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-decl.c
    trunk/gcc/testsuite/ChangeLog
Comment 5 meadori 2012-06-21 20:48:08 UTC
Fix committed.  Thanks for the report!