I was trying to compile Percona Server with gcc 4.8 with ASan (trunk build) and ran into this during the build-binary.sh script supplied with Percona Server: =========== [ 7%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/readline.c.o cd /percona-server/5.5/Percona-Server-5.5.28-rel29.3/cmd-line-utils/readline && /usr/local/bin/gcc -DHAVE_RESPONSE_TIME_DISTRIBUTION -DHAVE_CONFIG_H -DHAVE_CONFIG_H -DNO_KILL_INTR -fsanitize=address -fno-omit-frame-pointer -fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=rel29.3 -fPIC -Wall -O -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DENABLED_DEBUG_SYNC -I/percona-server/5.5/Percona-Server-5.5.28-rel29.3/include -I/percona-server/5.5/Percona-Server-5.5.28-rel29.3/cmd-line-utils -o CMakeFiles/readline.dir/readline.c.o -c /percona-server/5.5/Percona-Server-5.5.28-rel29.3/cmd-line-utils/readline/readline.c/percona-server/5.5/Percona-Server-5.5.28-rel29.3/cmd-line-utils/readline/readline.c: In function '_rl_dispatch_subseq': /percona-server/5.5/Percona-Server-5.5.28-rel29.3/cmd-line-utils/readline/readline.c:690:1: error: type mismatch in pointer plus expression _rl_dispatch_subseq (key, map, got_subseq) ^ int (*<Tcf4>) (int, int) char * long unsigned int _309 = _298 + _120; /percona-server/5.5/Percona-Server-5.5.28-rel29.3/cmd-line-utils/readline/readline.c:690:1: internal compiler error: verify_gimple failed 0x903f9c verify_gimple_in_cfg(function*) ../.././gcc/tree-cfg.c:4727 0x83e7b7 execute_function_todo ../.././gcc/passes.c:1970 0x83f0d7 execute_todo ../.././gcc/passes.c:1999 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. make[2]: *** [cmd-line-utils/readline/CMakeFiles/readline.dir/readline.c.o] Error 1 make[2]: Leaving directory `/percona-server/5.5/Percona-Server' make[1]: *** [cmd-line-utils/readline/CMakeFiles/readline.dir/all] Error 2 make[1]: Leaving directory `/percona-server/5.5/Percona-Server' make: *** [all] Error 2 =========== I realize there is seemingly an issue in the code, but it is interesting to see the "internal compiler error: verify_gimple failed". I tried making a reduced testcase, but ran into issues there so decided to just log this bug as-is as a FYI. Note that Percona Server compiles with gcc 4.7.2 To repeat, you may be able to do something like this: $ bzr branch -rjenkins@jenkins.percona.com-20130220064132-vewblweu0emq39np lp:percona-server/5.5 $ cd 5.5 $ gcc --version | grep GCC ; /usr/local/bin/gcc --version gcc (GCC) 4.8.0 20130218 (experimental) gcc (GCC) 4.8.0 20130218 (experimental) $ export LD_LIBRARY_PATH=/usr/local/lib # messy libraries $ chmod +x ./build/build-binary.sh $ ./build/build-binary.sh [--debug] . # try with/without --debug other version info: gmp: 5.1.1, mpfr: 3.1.1, mpc: 1.0, flex: 2.5.37 $ uname -a # Fedora Core x64 Linux <dns_name> 3.6.10-2.fc17.x86_64 #1 SMP Tue Dec 11 18:07:34 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux See bug 49731 and bug 50363 for more "internal compiler error: verify_gimple failed"
Without the preprocessed source this bugreport is useless, please see http://gcc.gnu.org/bugs.html for instructions.
Here is a testcase reduced from Percona's readline.c which makes GCC 4.9.0 as of 20130316 crash : $ cat f.c typedef type(); int a; type k; f() { a = strlen(&k); } $ xgcc -w -fsanitize=address f.c f.c: In function ‘f’: f.c:5:1: error: type mismatch in pointer plus expression f() ^ int (*<T39a>) () char * long unsigned int _14 = _3 + _1; f.c:5:1: internal compiler error: verify_gimple failed Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions.
Still seems to be broken with 20130710. An additional test case is available on request.
Yeah, confirmed.
Cleaned-up & reduced testcase: /* PR sanitizer/56417 */ /* { dg-do compile } */ /* { dg-options "-w" } */ int foo (void) { return __builtin_strlen (&foo); }
Created attachment 30536 [details] gcc49-pr56417.patch Untested fix. Though, strlen on function address? Ugh.
Author: jakub Date: Tue Aug 13 16:58:46 2013 New Revision: 201696 URL: http://gcc.gnu.org/viewcvs?rev=201696&root=gcc&view=rev Log: PR sanitizer/56417 * asan.c (instrument_strlen_call): Fix typo in comment. Use char * type even for the lhs of POINTER_PLUS_EXPR. * gcc.dg/asan/pr56417.c: New test. Added: trunk/gcc/testsuite/gcc.dg/asan/pr56417.c Modified: trunk/gcc/ChangeLog trunk/gcc/asan.c trunk/gcc/testsuite/ChangeLog Author: jakub Date: Tue Aug 13 17:02:13 2013 New Revision: 201697 URL: http://gcc.gnu.org/viewcvs?rev=201697&root=gcc&view=rev Log: PR sanitizer/56417 * asan.c (instrument_strlen_call): Fix typo in comment. Use char * type even for the lhs of POINTER_PLUS_EXPR. * gcc.dg/asan/pr56417.c: New test. Added: branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/asan/pr56417.c Modified: branches/gcc-4_8-branch/gcc/ChangeLog branches/gcc-4_8-branch/gcc/asan.c branches/gcc-4_8-branch/gcc/testsuite/ChangeLog