[Bug bootstrap/56258] Please upgrade doc/*.texi to the latest texinfo package(s)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56258 Bruce Dubbs changed: What|Removed |Added CC||bdubbs at linuxfromscratch ||dot org --- Comment #2 from Bruce Dubbs 2013-02-18 21:31:45 UTC --- texinfo-5.0 has been released and breaks the gcc info page generation. For LFS, we are disabling these files until the texi files are fixed: sed -i 's/BUILD_INFO=info/BUILD_INFO=/' gcc/configure
[Bug tree-optimization/54475] New: -O2 overoptimizes
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54475 Bug #: 54475 Summary: -O2 overoptimizes Classification: Unclassified Product: gcc Version: 4.7.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: bdu...@linuxfromscratch.org Note: This is *not* my code, but found inside a ./configure file circa 2008. $ cat t.c int main() { int j; for (j = 1; 0 < j; j *= 2) printf( "%i\n", j ); } $ gcc -o t t.c Works fine. $ gcc -o t -O2 t.c Loops forever and prints 0 after j reaches 1073741824. Looking a the asm for the optimized code, there is no test for j<0. It appears to have been optimized away. --- with -O2 main: .LFB0: .cfi_startproc pushq %rbx .cfi_def_cfa_offset 16 .cfi_offset 3, -16 movl$1, %ebx .p2align 4,,10 .p2align 3 .L2: movl%ebx, %esi movl$.LC0, %edi xorl%eax, %eax callprintf addl%ebx, %ebx jmp .L2 .cfi_endproc .LFE0: .size main, .-main .ident "GCC: (GNU) 4.7.1" .section.note.GNU-stack,"",@progbits
[Bug target/44129] Building linux kernel with gcc-4.5.0 and CONFIG_CC_OPTIMIZE_FOR_SIZE segfaults
--- Comment #17 from bdubbs at linuxfromscratch dot org 2010-06-19 00:05 --- I can confirm that changing inline to __always_inline in arch/x86/include/asm/system.h fixed the panic for me. I'm not sure if this fix is the result of an error in the kernel or gcc. Leaving the bug open for now, but it may be appropriate to close it. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44129
[Bug target/44129] Building linux kernel with gcc-4.5.0 and CONFIG_CC_OPTIMIZE_FOR_SIZE segfaults
--- Comment #14 from bdubbs at linuxfromscratch dot org 2010-05-31 00:41 --- (In reply to comment #13) > (In reply to comment #12) > > I'm assuming this is current Linus git (post 2.6.34). > > I'm guessing from > > >Tested on several kernels: 2.6.32.8, 2.6.33.4, 2.6.34-rc7 > > That this isn't the case. Exactly right. I'm using 2.6.33.4 for consistency. I did look at arch/x86/kernel/tsc.c and modified it to remove the lone goto, but the kernel panic upon boot persists. This problem does seem to be specific to the combination of building on an x86_64 and using -Os -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44129
[Bug target/44129] Building linux kernel with gcc-4.5.0 and CONFIG_CC_OPTIMIZE_FOR_SIZE segfaults
--- Comment #11 from bdubbs at linuxfromscratch dot org 2010-05-24 06:32 --- Updated to gcc (GCC) 4.5.1 20100524 (prerelease) but still have the problem. There is something about -Os that triggers the kernel panic in arch/x86/kernel/tsc.c I tried to disable all -O2 options after -Os and the kernel still fails. gcc -Wp,-MD,arch/x86/kernel/.tsc.o.d -nostdinc -isystem \ /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/include \ -I/sources/linux-2.6.33.4-gcc45/arch/x86/include -Iinclude -include \ include/generated/autoconf.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes \ -Wno-trigraphs -fno-strict-aliasing -fno-common \ -Werror-implicit-function-declaration -Wno-format-security \ -fno-delete-null-pointer-checks -Os \ -fno-thread-jumps \ -fno-caller-saves \ -fno-crossjumping \ -fno-cse-follow-jumps \ -fno-cse-skip-blocks \ -fno-delete-null-pointer-checks \ -fno-expensive-optimizations \ -fno-gcse \ -fno-gcse-lm \ -fno-inline-small-functions \ -fno-indirect-inlining \ -fno-ipa-sra \ -fno-optimize-sibling-calls \ -fno-peephole2 \ -fno-regmove \ -fno-rerun-cse-after-loop \ -fno-sched-interblock \ -fno-sched-spec \ -fno-schedule-insns \ -fno-schedule-insns2 \ -fno-strict-overflow \ -fno-tree-switch-conversion \ -fno-tree-pre \ -fno-tree-vrp \ -fno-align-functions \ -fno-align-jumps \ -fno-align-loops \ -fno-align-labels \ -fno-reorder-blocks \ -fno-strict-aliasing \ -fno-reorder-blocks \ -m64 -march=core2 -mno-red-zone \ -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 \ -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare \ -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow \ -Wframe-larger-than=2048 -fno-stack-protector -fno-omit-frame-pointer \ -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign \ -fno-strict-overflow -fno-dwarf2-cfi-asm -fconserve-stack -fno-stack-protector \ -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(tsc)" \ -D"KBUILD_MODNAME=KBUILD_STR(tsc)" -c -o arch/x86/kernel/tsc.o \ arch/x86/kernel/tsc.c Changing -Os to -O2 does *not* fail, even with the -fno options in the single column above removed. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44129
[Bug target/44129] Building linux kernel with gcc-4.5.0 and CONFIG_CC_OPTIMIZE_FOR_SIZE segfaults
--- Comment #9 from bdubbs at linuxfromscratch dot org 2010-05-16 06:38 --- I have traced the problem file for this bug to the kernel file arch/x86/kernel/tsc.c I have two source trees for the 2.6.33.4 kernel, one compiled with gcc-4.4.1 which works and gcc version 4.5.1 20100514 (prerelease) which fails. I have attached the config file that generates the error. I traced the problem to the above file, but don't know enough about the kernel and gcc internals to either parse it down much further or fix the problem. When I copy arch/x86/kernel/tsc.o from the 4.4.1 build to the 4.5.1 kernel tree and rebuild, the system (relatively generic Dell x86_64) boots properly. The file build command is: gcc -Wp,-MD,arch/x86/kernel/.tsc.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/include -I/sources/linux-2.6.33.4-gcc45/arch/x86/include -Iinclude -include include/generated/autoconf.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -m64 -march=core2 -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wframe-larger-than=2048 -fno-stack-protector -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-dwarf2-cfi-asm -fconserve-stack -fno-stack-protector -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(tsc)" -D"KBUILD_MODNAME=KBUILD_STR(tsc)" -c -o arch/x86/kernel/tsc.o arch/x86/kernel/tsc.c When I tried removing the -Os option, it did not fix the problem. I'm guessing the problem is around lines 724-761 because of the ifdef CONFIG_X86_64 and the use of rdtsc_barrier() in the panic info above. I'm really at the limits of what I know how to do here. I think I rebuilt/rebooted a hundred times to narrow things down so far. Let me know if I can do anything else. Many Bothans died to bring us this information. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44129
[Bug target/44129] Building linux kernel with gcc-4.5.0 and CONFIG_CC_OPTIMIZE_FOR_SIZE segfaults
--- Comment #8 from bdubbs at linuxfromscratch dot org 2010-05-16 05:55 --- Created an attachment (id=20671) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20671&action=view) Linux kernel configuration that fails with gcc-4.5 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44129
[Bug target/44129] Building linux kernel with gcc-4.5.0 and CONFIG_CC_OPTIMIZE_FOR_SIZE segfaults
--- Comment #7 from bdubbs at linuxfromscratch dot org 2010-05-15 04:06 --- (In reply to comment #6) > You build 2 kernel trees, one with gcc 4.5.1 and one > with gcc 4.4.4. You copy binaries from one tree to > another and rebuild kernel one file at a time until > you find the single file which was miscompiled. OK. That will take some time. I'll get back to you when I find the problem file. > > > BTW, you aren't using gold, are you? > > > > I don't know what gold is either. > Please show the output of > # ld -V GNU ld (GNU Binutils) 2.20.1.20100303 Supported emulations: elf_x86_64 elf_i386 i386linux elf_l1om -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44129
[Bug target/44129] Building linux kernel with gcc-4.5.0 and CONFIG_CC_OPTIMIZE_FOR_SIZE segfaults
--- Comment #5 from bdubbs at linuxfromscratch dot org 2010-05-14 22:50 --- (In reply to comment #4) > I saw you have tried revision 159398. I guess you > need to find which file is miscompiled. I have no idea how to do that for the kernel. > BTW, you aren't using gold, are you? I don't know what gold is either. I'm willing to help find the problem, but I need some hints on how to proceed. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44129
[Bug target/44129] Building linux kernel with gcc-4.5.0 and CONFIG_CC_OPTIMIZE_FOR_SIZE segfaults
--- Comment #2 from bdubbs at linuxfromscratch dot org 2010-05-14 21:27 --- OK, these are my procedures: svn co svn://gcc.gnu.org/svn/gcc/branches/gcc-4_5-branch gcc45-svn (revision 159398) cd gcc45-svn sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in sed -i 's...@\./fixinc\...@-c true@' gcc/Makefile.in mkdir ../gcc-build cd../gcc-build ../gcc45-svn/configure \ --prefix=/usr \ --libexecdir=/usr/lib \ --enable-shared \ --enable-threads=posix \ --enable-__cxa_atexit \ --disable-multilib \ --enable-bootstrap \ --enable-clocale=gnu \ --enable-languages=c,c++ make bootstrap make -k check ../gcc45-svn/contrib/test_summary Native configuration is x86_64-unknown-linux-gnu === g++ tests === Running target unix === g++ Summary === # of expected passes21906 # of expected failures 149 # of unsupported tests 269 === gcc tests === Running target unix FAIL: gcc.c-torture/compile/limits-exprparen.c -O0 (test for excess errors) FAIL: gcc.c-torture/compile/limits-exprparen.c -O1 (test for excess errors) FAIL: gcc.c-torture/compile/limits-exprparen.c -O2 (test for excess errors) FAIL: gcc.c-torture/compile/limits-exprparen.c -O3 -fomit-frame-pointer (test for excess errors) FAIL: gcc.c-torture/compile/limits-exprparen.c -O3 -g (test for excess errors) FAIL: gcc.c-torture/compile/limits-exprparen.c -Os (test for excess errors) === gcc Summary === # of expected passes61141 # of unexpected failures6 # of expected failures 168 # of unsupported tests 826 Running target unix === libgomp Summary === # of expected passes1029 === libmudflap tests === Running target unix FAIL: libmudflap.c/fail31-frag.c (-O3) output pattern test FAIL: libmudflap.c/pass45-frag.c (-O3) execution test FAIL: libmudflap.c/pass45-frag.c (-O3) output pattern test FAIL: libmudflap.c/pass45-frag.c (-O3) execution test FAIL: libmudflap.c/pass45-frag.c (-O3) output pattern test FAIL: libmudflap.c++/pass41-frag.cxx execution test FAIL: libmudflap.c++/pass41-frag.cxx (-static) execution test FAIL: libmudflap.c++/pass41-frag.cxx ( -O) execution test FAIL: libmudflap.c++/pass41-frag.cxx (-O2) execution test FAIL: libmudflap.c++/pass41-frag.cxx (-O3) execution test === libmudflap Summary === # of expected passes1884 # of unexpected failures10 === libstdc++ tests === Running target unix === libstdc++ Summary === # of expected passes7065 # of expected failures 95 # of unsupported tests 339 make install gcc --version gcc (GCC) 4.5.1 20100514 (prerelease) cd /sources/linux-2.6.33.4 make menuconfig # KBUILD_CFLAGS += -Os make make modules_install cp arch/x86/boot/bzImage /boot/linux-test reboot Hand Copied: init[1] segfault at 810099bd ip 810088bd sp - error 15 kernel panic - not syncing: Attempted to kill init! Pid: 1,comm: init not tainted 2.6.33.4-lfs66 Call Trace: [] panic [] ? get_current_tty [] do_exit [] do_group_exit [] get_signal_to_deliver [] do_signal [] ? printk [] ? rdtsc_barrier [] ? printk [] ? __bad_area_nosemaphore [] ? rdtsc_barrier [] do_notify_resume [] retint_signal [] ? rdtsc_barrier - Changing back to not optimize for size results in a bootable kernel. Also, every package on the boot partition was built with gcc-4.5.0. Evidently none of the other core packages tries to optimize for size. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44129
[Bug c/44129] New: Building linux kernel with gcc-4.5.0 and CONFIG_CC_OPTIMIZE_FOR_SIZE segfaults
I believe there is an optimization bug in gcc-4.5.0. When building with gcc-4.5.0 and setting the linux kernel flag CONFIG_CC_OPTIMIZE_FOR_SIZE, the kernel indicates a segfault upon boot. Tested with the normal sysvinit and bash-static and the indication is the identical memory address with the error "kernel panic - not syncing: Attempted to kill init!" The error indications are almost identical to the post at: http://www.gossamer-threads.com/lists/linux/kernel/1210031 Clearing the optimization flag boots normally. Using gcc-4.4.3 does not show the problem. Tested on several kernels: 2.6.32.8, 2.6.33.4, 2.6.34-rc7. -- Summary: Building linux kernel with gcc-4.5.0 and CONFIG_CC_OPTIMIZE_FOR_SIZE segfaults Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bdubbs at linuxfromscratch dot org GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44129