Bug 39927 - [4.5 Regression]: build breakage for cris-elf building libstdc++-v3
Summary: [4.5 Regression]: build breakage for cris-elf building libstdc++-v3
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.5.0
: P1 normal
Target Milestone: 4.5.0
Assignee: Michael Matz
URL:
Keywords: build, ice-on-valid-code, patch
Depends on:
Blocks:
 
Reported: 2009-04-27 07:03 UTC by Hans-Peter Nilsson
Modified: 2009-05-06 05:06 UTC (History)
5 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: cris-axis-elf
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-04-27 13:45:10


Attachments
preprocessed, non-reduced (44.77 KB, text/plain)
2009-04-27 07:05 UTC, Hans-Peter Nilsson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hans-Peter Nilsson 2009-04-27 07:03:12 UTC
With revision 146814 a build with --target=cris-elf was successful.
From revision 146824 and on, the build is broken as follows:

libtool: compile:  /tmp/hpautotest-gcc1/cris-elf/gccobj/./gcc/xgcc -shared-libgcc -B/tmp/hpautotest-gcc1/cris-elf/gccobj/./gcc -nostdinc++ -L/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libstdc++-v3/src -L/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libstdc++-v3/src/.libs -nostdinc -B/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/newlib/ -isystem /tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/newlib/targ-include -isystem /tmp/hpautotest-gcc1/gcc/newlib/libc/include -B/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libgloss/cris -L/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libgloss/libnosys -L/tmp/hpautotest-gcc1/gcc/libgloss/cris -B/tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/bin/ -B/tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/lib/ -isystem /tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/include -isystem /tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/sys-include -I/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libstdc++-v3/include/cris-elf -I/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libstdc++-v3/include -I/tmp/hpautotest-gcc1/gcc/libstdc++-v3/libsupc++ -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -g -O2 -c /tmp/hpautotest-gcc1/gcc/libstdc++-v3/src/ios-inst.cc -o ios-inst.o
In file included from /tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libstdc++-v3/include/ios:45,
                 from /tmp/hpautotest-gcc1/gcc/libstdc++-v3/src/ios-inst.cc:30:
/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libstdc++-v3/include/bits/basic_ios.h: In member function 'char std::basic_ios<_CharT, _Traits>::narrow(char_type, char) const [with _CharT = char, _Traits = std::char_traits<char>, char_type = char]':
/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libstdc++-v3/include/bits/basic_ios.h:420: internal compiler error: in emit_move_insn, at expr.c:3387
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[4]: *** [ios-inst.lo] Error 1
make[4]: Leaving directory `/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libstdc++-v3/src'

Authors of patches in suspect revision range CC:ed.
Preprocessed code will be attached momentarily.
Comment 1 Hans-Peter Nilsson 2009-04-27 07:05:23 UTC
Created attachment 17765 [details]
preprocessed, non-reduced

configure --target=cris-axis-elf --enable-languages=c++
make all-gcc
cc1plus -fpreprocessed ios-inst.ii -melf -quiet -dumpbase ios-inst.cc -auxbase-strip ios-inst.o -g -O2 -Wall -Wextra -Wwrite-strings -Wcast-qual -version -fno-implicit-templates -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -o ios-inst.s
Comment 2 Hans-Peter Nilsson 2009-04-27 07:07:22 UTC
I'm removing Honza from CC as the build also breaks with revision 146820.
Comment 3 Rainer Orth 2009-04-27 09:07:08 UTC
This seems to be the same error that breaks sparc-sun-solaris2.11 bootstrap while
building the stage1 libgcc:

% /vol/gccsrc/obj/gcc-4.5.0-200090427/11-gcc/./gcc/xgcc -B/vol/gccsrc/obj/gcc-4.5.0-200090427/11-gcc/./gcc/ -B/vol/gcc/sparc-sun-solaris2.11/bin/ -B/vol/gcc/sparc-sun-solaris2.11/lib/ -isystem /vol/gcc/sparc-sun-solaris2.11/include -isystem /vol/gcc/sparc-sun-solaris2.11/sys-include -g -O2 -m64 -O2  -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wold-style-definition  -isystem ./include  -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED   -I. -I. -I../../.././gcc -I/vol/gcc/src/gcc-dist/libgcc -I/vol/gcc/src/gcc-dist/libgcc/. -I/vol/gcc/src/gcc-dist/libgcc/../gcc -I/vol/gcc/src/gcc-dist/libgcc/../include  -DHAVE_CC_TLS -o _absvsi2.o -MT _absvsi2.o -MD -MP -MF _absvsi2.dep -DL_absvsi2 -c /vol/gcc/src/gcc-dist/libgcc/../gcc/libgcc2.c \
	  -fvisibility=hidden -DHIDE_EXPORTS
/vol/gcc/src/gcc-dist/libgcc/../gcc/libgcc2.c: In function '__absvsi2':
/vol/gcc/src/gcc-dist/libgcc/../gcc/libgcc2.c:240: internal compiler error: in emit_move_insn, at expr.c:3387
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[5]: *** [_absvsi2.o] Error 1

Reghunting will be difficult, though, since SPARC bootstrap was broken for some
time due to PR bootstrap/39645.
Comment 4 Eric Botcazou 2009-04-27 09:17:12 UTC
> Reghunting will be difficult, though, since SPARC bootstrap was broken for some
> time due to PR bootstrap/39645.

The revision corresponding to the fix for the PR should bootstrap.
Comment 5 Rainer Orth 2009-04-27 13:35:41 UTC
Subject: Re:  [4.5 Regression]: build breakage for cris-elf building libstdc++-v3

ebotcazou at gcc dot gnu dot org writes:

> The revision corresponding to the fix for the PR should bootstrap.

Indeed it does. Starting from there (and the fact that
insert_partition_copy_on_edge occurs in the cc1 stacktrace), I could
identify this patch as the culprit:

2009-04-26  Michael Matz  <matz@suse.de>

	Expand from SSA.

The ICE occurs while building the sparcv9 libgcc:

% cc1 libgcc2.i -mptr64 -mstack-bias -mno-v8plus -mcpu=v9 -m64 -auxbase-strip _absvsi2.o -O2 -fPIC
 __absvdi2 __absvsi2
Analyzing compilation unit
Performing interprocedural optimizations
 <visibility> <early_local_cleanups> <summary generate> <cp> <inline> <static-var> <pure-const>Assembling functions:
 __absvsi2
/vol/gcc/src/gcc-dist/libgcc/../gcc/libgcc2.c: In function '__absvsi2':
/vol/gcc/src/gcc-dist/libgcc/../gcc/libgcc2.c:240: internal compiler error: in emit_move_insn, at expr.c:3387

I get the following cc1 stacktrace:

Breakpoint 1, fancy_abort (file=0xdf8758 "/vol/gcc/src/gcc-dist/gcc/expr.c", line=3387, function=0xdf8af8 "emit_move_insn") at /vol/gcc/src/gcc-dist/gcc/diagnostic.c:724
(gdb) where
#0  fancy_abort (file=0xdf8758 "/vol/gcc/src/gcc-dist/gcc/expr.c", line=3387, function=0xdf8af8 "emit_move_insn") at /vol/gcc/src/gcc-dist/gcc/diagnostic.c:724
#1  0x003cbf18 in emit_move_insn (x=0xff0b3f80, y=0xff11a048) at /vol/gcc/src/gcc-dist/gcc/expr.c:3386
#2  0x00cfe0c4 in insert_partition_copy_on_edge (e=0xff1d09f0, dest=3, src=0) at /vol/gcc/src/gcc-dist/gcc/tree-outof-ssa.c:155
#3  0x00cfff0c in elim_create (g=0xf79ae0, T=3) at /vol/gcc/src/gcc-dist/gcc/tree-outof-ssa.c:542
#4  0x00d00434 in eliminate_phi (e=0xff1d09f0, g=0xf79ae0) at /vol/gcc/src/gcc-dist/gcc/tree-outof-ssa.c:583
#5  0x00d01480 in expand_phi_nodes (sa=0xf3bb5c) at /vol/gcc/src/gcc-dist/gcc/tree-outof-ssa.c:756
#6  0x00c129ac in gimple_expand_cfg () at /vol/gcc/src/gcc-dist/gcc/cfgexpand.c:2505
#7  0x00662284 in execute_one_pass (pass=0xe9c7f8) at /vol/gcc/src/gcc-dist/gcc/passes.c:1286
#8  0x00662638 in execute_pass_list (pass=0xe9c7f8) at /vol/gcc/src/gcc-dist/gcc/passes.c:1335
#9  0x00866fc4 in tree_rest_of_compilation (fndecl=0xff0dc180) at /vol/gcc/src/gcc-dist/gcc/tree-optimize.c:394
#10 0x00afe8a4 in cgraph_expand_function (node=0xfef8ea00) at /vol/gcc/src/gcc-dist/gcc/cgraphunit.c:1051
#11 0x00afeb40 in cgraph_expand_all_functions () at /vol/gcc/src/gcc-dist/gcc/cgraphunit.c:1110
#12 0x00aff39c in cgraph_optimize () at /vol/gcc/src/gcc-dist/gcc/cgraphunit.c:1324
#13 0x001267a8 in c_write_global_declarations () at /vol/gcc/src/gcc-dist/gcc/c-decl.c:8306
#14 0x007c4750 in compile_file () at /vol/gcc/src/gcc-dist/gcc/toplev.c:988
#15 0x007c7a5c in do_compile () at /vol/gcc/src/gcc-dist/gcc/toplev.c:2248
#16 0x007c7b80 in toplev_main (argc=11, argv=0xffbff604) at /vol/gcc/src/gcc-dist/gcc/toplev.c:2293
#17 0x00213aa4 in main (argc=11, argv=0xffbff604) at /vol/gcc/src/gcc-dist/gcc/main.c:35
Comment 6 Michael Matz 2009-04-27 13:45:09 UTC
That's indeed the same bug as on cris.  I'm working on a patch (it has to
do with promoted parameters).
Comment 7 Hans-Peter Nilsson 2009-04-27 21:26:14 UTC
The patch at <http://gcc.gnu.org/ml/gcc-patches/2009-04/msg02133.html> does indeed fix the build failures at r146820.
Now regtesting and also at r146851.  There's a build error in libgcc2 "In function '__udivdi3'" for that revision; it's uncertain whether the cause is the same or if that's fallout from Steven B's patch.
Comment 8 Hans-Peter Nilsson 2009-04-28 01:50:39 UTC
(In reply to comment #7)
> The patch at <http://gcc.gnu.org/ml/gcc-patches/2009-04/msg02133.html> does
> indeed fix the build failures at r146820.
> Now regtesting

The patch is not a *complete* success, as there's a regression:
Running /tmp/buildice5/gcc/gcc/testsuite/gcc.c-torture/unsorted/unsorted.exp ...
FAIL: gcc.c-torture/unsorted/charmtst.c,  -O1   (internal compiler error)
FAIL: gcc.c-torture/unsorted/charmtst.c,  -Os   (internal compiler error)

with the message in the log being the same as the build failure:

Executing on host: /tmp/buildice5/gccobj/gcc/xgcc -B/tmp/buildice5/gccobj/gcc/  -w  -O1   -c   -isystem /tmp/buildice5/gccobj/cris-elf/./newlib/targ-include -isystem /tmp/buildice5/gcc/newlib/libc/include  -o /tmp/buildice5/gccobj/gcc/testsuite/gcc/charmtst.o /tmp/buildice5/gcc/gcc/testsuite/gcc.c-torture/unsorted/charmtst.c    (timeout = 300)
/tmp/buildice5/gcc/gcc/testsuite/gcc.c-torture/unsorted/charmtst.c: In function 'c_move_tst':
/tmp/buildice5/gcc/gcc/testsuite/gcc.c-torture/unsorted/charmtst.c:1: internal compiler error: in emit_move_insn, at expr.c:3387
Comment 9 Hans-Peter Nilsson 2009-04-28 01:59:48 UTC
GDB backtrace for comment #8, after rm *.o; make all-gcc CFLAGS=-g:

#0  fancy_abort (file=0xd77ded "/tmp/buildice5/gcc/gcc/expr.c", line=3387, function=0xd78201 "emit_move_insn")
    at /tmp/buildice5/gcc/gcc/diagnostic.c:724
#1  0x00000000006721d6 in emit_move_insn (x=0x2aaaaabbfb00, y=0x2aaaaabbfc40) at /tmp/buildice5/gcc/gcc/expr.c:3386
#2  0x0000000000c9f5ac in insert_partition_copy_on_edge (e=0x2aaaaaaada00, dest=0, src=1)
    at /tmp/buildice5/gcc/gcc/tree-outof-ssa.c:155
#3  0x0000000000ca0d8d in elim_create (g=0x11a3590, T=0) at /tmp/buildice5/gcc/gcc/tree-outof-ssa.c:542
#4  0x0000000000ca126f in eliminate_phi (e=0x2aaaaaaada00, g=0x11a3590) at /tmp/buildice5/gcc/gcc/tree-outof-ssa.c:583
#5  0x0000000000ca1f51 in expand_phi_nodes (sa=0x115b520) at /tmp/buildice5/gcc/gcc/tree-outof-ssa.c:756
#6  0x0000000000c125c2 in gimple_expand_cfg () at /tmp/buildice5/gcc/gcc/cfgexpand.c:2507
#7  0x000000000085f950 in execute_one_pass (pass=0x111baa0) at /tmp/buildice5/gcc/gcc/passes.c:1286
#8  0x000000000085fb99 in execute_pass_list (pass=0x111baa0) at /tmp/buildice5/gcc/gcc/passes.c:1335
#9  0x00000000009a1eb7 in tree_rest_of_compilation (fndecl=0x2aaaaabbd100)
    at /tmp/buildice5/gcc/gcc/tree-optimize.c:394
#10 0x0000000000b81c72 in cgraph_expand_function (node=0x2aaaaabbd600) at /tmp/buildice5/gcc/gcc/cgraphunit.c:1051
#11 0x0000000000b81e25 in cgraph_expand_all_functions () at /tmp/buildice5/gcc/gcc/cgraphunit.c:1110
#12 0x0000000000b823ee in cgraph_optimize () at /tmp/buildice5/gcc/gcc/cgraphunit.c:1324
#13 0x00000000004873be in c_write_global_declarations () at /tmp/buildice5/gcc/gcc/c-decl.c:8306
#14 0x0000000000927838 in compile_file () at /tmp/buildice5/gcc/gcc/toplev.c:988
#15 0x0000000000929709 in do_compile () at /tmp/buildice5/gcc/gcc/toplev.c:2248
#16 0x00000000009297c9 in toplev_main (argc=14, argv=0x7fffaaa06e58) at /tmp/buildice5/gcc/gcc/toplev.c:2293
#17 0x0000000000538b3f in main (argc=14, argv=0x7fffaaa06e58) at /tmp/buildice5/gcc/gcc/main.c:35
(gdb) up
#1  0x00000000006721d6 in emit_move_insn (x=0x2aaaaabbfb00, y=0x2aaaaabbfc40) at /tmp/buildice5/gcc/gcc/expr.c:3386
3386      gcc_assert (mode != BLKmode
(gdb) p x
$1 = (rtx) 0x2aaaaabbfb00
(gdb) pr
(reg/v:QI 25 [ a ])
(gdb) p y
$2 = (rtx) 0x2aaaaabbfc40
(gdb) pr
(reg/v:SI 31 [ b ])

(the test-case is already as reduced as they get)
Comment 10 Michael Matz 2009-04-28 11:41:34 UTC
I see.  These are different base variables (a and b here), where my patch
doesn't help.  Andreas Krebbels patch should fix that, except there's still
some confusion in there, see http://gcc.gnu.org/ml/gcc-patches/2009-04/msg02124.html and
http://gcc.gnu.org/ml/gcc-patches/2009-04/msg02227.html .
Comment 11 Michael Matz 2009-04-29 17:37:01 UTC
Subject: Bug 39927

Author: matz
Date: Wed Apr 29 17:36:21 2009
New Revision: 146982

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146982
Log:
        PR middle-end/39927
        PR bootstrap/39929
        * tree-outof-ssa.c (emit_partition_copy): New function.
        (insert_partition_copy_on_edge, insert_rtx_to_part_on_edge,
        insert_part_to_rtx_on_edge): Perform the partition base var
        copy using emit_partition_copy.
        (insert_value_copy_on_edge): Convert constants to the right mode.
        (insert_rtx_to_part_on_edge): Add UNSIGNEDSRCP parameter.
        (elim_create): Pass the sign of the src to insert_rtx_to_part_on_edge.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-outof-ssa.c

Comment 12 Mark Mitchell 2009-05-05 16:09:08 UTC
HP, is this still a problem?
Comment 13 Hans-Peter Nilsson 2009-05-06 05:06:32 UTC
(In reply to comment #12)
> HP, is this still a problem?

No, I guess Matz just forgot to close it.  Done.