Bug 24934 - [4.1/4.2 Regression] profilebootstrap failure
Summary: [4.1/4.2 Regression] profilebootstrap failure
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.1.0
: P5 normal
Target Milestone: 4.1.0
Assignee: Jim Wilson
URL:
Keywords: build, wrong-code
Depends on: 22313
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-18 20:16 UTC by Richard Biener
Modified: 2005-12-06 05:55 UTC (History)
3 users (show)

See Also:
Host:
Target: ia64-unknown-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-11-23 00:16:39


Attachments
testcase (64.60 KB, text/plain)
2005-11-18 20:17 UTC, Richard Biener
Details
profile data 1/2 (266 bytes, application/octet-stream)
2005-11-18 20:18 UTC, Richard Biener
Details
profile data 2/2 (1.88 KB, application/octet-stream)
2005-11-18 20:19 UTC, Richard Biener
Details
testcase (74.78 KB, text/plain)
2005-11-18 20:59 UTC, Richard Biener
Details
profile data 1/2 (575 bytes, application/octet-stream)
2005-11-18 20:59 UTC, Richard Biener
Details
profile data 2/2 (3.57 KB, application/octet-stream)
2005-11-18 21:00 UTC, Richard Biener
Details
wrong assembly (13.00 KB, text/plain)
2005-11-18 21:00 UTC, Richard Biener
Details
Turn off partitioning optimization when flag_unwind_tables true. (674 bytes, patch)
2005-11-23 00:20 UTC, Jim Wilson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2005-11-18 20:16:33 UTC
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.
Comment 1 Richard Biener 2005-11-18 20:17:43 UTC
Created attachment 10278 [details]
testcase

Testcase
Comment 2 Richard Biener 2005-11-18 20:18:25 UTC
Created attachment 10279 [details]
profile data 1/2
Comment 3 Richard Biener 2005-11-18 20:19:08 UTC
Created attachment 10280 [details]
profile data 2/2
Comment 4 Richard Biener 2005-11-18 20:28:22 UTC
Grrr, the testcase was created with some older binutils.  Trying to create one with one that matches the reported error.
Comment 5 Richard Biener 2005-11-18 20:59:01 UTC
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.
Comment 6 Richard Biener 2005-11-18 20:59:36 UTC
Created attachment 10283 [details]
profile data 1/2
Comment 7 Richard Biener 2005-11-18 21:00:05 UTC
Created attachment 10284 [details]
profile data 2/2
Comment 8 Richard Biener 2005-11-18 21:00:47 UTC
Created attachment 10285 [details]
wrong assembly
Comment 9 Richard Biener 2005-11-18 21:01:48 UTC
Arguably an as bug, but maybe we should not use -freorder-blocks-and-partition on ia64 profiledbootstrap.
Comment 10 Andrew Pinski 2005-11-18 21:02:20 UTC
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.
Comment 11 Richard Biener 2005-11-18 21:07:01 UTC
See http://sources.redhat.com/bugzilla/show_bug.cgi?id=994 for the binutils bug.
Comment 12 Mark Mitchell 2005-11-19 02:22:57 UTC
This is too obscure to be release-critical.
Comment 13 Richard Biener 2005-11-19 10:38:58 UTC
Changing the summary to reflect reality and remove some of the obscure-ness.  Mark, what was the obscureness you are refering to?
Comment 14 Andrew Pinski 2005-11-19 16:22:17 UTC
(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.
Comment 15 Mark Mitchell 2005-11-19 17:34:48 UTC
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.

Comment 16 Andrew Pinski 2005-11-20 00:38:48 UTC
Confirmed.
Comment 17 Jim Wilson 2005-11-23 00:16:39 UTC
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.
Comment 18 Jim Wilson 2005-11-23 00:20:35 UTC
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.
Comment 19 Jim Wilson 2005-12-06 05:31:44 UTC
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

Comment 20 Jim Wilson 2005-12-06 05:41:43 UTC
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

Comment 21 Jim Wilson 2005-12-06 05:55:02 UTC
Fixed on mainline and the gcc-4.1 branch.