Bug 24460 - [4.1 regression] Profiled bootstrap broken
Summary: [4.1 regression] Profiled bootstrap broken
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.1.0
Assignee: Eric Botcazou
URL:
Keywords: build, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2005-10-20 19:03 UTC by Eric Botcazou
Modified: 2005-10-26 07:10 UTC (History)
1 user (show)

See Also:
Host: sparc-sun-solaris2.*
Target: sparc-sun-solaris2.*
Build: sparc-sun-solaris2.*
Known to work:
Known to fail:
Last reconfirmed: 2005-10-21 19:34:31


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Botcazou 2005-10-20 19:03:50 UTC
The failure message is:

stage1/xgcc -Bstage1/ -B/opt/build/eric/local/gcc/sparc-sun-solaris2.10/bin/ -c  -g -O2 -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 -Werror -fno-common   -DHAVE_CONFIG_H -I. -I. -I/home/eric/cvs/gcc/gcc -I/home/eric/cvs/gcc/gcc/. -I/home/eric/cvs/gcc/gcc/../include -I./../intl -I/home/eric/cvs/gcc/gcc/../libcpp/include -I/opt/build/eric/local/include -I/opt/build/eric/local/include   /home/eric/cvs/gcc/gcc/attribs.c -o attribs.o
/home/eric/cvs/gcc/gcc/attribs.c:332: internal compiler error: Segmentation Fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
gmake[2]: *** [attribs.o] Error 1
gmake[2]: Leaving directory `/opt/build/eric/gcc/gcc'
gmake[1]: *** [stagefeedback_build] Error 2
gmake[1]: Leaving directory `/opt/build/eric/gcc/gcc'
gmake: *** [profiledbootstrap] Error 2

A bit annoying to debug as the stage1 compiler is apparently built without debug info.  The bug happens with -g -fprofile-use -freorder-blocks-and-partition.
Comment 1 Andrew Pinski 2005-10-20 19:08:24 UTC
Stage1 should be built at -O0 -g.
Comment 2 Eric Botcazou 2005-10-20 19:15:42 UTC
> Stage1 should be built at -O0 -g.

It's probably not the regular stage1.  I'm bootstrapping again to watch what is going on exactly.

Comment 3 Andrew Pinski 2005-10-20 19:24:10 UTC
Hmm:
stageprofile_build: stage1_copy


It is the normal stage1.  If you cannot figure out the backtrace, I might be able to reproduce this by a cross compiler.   Could you attach the .i file, .gcda and .gcno files?
Comment 4 Eric Botcazou 2005-10-20 19:35:59 UTC
> It is the normal stage1.

No, it isn't, look at the options.  Normal stage1 has -g -O2 -fprofile-generate.
It's very likely stage1 of stagefeedback_build.  I'm replaying the bootstrap.
Comment 5 Eric Botcazou 2005-10-21 14:57:36 UTC
Here's the nice version:

stage1/xgcc -Bstage1/ -B/opt/build/eric/local/gcc/sparc-sun-solaris2.10/bin/ -c  -g -O2 -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 -Werror -fno-common   -DHAVE_CONFIG_H -I. -I. -I/home/eric/cvs/gcc/gcc -I/home/eric/cvs/gcc/gcc/. -I/home/eric/cvs/gcc/gcc/../include -I./../intl -I/home/eric/cvs/gcc/gcc/../libcpp/include -I/opt/build/eric/local/include -I/opt/build/eric/local/include   /home/eric/cvs/gcc/gcc/attribs.c -o attribs.o
/home/eric/cvs/gcc/gcc/attribs.c: In function 'decl_attributes':
/home/eric/cvs/gcc/gcc/attribs.c:332: internal compiler error: RTL check: expected elt 3 type 'B', have '0' (rtx barrier) in fix_crossing_unconditional_branches, at bb-reorder.c:1742
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
gmake[2]: *** [attribs.o] Error 1
Comment 6 Eric Botcazou 2005-10-21 19:34:31 UTC
Investigating.
Comment 7 GCC Commits 2005-10-21 21:44:50 UTC
Subject: Bug 24460

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ebotcazou@gcc.gnu.org	2005-10-21 21:44:42

Modified files:
	gcc            : ChangeLog bb-reorder.c 

Log message:
	PR rtl-optimization/24460
	* bb-reorder.c (fix_crossing_unconditional_branches): Do not
	set the basic block for barriers.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.10202&r2=2.10203
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/bb-reorder.c.diff?cvsroot=gcc&r1=1.114&r2=1.115

Comment 8 Eric Botcazou 2005-10-21 21:48:02 UTC
Now the failure is:

Program received signal SIGSEGV, Segmentation fault.
0x000000000067d51c in output_line_info ()
    at /home/eric/cvs/gcc/gcc/dwarf2out.c:7902
7902          if (function != line_info->function)
(gdb) bt
#0  0x000000000067d51c in output_line_info ()
    at /home/eric/cvs/gcc/gcc/dwarf2out.c:7902
#1  0x000000000068e101 in dwarf2out_finish (
    filename=0x7fbffff281 "../attribs.i")
    at /home/eric/cvs/gcc/gcc/dwarf2out.c:14082
#2  0x00000000009ecdb5 in compile_file ()
    at /home/eric/cvs/gcc/gcc/toplev.c:1028
#3  0x00000000009ee58d in do_compile () at /home/eric/cvs/gcc/gcc/toplev.c:1945
#4  0x00000000009ee5ef in toplev_main (argc=5, argv=0x7fbfffee48)
    at /home/eric/cvs/gcc/gcc/toplev.c:1977
#5  0x000000000049ae8b in main (argc=5, argv=0x7fbfffee48)
    at /home/eric/cvs/gcc/gcc/main.c:35
Comment 9 GCC Commits 2005-10-26 07:03:42 UTC
Subject: Bug 24460

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ebotcazou@gcc.gnu.org	2005-10-26 07:03:32

Modified files:
	gcc            : ChangeLog bb-reorder.c dwarf2out.c output.h 
	                 varasm.c 

Log message:
	PR rtl-optimization/24460
	* dwarf2out.c (have_switched_text_sections): New boolean variable.
	(dwarf2out_switch_text_section): Set it to true instead of
	incrementing separate_line_info_table_in_use.
	(output_loc_list): Additionally test have_switched_text_sections.
	(output_ranges): Likewise.
	(dwarf2out_finish): Likewise.
	* varasm.c (assemble_start_function): Do not call
	insert_section_boundary_note.
	(assemble_end_function): If flag_reorder_blocks_and_partition,
	switch to the function's section before emitting the .size directive.
	* bb-reorder.c (insert_section_boundary_note): Staticify.
	(rest_of_handle_reorder_blocks): Call insert_section_boundary_note.
	* output.h (insert_section_boundary_note): Delete.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.10214&r2=2.10215
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/bb-reorder.c.diff?cvsroot=gcc&r1=1.115&r2=1.116
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/dwarf2out.c.diff?cvsroot=gcc&r1=1.615&r2=1.616
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/output.h.diff?cvsroot=gcc&r1=1.161&r2=1.162
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/varasm.c.diff?cvsroot=gcc&r1=1.534&r2=1.535

Comment 10 Eric Botcazou 2005-10-26 07:10:35 UTC
See http://gcc.gnu.org/ml/gcc-patches/2005-10/msg01409.html