The attached preprocessed files, 122593_genksyms_min.i and its Delta-reduction 122593_genksyms_min.i, cause a segfault for checking=all builds of GCC 4.1.0 on both Ubuntu 5.04 and OSX 10.4.5 with -std=c99 and -O1. The original .c and .h files from the Linux kernel distribution (which I'll also attach) crash on Ubuntu but not OSX. Ubuntu issues warnings before crashing, whereas OSX compiles cleanly, which suggests a header problem. A checking=all build of 4.0.2 compiles all three versions of the file with warnings but no error, as does a checking build of GCC 3.4.3; so this is a regression. Here's the session: 48> /opt/gcc410-chk-all/bin/gcc -v -std=c99 -O1 ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i Using built-in specs. Target: powerpc-apple-darwin8.5.0 Configured with: /opt/Gcc-4.1.0-dist/configure --enable-checking=all --prefix=/opt/gcc410-chk-all --enable-languages=c,c++ --with-comment=PalmSource checking=all build by Flash Sheridan 3/17/06 Thread model: posix gcc version 4.1.0 /opt/gcc410-chk-all/libexec/gcc/powerpc-apple-darwin8.5.0/4.1.0/cc1 -fpreprocessed ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i -fPIC -quiet -dumpbase 122593_genksyms_min.i -auxbase 122593_genksyms_min -O1 -std=c99 -version -o /var/tmp//cc4PRuEJ.s GNU C version 4.1.0 (powerpc-apple-darwin8.5.0) compiled by GNU C version 4.0.1 (Apple Computer, Inc. build 5247). GGC heuristics: --param ggc-min-expand=0 --param ggc-min-heapsize=0 Compiler executable checksum: 1116648296470812f723ca4bff2463c0 ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:60: warning: return type defaults to 'int' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:63: warning: return type defaults to 'int' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:66: warning: return type defaults to 'int' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:69: warning: return type defaults to 'int' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:72: warning: return type defaults to 'int' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i: In function 'add_symbol': ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:74: warning: implicit declaration of function 'map_to_ns' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:75: warning: implicit declaration of function 'strlen' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:75: warning: incompatible implicit declaration of built-in function 'strlen' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:75: warning: implicit declaration of function 'memcmp' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:75: warning: implicit declaration of function 'strcmp' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i: At top level: ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:80: warning: return type defaults to 'int' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:83: warning: return type defaults to 'int' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:86: warning: return type defaults to 'int' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:91: warning: return type defaults to 'int' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:96: warning: return type defaults to 'int' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i: In function 'print_list': ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:101: warning: implicit declaration of function 'alloca' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:101: warning: assignment makes pointer from integer without a cast ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i: At top level: ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:106: warning: return type defaults to 'int' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i: In function 'expand_and_crc_list': ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:111: warning: implicit declaration of function 'error_with_pos' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i: At top level: ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:120: warning: return type defaults to 'int' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:125: warning: return type defaults to 'int' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:129: warning: conflicting types for 'error_with_pos' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:111: warning: previous implicit declaration of 'error_with_pos' was here ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i: In function 'genksyms_usage': ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:138: warning: implicit declaration of function 'fprintf' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:138: warning: incompatible implicit declaration of built-in function 'fprintf' ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i: In function 'print_list': ../cpp/bugfiles/GCC_bugfiles/error/122593_genksyms_min.i:96: internal compiler error: Bus error Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. --- PalmSource bug 122593 http://pobox.com/~flash Quality Lead for Compilers and Debuggers PalmSource, Inc. Tools Quality Management
Created attachment 11120 [details] Preprocessed Delta-reduced source file
Created attachment 11121 [details] Pre-processed source
Created attachment 11122 [details] Original source
Created attachment 11123 [details] Original header
Backtrace: #0 0x00000000006fa7ae in find_func_aliases (t=0x2aaaab1483c0, ai=0xb1d9b0) at /home/pinskia/src/gcc-4.1/gcc/gcc/tree-ssa-structalias.c:2932 #1 0x00000000006fad8e in compute_points_to_sets (ai=0xb1d9b0) at /home/pinskia/src/gcc-4.1/gcc/gcc/tree-ssa-structalias.c:3742 #2 0x000000000047c74e in compute_may_aliases () at /home/pinskia/src/gcc-4.1/gcc/gcc/tree-ssa-alias.c:263 #3 0x00000000006e5c66 in execute_one_pass (pass=0xa319a0) at /home/pinskia/src/gcc-4.1/gcc/gcc/passes.c:827 #4 0x00000000006e5d5c in execute_pass_list (pass=0xa319a0) at /home/pinskia/src/gcc-4.1/gcc/gcc/passes.c:859
Reduced testcase: void print_list(void) { char *e; e = alloca(100); } ----- I wonder if alloca being turned off as a builtin is causing this.
this bug could be fixed my backporting this patch: 2005-12-11 Daniel Berlin <dberlin@dberlin.org> * timevar.def (TV_IPA_PTA): New. * tree-pass.h (pass_ipa_pta): New * tree-ssa-structalias.c: Include cgraph.h
Subject: Bug 26865 Author: jakub Date: Tue Apr 25 09:42:41 2006 New Revision: 113242 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113242 Log: PR tree-optimization/26865 * gcc.dg/pr26865.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr26865.c Modified: trunk/gcc/testsuite/ChangeLog
Subject: Bug 26865 Author: jakub Date: Tue Apr 25 09:45:01 2006 New Revision: 113243 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113243 Log: PR tree-optimization/26865 * tree-ssa-structalias.c (find_func_aliases): Check that anyoffsetrhs type is pointer or array type. * gcc.dg/pr26865.c: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/pr26865.c Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/testsuite/ChangeLog branches/gcc-4_1-branch/gcc/tree-ssa-structalias.c
Fixed on mainline and 4.1 branch.