https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69539
Bug ID: 69539 Summary: ICE in expand_UBSAN_NULL, at internal-fn.c:202 Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: sasha.levin at oracle dot com CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org Target Milestone: --- Created attachment 37508 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37508&action=edit preprocessed source I'm seeing the following ICE: include/linux/compiler.h: In function ‘__read_once_size_nocheck’: include/linux/compiler.h:235:44: internal compiler error: in expand_UBSAN_NULL, at internal-fn.c:202 __READ_ONCE_SIZE; ^ 0x8352b7 expand_UBSAN_NULL ../../gcc/internal-fn.c:202 0x633b87 expand_call_stmt ../../gcc/cfgexpand.c:2561 0x633b87 expand_gimple_stmt_1 ../../gcc/cfgexpand.c:3536 0x633b87 expand_gimple_stmt ../../gcc/cfgexpand.c:3702 0x6358d1 expand_gimple_basic_block ../../gcc/cfgexpand.c:5708 0x63b906 execute ../../gcc/cfgexpand.c:6323 with: $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/home/sasha/gcc-inst/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../configure --prefix=/home/sasha/gcc-inst/ --with-arch=native --with-tune=native --enable-languages=c --enable-lto --enable-gold --enable-stage1-languages=c Thread model: posix gcc version 6.0.0 20160127 (experimental) (GCC) It is possible to reproduce using the attached preprocessed source file and: gcc -flto -fsanitize=null -c -o test test.c; gcc -flto test