[Bug middle-end/46518] internal compiler error: in vinsn_detach, at sel-sched-ir.c:1271

2011-04-07 Thread abel at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46518

--- Comment #15 from Andrey Belevantsev abel at gcc dot gnu.org 2011-04-07 
06:52:33 UTC ---
Author: abel
Date: Thu Apr  7 06:52:29 2011
New Revision: 172079

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=172079
Log:
Backport from mainline
2010-11-18  Alexander Monakov  amona...@ispras.ru

PR middle-end/46518
* sel-sched-ir.c (init_expr): Use the correct type for
target_available.
* sel-sched.c (fill_vec_av_set): Use explicitly signed char type.


Modified:
branches/gcc-4_5-branch/gcc/ChangeLog
branches/gcc-4_5-branch/gcc/sel-sched-ir.c
branches/gcc-4_5-branch/gcc/sel-sched.c


[Bug middle-end/46518] internal compiler error: in vinsn_detach, at sel-sched-ir.c:1271

2010-11-18 Thread amonakov at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46518

--- Comment #13 from Alexander Monakov amonakov at gcc dot gnu.org 2010-11-18 
10:24:38 UTC ---
Author: amonakov
Date: Thu Nov 18 10:24:31 2010
New Revision: 166898

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=166898
Log:
PR middle-end/46518
* sel-sched-ir.c (init_expr): Use the correct type for
target_available.
* sel-sched.c (fill_vec_av_set): Use explicitly signed char type.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/sel-sched-ir.c
trunk/gcc/sel-sched.c


[Bug middle-end/46518] internal compiler error: in vinsn_detach, at sel-sched-ir.c:1271

2010-11-18 Thread amonakov at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46518

Alexander Monakov amonakov at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #14 from Alexander Monakov amonakov at gcc dot gnu.org 2010-11-18 
10:26:42 UTC ---
Fixed.


[Bug middle-end/46518] internal compiler error: in vinsn_detach, at sel-sched-ir.c:1271

2010-11-17 Thread amonakov at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46518

Alexander Monakov amonakov at gcc dot gnu.org changed:

   What|Removed |Added

 CC||amonakov at gcc dot gnu.org

--- Comment #1 from Alexander Monakov amonakov at gcc dot gnu.org 2010-11-17 
14:51:24 UTC ---
Do you know whether this is present on x86_64-linux?


[Bug middle-end/46518] internal compiler error: in vinsn_detach, at sel-sched-ir.c:1271

2010-11-17 Thread howarth at nitro dot med.uc.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46518

--- Comment #2 from Jack Howarth howarth at nitro dot med.uc.edu 2010-11-17 
14:52:42 UTC ---
Only occurs for -fPIC on x86_64-apple-darwin10. Adding -fno-PIC on darwin
suppresses the ICE.


[Bug middle-end/46518] internal compiler error: in vinsn_detach, at sel-sched-ir.c:1271

2010-11-17 Thread howarth at nitro dot med.uc.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46518

--- Comment #3 from Jack Howarth howarth at nitro dot med.uc.edu 2010-11-17 
15:11:53 UTC ---
(In reply to comment #1)
 Do you know whether this is present on x86_64-linux?

I am unable to do a --enable-build-with-cxx bootstrap using...

http://gcc.gnu.org/ml/gcc-patches/2010-11/msg01323.html

on x86_64 Fedora10. The bootstrap still fails there with...

g++  -g -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual
-Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H  -o lto1 \
lto/lto-lang.o lto/lto.o lto/lto-object.o attribs.o main.o
tree-browser.o libbackend.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a
-lcloog -lppl_c -lppl -lgmpxx -L/usr/lib -L/usr/lib -L/usr/lib -lmpc -lmpfr
-lgmp -rdynamic -ldl  -L../zlib -lz ../libcpp/libcpp.a  
../libiberty/libiberty.a ../libdecnumber/libdecnumber.a 
ld: crtbegin.o: No such file: No such file or directory
make[3]: *** [lto1] Error 1


[Bug middle-end/46518] internal compiler error: in vinsn_detach, at sel-sched-ir.c:1271

2010-11-17 Thread amonakov at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46518

--- Comment #4 from Alexander Monakov amonakov at gcc dot gnu.org 2010-11-17 
15:29:33 UTC ---
(In reply to comment #2)
 Only occurs for -fPIC on x86_64-apple-darwin10. Adding -fno-PIC on darwin
 suppresses the ICE.

Is that in relation to bootstrap flags?  There's no PIC flags in the original
report.

The breakage is rather curious.  Build-with-CXX should not cause code
generation differences.  Can you please build normally-bootstrapped compiler
from the same source, build the testcase with the two compilers appending
-fdump-tree-all -fdump-rtl-all and attach the two series of dumps?


[Bug middle-end/46518] internal compiler error: in vinsn_detach, at sel-sched-ir.c:1271

2010-11-17 Thread howarth at nitro dot med.uc.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46518

--- Comment #5 from Jack Howarth howarth at nitro dot med.uc.edu 2010-11-17 
15:33:35 UTC ---
(In reply to comment #4)
 (In reply to comment #2)
  Only occurs for -fPIC on x86_64-apple-darwin10. Adding -fno-PIC on darwin
  suppresses the ICE.
 
 Is that in relation to bootstrap flags?  There's no PIC flags in the original
 report.
 

Darwin defaults to -fPIC unlike other targets.


[Bug middle-end/46518] internal compiler error: in vinsn_detach, at sel-sched-ir.c:1271

2010-11-17 Thread howarth at nitro dot med.uc.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46518

--- Comment #6 from Jack Howarth howarth at nitro dot med.uc.edu 2010-11-17 
15:44:38 UTC ---
(In reply to comment #4)
 (In reply to comment #2)
  Only occurs for -fPIC on x86_64-apple-darwin10. Adding -fno-PIC on darwin
  suppresses the ICE.
 
 Is that in relation to bootstrap flags?  There's no PIC flags in the original
 report.
 
 The breakage is rather curious.  Build-with-CXX should not cause code
 generation differences.  Can you please build normally-bootstrapped compiler
 from the same source, build the testcase with the two compilers appending
 -fdump-tree-all -fdump-rtl-all and attach the two series of dumps?

Under x86_64 Fedora 10 using...

../gcc/configure --with-gmp=/usr --with-mpfr=/usr --with-mpc=/usr
--prefix=/home/howarth/dist --enable-languages=c,c++,fortran
--enable-build-with-cxx --disable-lto --disable-bootstrap

I get a slightly different crash (which might not be surprising since the
compiler isn't built entirely with -fPIC like on darwin).

Executing on host: /home/howarth/work/gcc/testsuite/gfortran/../../gfortran
-B/home/howarth/work/gcc/testsuite/gfortran/../../
-L/home/howarth/work/x86_64-unknown-linux-gnu/32/libgfor
tran /home/howarth/gcc/gcc/testsuite/gfortran.dg/pr42294.f   -O  -O2
-fselective-scheduling2 -fsel-sched-pipelining -funroll-all-loops -S  -m32 -o
pr42294.s(timeout = 300)
/home/howarth/gcc/gcc/testsuite/gfortran.dg/pr42294.f: In function 'orien':
/home/howarth/gcc/gcc/testsuite/gfortran.dg/pr42294.f:39:0: internal compiler
error: Segmentation fault


[Bug middle-end/46518] internal compiler error: in vinsn_detach, at sel-sched-ir.c:1271

2010-11-17 Thread howarth at nitro dot med.uc.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46518

--- Comment #7 from Jack Howarth howarth at nitro dot med.uc.edu 2010-11-17 
16:22:20 UTC ---
Under x86_64 Fedora, when built with...

../gcc/configure --with-gmp=/usr --with-mpfr=/usr --with-mpc=/usr
--prefix=/home/howarth/dist --enable-languages=c,c++,fortran
--enable-build-with-cxx --disable-lto

I get failure...

Executing on host: /home/howarth/work/gcc/testsuite/gfortran/../../gfortran
-B/home/howarth/work/gcc/testsuite/gfortran/../../
-L/home/howarth/work/x86_64-unknown-linux-gnu/32/libgfor
tran /home/howarth/gcc/gcc/testsuite/gfortran.dg/pr42294.f   -O  -O2
-fselective-scheduling2 -fsel-sched-pipelining -funroll-all-loops -S  -m32 -o
pr42294.s(timeout = 300)
/home/howarth/gcc/gcc/testsuite/gfortran.dg/pr42294.f: In function 'orien':
/home/howarth/gcc/gcc/testsuite/gfortran.dg/pr42294.f:39:0: internal compiler
error: Segmentation fault

This backtraces as...


gdb /home/howarth/work/gcc/testsuite/gfortran/../../f951
GNU gdb Fedora (6.8-32.fc10)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as x86_64-redhat-linux-gnu...
(gdb) r /home/howarth/gcc/gcc/testsuite/gfortran.dg/pr42294.f -ffixed-form
-quiet -dumpbase pr42294.f -m32 -mtune=generic -march=x86-64 -auxbase-strip
pr42294.s -O -O2 -version -fselective-scheduling2 -fsel-sched-pipelining
-funroll-all-loops -o pr42294.s -fintrinsic-modules-path finclude
Starting program: /home/howarth/work/gcc/f951
/home/howarth/gcc/gcc/testsuite/gfortran.dg/pr42294.f -ffixed-form -quiet
-dumpbase pr42294.f -m32 -mtune=generic -march=x86-64 -auxbase-strip pr42294.s
-O -O2 -version -fselective-scheduling2 -fsel-sched-pipelining
-funroll-all-loops -o pr42294.s -fintrinsic-modules-path finclude
GNU Fortran (GCC) version 4.6.0 20101117 (experimental)
(x86_64-unknown-linux-gnu)
compiled by GNU C version 4.6.0 20101117 (experimental), GMP version 4.2.2,
MPFR version 2.3.2, MPC version 0.8
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU Fortran (GCC) version 4.6.0 20101117 (experimental)
(x86_64-unknown-linux-gnu)
compiled by GNU C version 4.6.0 20101117 (experimental), GMP version 4.2.2,
MPFR version 2.3.2, MPC version 0.8
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

Program received signal SIGSEGV, Segmentation fault.
vinsn_detach (vi=0x0) at ../../gcc/gcc/sel-sched-ir.c:1271
1271  gcc_assert (VINSN_COUNT (vi)  0);
Current language:  auto; currently c++
Missing separate debuginfos, use: debuginfo-install
cloog-ppl-0.15.8-2f10.x86_64 gmp-4.2.2-8.fc10.x86_64 libgcc-4.3.2-7.x86_64
libmpc-0.8-3.fc10.x86_64 libstdc++-4.3.2-7.x86_64 mpfr-2.3.2-1.fc10.x86_64
ppl-0.10.2-6.fc10.x86_64
(gdb) bt
#0  vinsn_detach (vi=0x0) at ../../gcc/gcc/sel-sched-ir.c:1271
#1  0x00823e6c in clear_expr (expr=0x7fffdcd0) at
../../gcc/gcc/sel-sched-ir.c:1864
#2  0x00839bc6 in schedule_expr_on_boundary (bnd=value optimized out,
expr_vliw=0x15173c0, seqno=-1) at ../../gcc/gcc/sel-sched.c:5435
#3  0x0083aa1c in fill_insns (scheduled_insns_tailpp=Unhandled dwarf
expression opcode 0xf2
) at ../../gcc/gcc/sel-sched.c:5576
#4  schedule_on_fences (scheduled_insns_tailpp=Unhandled dwarf expression
opcode 0xf2
) at ../../gcc/gcc/sel-sched.c:7298
#5  sel_sched_region_2 (orig_max_seqno=51) at ../../gcc/gcc/sel-sched.c:7432
#6  0x0083e30f in sel_sched_region_1 () at
../../gcc/gcc/sel-sched.c:7476
#7  sel_sched_region (rgn=value optimized out) at
../../gcc/gcc/sel-sched.c:7575
#8  0x014cd7e0 in ?? ()
#9  0x01f8 in ?? ()
#10 0x0100 in ?? ()
#11 0x014cd7f0 in ?? ()
#12 0x0200 in ?? ()
#13 0x003099a7bfc7 in _int_realloc (av=0x101010101010101, oldmem=0x1,
bytes=value optimized out) at malloc.c:5083
#14 0x003099a7cfbe in __libc_realloc (oldmem=0x14bfd90, bytes=504) at
malloc.c:3708
#15 0x005b8137 in bitmap_copy (to=0x12f6001, from=0x1f8) at
../../gcc/gcc/bitmap.c:517
#16 0x0034 in ?? ()
#17 0xfff8 in ?? ()
#18 0x in ?? ()


[Bug middle-end/46518] internal compiler error: in vinsn_detach, at sel-sched-ir.c:1271

2010-11-17 Thread howarth at nitro dot med.uc.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46518

--- Comment #8 from Jack Howarth howarth at nitro dot med.uc.edu 2010-11-17 
16:37:14 UTC ---
Backtraces as...

gdb /sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/./gcc/cc1
...
(gdb) r -quiet -v -I . -I ../../../gcc-4.6-20101117/libgomp -I
../../../gcc-4.6-20101117/libgomp/config/bsd -I
../../../gcc-4.6-20101117/libgomp/config/posix -I
../../../gcc-4.6-20101117/libgomp -iprefix
/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/gcc/../lib/gcc/x86_64-apple-darwin10.5.0/4.6.0/
-isystem /sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/./gcc/include
-isystem /sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/./gcc/include-fixed
-MD .libs/barrier.d -MF .deps/barrier.Tpo -MP -MT barrier.lo -D__DYNAMIC__
-D_REENTRANT -D HAVE_CONFIG_H -D PIC -isystem
/sw/lib/gcc4.6/x86_64-apple-darwin10.5.0/include -isystem
/sw/lib/gcc4.6/x86_64-apple-darwin10.5.0/sys-include
../../../gcc-4.6-20101117/libgomp/barrier.c -fPIC
-feliminate-unused-debug-symbols -quiet -dumpbase barrier.c
-mmacosx-version-min=10.6.5 -mtune=generic -auxbase-strip .libs/barrier.o -g
-O2 -Wall -Werror -version -fno-common -o /var/tmp//cckhMI20.s
...

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x
0x0001009e08b2 in gen_emutls_addr (decl=0x14340a8c0, d=0x7fff5fbfe650) at
../../gcc-4.6-20101117/gcc/tree-emutls.c:418
418  cdecl = cvar-decl;
(gdb) bt
#0  0x0001009e08b2 in gen_emutls_addr (decl=0x14340a8c0, d=0x7fff5fbfe650)
at ../../gcc-4.6-20101117/gcc/tree-emutls.c:418
#1  0x0001009e1181 in lower_emutls_1 (ptr=0x1434d86a8,
walk_subtrees=0x7fff5fbfdd9c, cb_data=0x7fff5fbfe5a0) at
../../gcc-4.6-20101117/gcc/tree-emutls.c:527
#2  0x000100c29101 in walk_tree_1 (tp=0x1434d86a8, func=0x1009e0d5e
lower_emutls_1, data=0x7fff5fbfe5a0, pset=0x0, lh=0) at
../../gcc-4.6-20101117/gcc/tree.c:10241
#3  0x000100c2b9b5 in walk_tree_1 (tp=0x1434d86e8, func=0x1009e0d5e
lower_emutls_1, data=0x7fff5fbfe5a0, pset=0x0, lh=0) at
../../gcc-4.6-20101117/gcc/tree.c:10490
#4  0x000100c2b9b5 in walk_tree_1 (tp=0x1434ff688, func=0x1009e0d5e
lower_emutls_1, data=0x7fff5fbfe5a0, pset=0x0, lh=0) at
../../gcc-4.6-20101117/gcc/tree.c:10490
#5  0x0001006960b8 in walk_gimple_op (stmt=0x1434ff640,
callback_op=0x1009e0d5e lower_emutls_1, wi=0x7fff5fbfe5a0) at
../../gcc-4.6-20101117/gcc/gimple.c:1361
#6  0x0001009e1468 in lower_emutls_stmt (stmt=0x1434ff640,
d=0x7fff5fbfe650) at ../../gcc-4.6-20101117/gcc/tree-emutls.c:557
#7  0x0001009e1a1f in lower_emutls_function_body (node=0x1434d7dc0) at
../../gcc-4.6-20101117/gcc/tree-emutls.c:663
#8  0x0001009e2318 in ipa_lower_emutls () at
../../gcc-4.6-20101117/gcc/tree-emutls.c:765
#9  0x00010084eed2 in execute_one_pass (pass=0x1010ab3a0) at
../../gcc-4.6-20101117/gcc/passes.c:1564
#10 0x00010084fee3 in execute_ipa_pass_list (pass=0x1010ab3a0) at
../../gcc-4.6-20101117/gcc/passes.c:1931
#11 0x000100cdf555 in ipa_passes () at
../../gcc-4.6-20101117/gcc/cgraphunit.c:1696
#12 0x000100cdf738 in cgraph_optimize () at
../../gcc-4.6-20101117/gcc/cgraphunit.c:1765
#13 0x000100cdcad5 in cgraph_finalize_compilation_unit () at
../../gcc-4.6-20101117/gcc/cgraphunit.c:1017
#14 0x000100030c41 in c_write_global_declarations () at
../../gcc-4.6-20101117/gcc/c-decl.c:9837
#15 0x000100969368 in compile_file () at
../../gcc-4.6-20101117/gcc/toplev.c:882
#16 0x00010096c470 in do_compile () at
../../gcc-4.6-20101117/gcc/toplev.c:2313
#17 0x00010096c5b8 in toplev_main (argc=54, argv=0x7fff5fbfe950) at
../../gcc-4.6-20101117/gcc/toplev.c:2374
#18 0x000100115548 in main (argc=54, argv=0x7fff5fbfe950) at
../../gcc-4.6-20101117/gcc/main.c:36


[Bug middle-end/46518] internal compiler error: in vinsn_detach, at sel-sched-ir.c:1271

2010-11-17 Thread howarth at nitro dot med.uc.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46518

--- Comment #9 from Jack Howarth howarth at nitro dot med.uc.edu 2010-11-17 
16:38:11 UTC ---
sorry...comment 8 ended up in the wrong PR


[Bug middle-end/46518] internal compiler error: in vinsn_detach, at sel-sched-ir.c:1271

2010-11-17 Thread amonakov at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46518

Alexander Monakov amonakov at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2010.11.17 18:18:14
 AssignedTo|unassigned at gcc dot   |amonakov at gcc dot gnu.org
   |gnu.org |
 Ever Confirmed|0   |1

--- Comment #10 from Alexander Monakov amonakov at gcc dot gnu.org 2010-11-17 
18:18:14 UTC ---
Thanks.

diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index e169276..71c02c4 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -1595,7 +1595,7 @@ static void
 init_expr (expr_t expr, vinsn_t vi, int spec, int use, int priority,
   int sched_times, int orig_bb_index, ds_t spec_done_ds,
   ds_t spec_to_check_ds, int orig_sched_cycle,
-  VEC(expr_history_def, heap) *history, bool target_available,
+  VEC(expr_history_def, heap) *history, signed char target_available,
bool was_substituted, bool was_renamed, bool needs_spec_check_p,
bool cant_move)
 {


[Bug middle-end/46518] internal compiler error: in vinsn_detach, at sel-sched-ir.c:1271

2010-11-17 Thread howarth at nitro dot med.uc.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46518

--- Comment #11 from Jack Howarth howarth at nitro dot med.uc.edu 2010-11-17 
19:26:31 UTC ---
(In reply to comment #10)
 Thanks.
 
 diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
 index e169276..71c02c4 100644
 --- a/gcc/sel-sched-ir.c
 +++ b/gcc/sel-sched-ir.c
 @@ -1595,7 +1595,7 @@ static void
  init_expr (expr_t expr, vinsn_t vi, int spec, int use, int priority,
int sched_times, int orig_bb_index, ds_t spec_done_ds,
ds_t spec_to_check_ds, int orig_sched_cycle,
 -  VEC(expr_history_def, heap) *history, bool target_available,
 +  VEC(expr_history_def, heap) *history, signed char target_available,
 bool was_substituted, bool was_renamed, bool needs_spec_check_p,
 bool cant_move)
  {

I can confirm that this eliminates the ICE (segfault) during the compilation of
gfortran.dg/pr42294.f on x86_64 Fedora10. Will test x86_64-apple-darwin10 next.


[Bug middle-end/46518] internal compiler error: in vinsn_detach, at sel-sched-ir.c:1271

2010-11-17 Thread howarth at nitro dot med.uc.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46518

--- Comment #12 from Jack Howarth howarth at nitro dot med.uc.edu 2010-11-17 
20:34:15 UTC ---
I can also confirm that the patch in Comment 10 eliminates the ICE in compiling
gfortran.dg/pr42294.f  -O on x86_64-apple-darwin10 (bootstrapped with
--enable-build-with-cxx) as well. Thanks.