profilebootstrap with CFLAGS="-O2" BOOT_CFLAGS="-O2" fails with /tmp/ccloJJLt.s: Assembler messages: /tmp/ccloJJLt.s:138: Warning: Corrupted unwind info due to unsupported section switching /tmp/ccloJJLt.s:747: Internal error! Assertion failure in ia64_estimate_size_before_relax at ../../gas/config/tc-ia64.c line 3098. Please report this bug. This is related to pr22313, but an extended patch does not fix this problem.
Created attachment 10278 [details] testcase Testcase
Created attachment 10279 [details] profile data 1/2
Created attachment 10280 [details] profile data 2/2
Grrr, the testcase was created with some older binutils. Trying to create one with one that matches the reported error.
Created attachment 10282 [details] testcase new testcase. Compile with stage1/cc1 -fpreprocessed c-lex.i -quiet -dumpbase c-lex.i -auxbase-strip c-lex.o -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute -Werror -version -fprofile-use -freorder-blocks-and-partition -fno-common -o /tmp/cciU35Gj.s GNU C version 4.1.0 20051116 (experimental) (SUSE Linux) (ia64-unknown-linux-gnu) compiled by GNU C version 4.1.0 20051116 (experimental) (SUSE Linux). GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 Compiler executable checksum: 1c9d4c0e30064cb5ef51bb1a6548d214 stage1/as -x -o c-lex.o /tmp/cciU35Gj.s /tmp/cciU35Gj.s: Assembler messages: /tmp/cciU35Gj.s:308: Warning: Corrupted unwind info due to unsupported section switching /tmp/cciU35Gj.s:4760: Internal error! Assertion failure in ia64_estimate_size_before_relax at ../../gas/config/tc-ia64.c line 3098. Please report this bug. not using -freorder-blocks-and-partition fixes the problem. Adding -g does not make a difference.
Created attachment 10283 [details] profile data 1/2
Created attachment 10284 [details] profile data 2/2
Created attachment 10285 [details] wrong assembly
Arguably an as bug, but maybe we should not use -freorder-blocks-and-partition on ia64 profiledbootstrap.
So if -g does not fix it, then this is not related at all to PR 22313. We should just disable --freorder-blocks-and-partition if gas is unwilling to support unwind info when the section changes. See http://sources.redhat.com/bugzilla/show_bug.cgi?id=994 for when the warning was introduced and more information on this bug.
See http://sources.redhat.com/bugzilla/show_bug.cgi?id=994 for the binutils bug.
This is too obscure to be release-critical.
Changing the summary to reflect reality and remove some of the obscure-ness. Mark, what was the obscureness you are refering to?
(In reply to comment #13) > Changing the summary to reflect reality and remove some of the obscure-ness. > Mark, what was the obscureness you are refering to? well both using BOOT_CFLAGS and profiledbootstrap together is less likely than just bootstrap and using BOOT_CFLAGS.
Subject: Re: [4.1 Regression] profilebootstrap failure rguenth at gcc dot gnu dot org wrote: > ------- Comment #13 from rguenth at gcc dot gnu dot org 2005-11-19 10:38 ------- > Changing the summary to reflect reality and remove some of the obscure-ness. > Mark, what was the obscureness you are refering to? Sorry, that was indeed unclear. I don't consider building the compiler with profiledbootstrap to be a fundamental usage model. Most people don't do it, and there's an easy work-around: build with normal bootstrap.
Confirmed.
The hot/cold section partitioning stuff has no support for generating unwind info. See for instance in opts.c where this is turned off when flag_exceptions is true, which means it is always turned off by default for C++. This is because C++ requires unwind info for the EH support, and we can't generate correct unwind info when host/cold section partitioning is on. This is true for all targets. The reason why there is an IA-64 issue here is because unwind info is a required part of the ABI. We must always generate unwind info, even for C, and thus this option is never safe on IA-64. But it will work for all other targets as they don't require unwind info for C code. I believe the correct fix here is to turn off the hot/cold partitioning support when flag_unwind_tables is defined. This is turned on by default in the IA-64 backend. This can also be turned on by the user. There are also some peripheral issues here. We should reconsider whether profiledbootstrap should include an option that does not support all targets and all languages. This could be trouble later. Also, the IA-64 assembler should not be core dumping here.
Created attachment 10320 [details] Turn off partitioning optimization when flag_unwind_tables true. Suggested untested patch. Gives different message for user requested unwind info versus target requested unwind info. This part is optional, and only affects IA-64 when flag_unwind_tables is the default.
Subject: Bug 24934 Author: wilson Date: Tue Dec 6 05:31:39 2005 New Revision: 108103 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108103 Log: PR target/24934 * opts.c (decode_options): Turn off partitioning if flag_unwind_tables is set. Modified: trunk/gcc/ChangeLog trunk/gcc/opts.c
Subject: Bug 24934 Author: wilson Date: Tue Dec 6 05:41:33 2005 New Revision: 108104 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108104 Log: PR target/24934 * opts.c (decode_options): Turn off partitioning if flag_unwind_tables is set. Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/opts.c
Fixed on mainline and the gcc-4.1 branch.