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.
Created attachment 9087 [details] Code for Bug 22061
Confirmed, only a 3.4 regression.
Even shorter testcase: ======================= int N = 1; void foo() {} void bar(int a[1][N]) { a[0][0] = 0; } =======================
It looks like there's lots of interesting breakage in this area. ;) Testing a patch.
Reclassifying as a C frontend bug.
Subject: Bug 22061 CVSROOT: /cvs/gcc Module name: gcc Changes by: rsandifo@gcc.gnu.org 2005-09-02 12:24:21 Modified files: 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 * gcc.c-torture/execute/pr22061-1.c, * gcc.c-torture/execute/pr22061-2.c, * gcc.c-torture/execute/pr22061-3.c, * gcc.c-torture/execute/pr22061-4.c: New tests. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5993&r2=1.5994 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/pr22061-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/pr22061-2.c.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/pr22061-3.c.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/pr22061-4.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
Subject: Bug 22061 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: rsandifo@gcc.gnu.org 2005-09-02 12:26:17 Modified files: 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 * gcc.c-torture/execute/pr22061-1.c, * gcc.c-torture/execute/pr22061-2.c, * gcc.c-torture/execute/pr22061-3.c, * gcc.c-torture/execute/pr22061-4.c: New tests. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.366&r2=1.5084.2.367 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-4_0-branch&r1=NONE&r2=1.1.2.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-4_0-branch&r1=NONE&r2=1.1.2.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-4_0-branch&r1=NONE&r2=1.1.2.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-4_0-branch&r1=NONE&r2=1.1.2.1
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
Applied to 3.4. Testcases also applied to 4.0 and mainline.