Test case (prog.c): void f(int [(int (*)[*]) { 0 } == 0]); int main() { } Compilation command line: gcc prog.c -Wall -Wextra -std=c11 -pedantic-errors Observed behaviour: Internal compiler error.
Another test case that also gives internal compiler error with the same compilation command line: void f(int n, int [(int (*)[n]) { 0 } == 0]); int main() { }
Does not appear with GCC 8 branch, so a regression, can someone bisect to find what commit introduced this ICE? internal compiler error: in get_parm_info, at c/c-decl.c:7517 0x5992b3 get_parm_info(bool, tree_node*) /scratch/jmyers/fsf/gcc-mainline/gcc/c/c-decl.c:7517 0x7e92e7 c_parser_parms_list_declarator /scratch/jmyers/fsf/gcc-mainline/gcc/c/c-parser.c:4024 0x7e9403 c_parser_parms_declarator /scratch/jmyers/fsf/gcc-mainline/gcc/c/c-parser.c:3939 0x7e2ae9 c_parser_direct_declarator_inner /scratch/jmyers/fsf/gcc-mainline/gcc/c/c-parser.c:3868 0x7f8ead c_parser_declaration_or_fndef /scratch/jmyers/fsf/gcc-mainline/gcc/c/c-parser.c:1999 0x800bef c_parser_external_declaration /scratch/jmyers/fsf/gcc-mainline/gcc/c/c-parser.c:1653 0x801611 c_parser_translation_unit /scratch/jmyers/fsf/gcc-mainline/gcc/c/c-parser.c:1534 0x801611 c_parse_file() /scratch/jmyers/fsf/gcc-mainline/gcc/c/c-parser.c:19807 0x853afb c_common_parse_file() /scratch/jmyers/fsf/gcc-mainline/gcc/c-family/c-opts.c:1151 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.
Started with r259641.
Thanks for the bisect.
Created attachment 45366 [details] gcc9-pr88701.patch For what I wanted to achieve with that change (i.e. put the compound literal decls in the block scope they belong to), the following works too; it is fine if the compound literals in the function parameters are handled as before - in the scope of the function.
Author: jakub Date: Mon Jan 7 22:55:48 2019 New Revision: 267667 URL: https://gcc.gnu.org/viewcvs?rev=267667&root=gcc&view=rev Log: PR c/88701 * c-decl.c (build_compound_literal): If not TREE_STATIC, only pushdecl if current_function_decl is non-NULL. * gcc.dg/pr88701.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr88701.c Modified: trunk/gcc/c/ChangeLog trunk/gcc/c/c-decl.c trunk/gcc/testsuite/ChangeLog
Fixed.