https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83653
Bug ID: 83653 Summary: GCC fails to remove a can't-happen call on ia64 Product: gcc Version: 6.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: matthew at wil dot cx Target Milestone: --- Created attachment 43009 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43009&action=edit Gzipped preprocessed source This is an excerpt from the Linux kernel, with some patches that I'm preparing to go in. The 0day build-bot reports a problem with an undefined __bad_increment_for_ia64_fetch_and_add. I can reproduce the problem by taking the attached preprocessed source and compiling it with gcc -O2 -o shmem.o -c shmem.i and then running nm shmem.o |grep __bad Manually inlining page_ref_sub() in the included test-case makes the problem go away, as does simply deleting the call to page_ref_sub() (at line 50756). Command line: gcc -Wp,-MD,mm/.shmem.o.d -nostdinc -isystem /usr/lib/gcc/ia64-linux-gnu/4.6/include -I./arch/ia64/include -I./arch/ia64/include/generated -I./include -I./arch/ia64/include/uapi -I./arch/ia64/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -DHAVE_WORKING_TEXT_ALIGN -DHAVE_MODEL_SMALL_ATTRIBUTE -DHAVE_SERIALIZE_DIRECTIVE -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -Wno-unused-but-set-variable -fno-PIE -pipe -ffixed-r13 -mfixed-range=f12-f15,f32-f127 -falign-functions=32 -frename-registers -fno-optimize-sibling-calls -fno-delete-null-pointer-checks -O2 -DCC_HAVE_ASM_GOTO -Wframe-larger-than=2048 -fno-stack-protector -fomit-frame-pointer -fno-var-tracking-assignments -g -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -mconstant-gp -DKBUILD_BASENAME='"shmem"' -DKBUILD_MODNAME='"shmem"' -c -o mm/.tmp_shmem.o mm/shmem.c