Bug 26942 - Code generation bug -freorder-blocks-and-partition
Summary: Code generation bug -freorder-blocks-and-partition
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.1.0
: P3 normal
Target Milestone: 4.1.2
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2006-03-30 14:40 UTC by Clifford Wolf
Modified: 2006-09-03 20:55 UTC (History)
1 user (show)

See Also:
Host: i386-unknown-linux-gnu
Target: i386-unknown-linux-gnu
Build: i386-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:

Testcase (73.18 KB, application/octet-stream)
2006-03-30 14:43 UTC, Clifford Wolf

Note You need to log in before you can comment on or make changes to this bug.
Description Clifford Wolf 2006-03-30 14:40:40 UTC
I've found this bug while building gcc 4.1.0 (on GNU/Linux x86). In the
'rebuild with -fprofile-use' stage I get the following error:

stage1/xgcc -Bstage1/ -B/usr/i386-unknown-linux-gnu/bin/ -c -O2 -g -fomit-frame-pointer -fprofile-use -freorder-blocks-and-partition -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include ../../gcc/attribs.c -o attribs.o
/tmp/cc9Aywrx.s: Assembler messages:
/tmp/cc9Aywrx.s:1256: Error: can't resolve `.text.unlikely' {.text.unlikely section} - `.LCFI70' {.text section}

the line 1256 in the generated assembler output reads:

.long   .LCFI71-.LCFI70

but the symbol .LCFI71 is in the .text.unlikely section while .LCFI70 is in .text.
Comment 1 Clifford Wolf 2006-03-30 14:43:09 UTC
Created attachment 11165 [details]

This are the prerpocessed C input file, the .gcda and .gcno files (for -fprofile-use) and a little shell script containing the gcc options I was using.
Comment 2 Andrew Pinski 2006-03-30 19:57:44 UTC
This has nothing to do with -fprofile-use and all to do with -freorder-blocks-and-partition 
Comment 3 Andrew Pinski 2006-09-03 20:54:30 UTC
Fixed in 4.1.2.
Comment 4 Andrew Pinski 2006-09-03 20:55:48 UTC
(In reply to comment #3)
> Fixed in 4.1.2.
2006-08-31  Roger Sayle  <roger@eyesopen.com>

        PR other/22313
        * dwarf2out.c (add_fde_cfi): Use a set_loc if the current label is
        NULL, otherwise use an advance_loc4 to adjust relative to the
        current label.
        (output_cfi) <DW_CFA_set_loc>: Update the current label.
        (dwarf2out_switch_text_section): Reset the current label to avoid
        using advance_loc4 over section boundaries.