[Bug middle-end/39308] ICE when compiling with -O[s123] -floop-interchange

2009-02-27 Thread spop at gcc dot gnu dot org


--- Comment #14 from spop at gcc dot gnu dot org  2009-02-27 16:42 ---
Subject: Bug 39308

Author: spop
Date: Fri Feb 27 16:42:38 2009
New Revision: 144470

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=144470
Log:
2009-02-27  Sebastian Pop  sebastian@amd.com

PR middle-end/39308
* graphite.c (graphite_loop_normal_form): Do not call 
number_of_iterations_exit from a gcc_assert.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/graphite.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39308



[Bug middle-end/39308] ICE when compiling with -O[s123] -floop-interchange

2009-02-27 Thread spop at gcc dot gnu dot org


--- Comment #15 from spop at gcc dot gnu dot org  2009-02-27 16:43 ---
Fixed.


-- 

spop at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39308



[Bug middle-end/39308] ICE when compiling with -O[s123] -floop-interchange

2009-02-26 Thread rguenth at gcc dot gnu dot org


--- Comment #2 from rguenth at gcc dot gnu dot org  2009-02-26 10:05 ---
Works for me.  What is the ICE?


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39308



[Bug middle-end/39308] ICE when compiling with -O[s123] -floop-interchange

2009-02-26 Thread il dot basso dot buffo at gmail dot com


--- Comment #3 from il dot basso dot buffo at gmail dot com  2009-02-26 
14:27 ---
$ gcc -O1 -floop-interchange -c huffman.c.pre

huffman.c: In function 'BZ2_hbCreateDecodeTables':
huffman.c:170: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.

$ gcc -v
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-4.4.0_pre/work/gcc-4.4.0-/configure
--prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.0-pre
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.0-pre/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.4.0-pre
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.4.0-pre/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.4.0-pre/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.0-pre/include/g++-v4
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec
--disable-fixed-point --enable-nls --without-included-gettext
--with-system-zlib --disable-checking --disable-werror --enable-secureplt
--enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp
--enable-cld --disable-libgcj --enable-languages=c,c++,fortran --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo SVN' --with-ppl
--with-cloog
Thread model: posix
gcc version 4.4.0-pre built 20090225 (experimental) rev. 144432 (Gentoo
SVN)

I tried incrementally adding each optimization option flag that 'man gcc' says
-O1 enables, but got a clean compile each time. Only with -O1 does the segfault
get triggered.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39308



[Bug middle-end/39308] ICE when compiling with -O[s123] -floop-interchange

2009-02-26 Thread rguenth at gcc dot gnu dot org


--- Comment #4 from rguenth at gcc dot gnu dot org  2009-02-26 14:40 ---
Still works for me.  I suggest you file a bug with Gentoo, they may have local
patches applied.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39308



[Bug middle-end/39308] ICE when compiling with -O[s123] -floop-interchange

2009-02-26 Thread il dot basso dot buffo at gmail dot com


--- Comment #5 from il dot basso dot buffo at gmail dot com  2009-02-26 
17:00 ---
Vanilla SVN, no patching. Still getting ICE segfault.

./configure --prefix=/usr/local
--bindir=/usr/local/x86_64-pc-linux-gnu/gcc-bin/4.4.0-pre
--includedir=/usr/local/lib/gcc/x86_64-pc-linux-gnu/4.4.0-pre/include
--datadir=/usr/local/share/gcc-data/x86_64-pc-linux-gnu/4.4.0-pre
--mandir=/usr/local/share/gcc-data/x86_64-pc-linux-gnu/4.4.0-pre/man
--infodir=/usr/local/share/gcc-data/x86_64-pc-linux-gnu/4.4.0-pre/info
--with-gxx-include-dir=/usr/local/lib/gcc/x86_64-pc-linux-gnu/4.4.0-pre/include/g++-v4
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point
--enable-nls --without-included-gettext --with-system-zlib --disable-checking
--disable-werror --enable-secureplt --enable-multilib --enable-libmudflap
--disable-libssp --enable-libgomp --enable-cld --disable-libgcj
--enable-languages=c --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --with-pkgversion=SVN --with-ppl
--with-cloog
$ make  make install

$ /usr/local/x86_64-pc-linux-gnu/gcc-bin/4.4.0-pre/gcc -v
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with: ./configure --prefix=/usr/local
--bindir=/usr/local/x86_64-pc-linux-gnu/gcc-bin/4.4.0-pre
--includedir=/usr/local/lib/gcc/x86_64-pc-linux-gnu/4.4.0-pre/include
--datadir=/usr/local/share/gcc-data/x86_64-pc-linux-gnu/4.4.0-pre
--mandir=/usr/local/share/gcc-data/x86_64-pc-linux-gnu/4.4.0-pre/man
--infodir=/usr/local/share/gcc-data/x86_64-pc-linux-gnu/4.4.0-pre/info
--with-gxx-include-dir=/usr/local/lib/gcc/x86_64-pc-linux-gnu/4.4.0-pre/include/g++-v4
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point
--enable-nls --without-included-gettext --with-system-zlib --disable-checking
--disable-werror --enable-secureplt --enable-multilib --enable-libmudflap
--disable-libssp --enable-libgomp --enable-cld --disable-libgcj
--enable-languages=c --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --with-pkgversion=SVN --with-ppl
--with-cloog
Thread model: posix
gcc version 4.4.0 20090225 (experimental) (SVN)

$ /usr/local/x86_64-pc-linux-gnu/gcc-bin/4.4.0-pre/gcc -O1
-floop-interchange -c huffman.c.pre
huffman.c: In function 'BZ2_hbCreateDecodeTables':
huffman.c:170: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39308



[Bug middle-end/39308] ICE when compiling with -O[s123] -floop-interchange

2009-02-26 Thread il dot basso dot buffo at gmail dot com


--- Comment #6 from il dot basso dot buffo at gmail dot com  2009-02-26 
18:53 ---
Richard, can you post your `gcc -v` so I can make sure my config options are
the same as yours?  Also, are you using cloog-ppl from git?  I am using 0.15
from ftp://gcc.gnu.org/pub/gcc/infrastructure/ .


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39308



[Bug middle-end/39308] ICE when compiling with -O[s123] -floop-interchange

2009-02-26 Thread spop at gcc dot gnu dot org


--- Comment #7 from spop at gcc dot gnu dot org  2009-02-26 19:20 ---
Your testcase works for me too on trunk rev 144404.

I suggest that you do the following:

$ gdb build/gcc/cc1
(gdb) run -O2 -floop-interchange .../huffman.c.pre
...
(gdb) bt

and report the backtrace you get on the ICE.

Sebastian


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39308



[Bug middle-end/39308] ICE when compiling with -O[s123] -floop-interchange

2009-02-26 Thread spop at gcc dot gnu dot org


--- Comment #8 from spop at gcc dot gnu dot org  2009-02-26 19:22 ---
I tried with the following compiler:

$ ./xgcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --enable-languages=c,fortran --disable-bootstrap
: (reconfigured)  : (reconfigured) 
Thread model: posix
gcc version 4.4.0 20090224 (experimental) (GCC) 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39308



[Bug middle-end/39308] ICE when compiling with -O[s123] -floop-interchange

2009-02-26 Thread il dot basso dot buffo at gmail dot com


--- Comment #9 from il dot basso dot buffo at gmail dot com  2009-02-26 
19:46 ---
Thanks, Sebastian.  I followed your directions, except I used -O1 instead of
-O2. Here's the backtrace:

#0  is_gimple_val (t=0x0) at ../.././gcc/gimple.c:2853
#1  0x0055dec4 in force_gimple_operand (expr=0x0, stmts=0x7fffdc78a538,
simple=1 '\001', var=0x0) at ../.././gcc/gimplify.c:7592
#2  0x0097fc22 in build_scop_loop_nests (scop=0x12ce530) at
../.././gcc/graphite.c:2387
#3  0x00981f1a in limit_scops () at ../.././gcc/graphite.c:6081
#4  0x00983de7 in graphite_transform_loops () at
../.././gcc/graphite.c:6124
#5  0x006cd137 in graphite_transforms () at
../.././gcc/tree-ssa-loop.c:298
#6  0x005b87ca in execute_one_pass (pass=0xe8ab60) at
../.././gcc/passes.c:1277
#7  0x005b89b0 in execute_pass_list (pass=0xe8ab60) at
../.././gcc/passes.c:1326
#8  0x005b89c5 in execute_pass_list (pass=0xe8a8c0) at
../.././gcc/passes.c:1327
#9  0x005b89c5 in execute_pass_list (pass=0xe89d80) at
../.././gcc/passes.c:1327
#10 0x00678bca in tree_rest_of_compilation (fndecl=0x7fbcd2977100) at
../.././gcc/tree-optimize.c:420
#11 0x00789665 in cgraph_expand_function (node=0x7fbcd2977700) at
../.././gcc/cgraphunit.c:1047
#12 0x0078ab00 in cgraph_optimize () at ../.././gcc/cgraphunit.c:1106
#13 0x00413dcb in c_write_global_declarations () at
../.././gcc/c-decl.c:8102
#14 0x0064301e in toplev_main (argc=value optimized out, argv=value
optimized out) at ../.././gcc/toplev.c:981
#15 0x7fbcd315c60d in __libc_start_main () from /lib/libc.so.6
#16 0x00405229 in _start ()


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39308



Re: [Bug middle-end/39308] ICE when compiling with -O[s123] -floop-interchange

2009-02-26 Thread Sebastian Pop
Hi,

Can you try this patch.  It should fix your problem.  I will bootstrap
and test the
patch and send it for review.

Thanks,
Sebastian Pop
--
AMD - GNU Tools



On Thu, Feb 26, 2009 at 13:46, il dot basso dot buffo at gmail dot com
gcc-bugzi...@gcc.gnu.org wrote:


 --- Comment #9 from il dot basso dot buffo at gmail dot com  2009-02-26 
 19:46 ---
 Thanks, Sebastian.  I followed your directions, except I used -O1 instead of
 -O2. Here's the backtrace:

 #0  is_gimple_val (t=0x0) at ../.././gcc/gimple.c:2853
 #1  0x0055dec4 in force_gimple_operand (expr=0x0, 
 stmts=0x7fffdc78a538,
 simple=1 '\001', var=0x0) at ../.././gcc/gimplify.c:7592
 #2  0x0097fc22 in build_scop_loop_nests (scop=0x12ce530) at
 ../.././gcc/graphite.c:2387
 #3  0x00981f1a in limit_scops () at ../.././gcc/graphite.c:6081
 #4  0x00983de7 in graphite_transform_loops () at
 ../.././gcc/graphite.c:6124
 #5  0x006cd137 in graphite_transforms () at
 ../.././gcc/tree-ssa-loop.c:298
 #6  0x005b87ca in execute_one_pass (pass=0xe8ab60) at
 ../.././gcc/passes.c:1277
 #7  0x005b89b0 in execute_pass_list (pass=0xe8ab60) at
 ../.././gcc/passes.c:1326
 #8  0x005b89c5 in execute_pass_list (pass=0xe8a8c0) at
 ../.././gcc/passes.c:1327
 #9  0x005b89c5 in execute_pass_list (pass=0xe89d80) at
 ../.././gcc/passes.c:1327
 #10 0x00678bca in tree_rest_of_compilation (fndecl=0x7fbcd2977100) at
 ../.././gcc/tree-optimize.c:420
 #11 0x00789665 in cgraph_expand_function (node=0x7fbcd2977700) at
 ../.././gcc/cgraphunit.c:1047
 #12 0x0078ab00 in cgraph_optimize () at ../.././gcc/cgraphunit.c:1106
 #13 0x00413dcb in c_write_global_declarations () at
 ../.././gcc/c-decl.c:8102
 #14 0x0064301e in toplev_main (argc=value optimized out, argv=value
 optimized out) at ../.././gcc/toplev.c:981
 #15 0x7fbcd315c60d in __libc_start_main () from /lib/libc.so.6
 #16 0x00405229 in _start ()


 --


 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39308


Index: graphite.c
===
--- graphite.c	(revision 144404)
+++ graphite.c	(working copy)
@@ -2382,8 +2382,10 @@ graphite_loop_normal_form (loop_p loop)
   tree nit;
   gimple_seq stmts;
   edge exit = single_dom_exit (loop);
+  bool known_niter = number_of_iterations_exit (loop, exit, niter, false);
+
+  gcc_assert (known_niter);
 
-  gcc_assert (number_of_iterations_exit (loop, exit, niter, false));
   nit = force_gimple_operand (unshare_expr (niter.niter), stmts, true,
 			  NULL_TREE);
   if (stmts)


[Bug middle-end/39308] ICE when compiling with -O[s123] -floop-interchange

2009-02-26 Thread sebpop at gmail dot com


--- Comment #10 from sebpop at gmail dot com  2009-02-26 20:10 ---
Subject: Re:  ICE when compiling with -O[s123] 
-floop-interchange

Hi,

Can you try this patch.  It should fix your problem.  I will bootstrap
and test the
patch and send it for review.

Thanks,
Sebastian Pop
--
AMD - GNU Tools



On Thu, Feb 26, 2009 at 13:46, il dot basso dot buffo at gmail dot com
gcc-bugzi...@gcc.gnu.org wrote:


 --- Comment #9 from il dot basso dot buffo at gmail dot com  2009-02-26 
 19:46 ---
 Thanks, Sebastian.  I followed your directions, except I used -O1 instead of
 -O2. Here's the backtrace:

 #0  is_gimple_val (t=0x0) at ../.././gcc/gimple.c:2853
 #1  0x0055dec4 in force_gimple_operand (expr=0x0, 
 stmts=0x7fffdc78a538,
 simple=1 '\001', var=0x0) at ../.././gcc/gimplify.c:7592
 #2  0x0097fc22 in build_scop_loop_nests (scop=0x12ce530) at
 ../.././gcc/graphite.c:2387
 #3  0x00981f1a in limit_scops () at ../.././gcc/graphite.c:6081
 #4  0x00983de7 in graphite_transform_loops () at
 ../.././gcc/graphite.c:6124
 #5  0x006cd137 in graphite_transforms () at
 ../.././gcc/tree-ssa-loop.c:298
 #6  0x005b87ca in execute_one_pass (pass=0xe8ab60) at
 ../.././gcc/passes.c:1277
 #7  0x005b89b0 in execute_pass_list (pass=0xe8ab60) at
 ../.././gcc/passes.c:1326
 #8  0x005b89c5 in execute_pass_list (pass=0xe8a8c0) at
 ../.././gcc/passes.c:1327
 #9  0x005b89c5 in execute_pass_list (pass=0xe89d80) at
 ../.././gcc/passes.c:1327
 #10 0x00678bca in tree_rest_of_compilation (fndecl=0x7fbcd2977100) at
 ../.././gcc/tree-optimize.c:420
 #11 0x00789665 in cgraph_expand_function (node=0x7fbcd2977700) at
 ../.././gcc/cgraphunit.c:1047
 #12 0x0078ab00 in cgraph_optimize () at ../.././gcc/cgraphunit.c:1106
 #13 0x00413dcb in c_write_global_declarations () at
 ../.././gcc/c-decl.c:8102
 #14 0x0064301e in toplev_main (argc=value optimized out, argv=value
 optimized out) at ../.././gcc/toplev.c:981
 #15 0x7fbcd315c60d in __libc_start_main () from /lib/libc.so.6
 #16 0x00405229 in _start ()


 --


 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39308




--- Comment #11 from sebpop at gmail dot com  2009-02-26 20:10 ---
Created an attachment (id=17369)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17369action=view)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39308



[Bug middle-end/39308] ICE when compiling with -O[s123] -floop-interchange

2009-02-26 Thread il dot basso dot buffo at gmail dot com


--- Comment #12 from il dot basso dot buffo at gmail dot com  2009-02-26 
20:57 ---
Affirmative, this patch seems to do the trick.  Thanks!


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39308



[Bug middle-end/39308] ICE when compiling with -O[s123] -floop-interchange

2009-02-26 Thread spop at gcc dot gnu dot org


--- Comment #13 from spop at gcc dot gnu dot org  2009-02-26 22:01 ---
Subject: Bug 39308

Author: spop
Date: Thu Feb 26 22:00:53 2009
New Revision: 144455

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=144455
Log:
2009-02-26  Sebastian Pop  sebastian@amd.com

PR middle-end/39308
* graphite-clast-to-gimple.c (graphite_loop_normal_form): Do not call
number_of_iterations_exit from a gcc_assert.


Modified:
branches/graphite/gcc/ChangeLog.graphite
branches/graphite/gcc/graphite-clast-to-gimple.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39308