Bug 22061 - [3.4 Regression] internal compiler error: in find_function_data, at function.c:317
[3.4 Regression] internal compiler error: in find_function_data, at function....
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: c
3.4.2
: P2 normal
: 3.4.5
Assigned To: rsandifo@gcc.gnu.org
http://gcc.gnu.org/ml/gcc-patches/200...
: ice-on-valid-code, monitored, patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-14 13:07 UTC by Gareth Evans
Modified: 2005-09-02 12:36 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 3.3.3 4.0.0 4.1.0
Known to fail: 3.4.0
Last reconfirmed: 2005-08-01 15:09:06


Attachments
Code for Bug 22061 (495 bytes, text/plain)
2005-06-14 13:09 UTC, Gareth Evans
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gareth Evans 2005-06-14 13:07:58 UTC
The piece of code attached compiles correctly if the returnZero function is
removed or commented out; however the code does not compile on this machine "as is".

OUTPUT:
gcc -v -save-temps fsabug.c -o fsabug -O4
Using built-in specs.
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 3.4.2 [FreeBSD] 20040728
 /usr/libexec/cc1 -E -quiet -v -D_LONGLONG fsabug.c -O4 -o fsabug.i
ignoring duplicate directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include
End of search list.
 /usr/libexec/cc1 -fpreprocessed fsabug.i -quiet -dumpbase fsabug.c -auxbase
fsabug -O4 -version -o fsabug.s
GNU C version 3.4.2 [FreeBSD] 20040728 (i386-fbsdproj-freebsd)
        compiled by GNU C version 3.4.2 [FreeBSD] 20040728.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
fsabug.c: In function `fillTable':
fsabug.c:22: internal compiler error: in find_function_data, at function.c:317
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Gareth Evans 2005-06-14 13:09:31 UTC
Created attachment 9087 [details]
Code for Bug 22061
Comment 2 Andrew Pinski 2005-06-14 13:16:18 UTC
Confirmed, only a 3.4 regression.
Comment 3 Volker Reichelt 2005-06-14 15:57:12 UTC
Even shorter testcase:

=======================
int N = 1;

void foo() {}

void bar(int a[1][N])
{
    a[0][0] = 0;
}
=======================
Comment 4 rsandifo@gcc.gnu.org 2005-08-01 15:09:06 UTC
It looks like there's lots of interesting breakage in this area. ;)
Testing a patch.
Comment 5 rsandifo@gcc.gnu.org 2005-08-01 16:28:48 UTC
Reclassifying as a C frontend bug.
Comment 8 CVS Commits 2005-09-02 12:35:21 UTC
Subject: Bug 22061

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	rsandifo@gcc.gnu.org	2005-09-02 12:34:58

Modified files:
	gcc            : ChangeLog c-decl.c c-objc-common.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.c-torture/execute: pr22061-1.c pr22061-2.c 
	                                     pr22061-3.c pr22061-4.c 

Log message:
	PR c/22061
	* c-decl.c (push_parm_decl): Push and pop x_dont_save_pending_sizes_p
	around the call to grokdeclarator.  Call grokdeclarator with the
	field set to 0.
	(store_parm_decls): Always store the pending_sizes in cfun.
	(c_expand_body_1): Call put_pending_sizes.
	* c-objc-common.c (c_cannot_inline_tree_fn): Always check
	pending_sizes.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.913&r2=2.2326.2.914
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.470.4.22&r2=1.470.4.23
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-objc-common.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.37.4.1&r2=1.37.4.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.430&r2=1.3389.2.431
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/pr22061-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.4.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/pr22061-2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.4.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/pr22061-3.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.4.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/pr22061-4.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.4.1

Comment 9 rsandifo@gcc.gnu.org 2005-09-02 12:36:15 UTC
Applied to 3.4.  Testcases also applied to 4.0 and mainline.