public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/33680]  New: ICE when compilling elbg.c from ffmpeg
@ 2007-10-06 18:15 ismail at pardus dot org dot tr
  2007-10-06 18:18 ` [Bug middle-end/33680] " ismail at pardus dot org dot tr
                   ` (24 more replies)
  0 siblings, 25 replies; 26+ messages in thread
From: ismail at pardus dot org dot tr @ 2007-10-06 18:15 UTC (permalink / raw)
  To: gcc-bugs

Looks like ffmpeg should be added to gcc testsuite. Just another ICE :

[/packages/mplayer/libavcodec]> cc -I../libswscale -I../libavcodec 
-DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE
-I.. -I.. -I../libavutil -Wdisabled-optimization -Wno-pointer-sign
-Wdeclaration-after-statement -I. -I.. -I../libavutil -Wall -Wno-switch
-Wpointer-arith -Wredundant-decls -O4 -march=native -mtune=native -pipe
-ffast-math -fomit-frame-pointer -D_REENTRANT -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHAVE_CONFIG_H -I/usr/include/ 
-I/usr/include/SDL  -D_REENTRANT  -I/usr/include/freetype2 -I/usr/include  -c
-o elbg.o elbg.c
elbg.c: In function 'try_shift_candidate':
elbg.c:245: 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.

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/usr/lib/gcc-snapshot --disable-libgcj
--disable-libssp --disable-nls --disable-werror --disable-checking
--enable-clocale=gnu --enable-__cxa_atexit
--enable-languages=c,c++,fortran,objc --enable-libstdcxx-allocator=new
--enable-shared --enable-ssp --enable-threads=posix
--enable-version-specific-runtime-libs --without-included-gettext
--without-system-libunwind --with-system-zlib
Thread model: posix
gcc version 4.3.0 20071005 (experimental) (GCC)


-- 
           Summary: ICE when compilling elbg.c from ffmpeg
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ismail at pardus dot org dot tr


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug middle-end/33680] ICE when compilling elbg.c from ffmpeg
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
@ 2007-10-06 18:18 ` ismail at pardus dot org dot tr
  2007-10-06 19:09 ` [Bug tree-optimization/33680] [4.3 Regression] " pinskia at gcc dot gnu dot org
                   ` (23 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: ismail at pardus dot org dot tr @ 2007-10-06 18:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from ismail at pardus dot org dot tr  2007-10-06 18:18 -------
Created an attachment (id=14312)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14312&action=view)
elbg.i produced with -save-temps


-- 


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
  2007-10-06 18:18 ` [Bug middle-end/33680] " ismail at pardus dot org dot tr
@ 2007-10-06 19:09 ` pinskia at gcc dot gnu dot org
  2007-10-06 19:37 ` [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer) pinskia at gcc dot gnu dot org
                   ` (22 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-06 19:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2007-10-06 19:09 -------
Reducing.

Inside tree dce we have a statment as a DECL which seems wrong.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
          Component|middle-end                  |tree-optimization
           Keywords|                            |ice-on-valid-code
            Summary|ICE when compilling elbg.c  |[4.3 Regression] ICE when
                   |from ffmpeg                 |compilling elbg.c from
                   |                            |ffmpeg
   Target Milestone|---                         |4.3.0


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
  2007-10-06 18:18 ` [Bug middle-end/33680] " ismail at pardus dot org dot tr
  2007-10-06 19:09 ` [Bug tree-optimization/33680] [4.3 Regression] " pinskia at gcc dot gnu dot org
@ 2007-10-06 19:37 ` pinskia at gcc dot gnu dot org
  2007-10-06 20:12 ` pinskia at gcc dot gnu dot org
                   ` (21 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-06 19:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2007-10-06 19:37 -------
Vectorizer produces invalid Gimple SSA code:

  D.1769_169 = D.1599 /[ex] 4;

D.1599 should be renamed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dorit at gcc dot gnu dot org
            Summary|[4.3 Regression] ICE when   |[4.3 Regression] ICE when
                   |compilling elbg.c from      |compilling elbg.c from
                   |ffmpeg                      |ffmpeg (vectorizer)


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (2 preceding siblings ...)
  2007-10-06 19:37 ` [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer) pinskia at gcc dot gnu dot org
@ 2007-10-06 20:12 ` pinskia at gcc dot gnu dot org
  2007-10-06 20:37 ` pinskia at gcc dot gnu dot org
                   ` (20 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-06 20:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2007-10-06 20:11 -------
We do catch this earlier with checking turned on.
Reducing all the way now.


-- 


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (3 preceding siblings ...)
  2007-10-06 20:12 ` pinskia at gcc dot gnu dot org
@ 2007-10-06 20:37 ` pinskia at gcc dot gnu dot org
  2007-10-07 12:05 ` pinskia at gcc dot gnu dot org
                   ` (19 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-06 20:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2007-10-06 20:37 -------
Reduced testcase:
int f(int dim, int *b) {
  int newcentroid[3][dim];
  int *a = newcentroid[2];
  int i, dist=0;
  for (i=0;i<dim;i++) 
    dist += (a[i] - b[i])*(a[i] - b[i]);
  return dist;
}

Compile with -O3 -msse2.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-10-06 20:37:00
               date|                            |


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (4 preceding siblings ...)
  2007-10-06 20:37 ` pinskia at gcc dot gnu dot org
@ 2007-10-07 12:05 ` pinskia at gcc dot gnu dot org
  2007-10-07 12:31 ` irar at il dot ibm dot com
                   ` (18 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-07 12:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2007-10-07 12:05 -------
*** Bug 33684 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bero at arklinux dot org


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (5 preceding siblings ...)
  2007-10-07 12:05 ` pinskia at gcc dot gnu dot org
@ 2007-10-07 12:31 ` irar at il dot ibm dot com
  2007-10-09 12:29 ` jakub at gcc dot gnu dot org
                   ` (17 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: irar at il dot ibm dot com @ 2007-10-07 12:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from irar at il dot ibm dot com  2007-10-07 12:31 -------
(In reply to comment #3)

I get:
pr33680.c: In function &#1490;f&#1490;:
pr33680.c:1: error: expected an SSA_NAME object
pr33680.c:1: error: in statement
D.1618_93 = D.1556 /[ex] 4;
pr33680.c:1: internal compiler error: verify_ssa failed

The problem is that D.1556 is a VAR_DECL and not an SSA_NAME.

This stmt is created while gimplifying data-ref base in
vect_create_addr_base_for_vector_ref(). The expr is
(int[0:D.1553] *) newcentroid.1_22 + (long unsigned int) dim_4(D) * 8

 <pointer_plus_expr 0x2b0e515de8c0
    type <pointer_type 0x2b0e515a34e0
        type <array_type 0x2b0e515a3270 type <integer_type 0x2b0e514975b0 int>
            sizes-gimplified type_1 BLK size <var_decl 0x2b0e515586e0 D.1555>
unit size <var_decl 0x2b0e51558790 D.1556> 
...

D.1618 = D.1556 /[ex] 4 is created, taking D.1556 as the unit size in
gimplify_compound_lval. And later D.1618 is replaced with an SSA_NAME
D.1618_93, since it's a lhs (in gimplify_modify_expr). 

> Vectorizer produces invalid Gimple SSA code:
> 
>   D.1769_169 = D.1599 /[ex] 4;
> 
> D.1599 should be renamed.
> 

Where should it be renamed? In gimplify_smth? 

Thanks,
Ira


-- 

irar at il dot ibm dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |irar at il dot ibm dot com


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (6 preceding siblings ...)
  2007-10-07 12:31 ` irar at il dot ibm dot com
@ 2007-10-09 12:29 ` jakub at gcc dot gnu dot org
  2007-10-09 12:50 ` irar at il dot ibm dot com
                   ` (16 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-10-09 12:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jakub at gcc dot gnu dot org  2007-10-09 12:29 -------
If you use force_gimple_operand_bsi, it takes care of that itself.
If you e.g. use force_gimple_operand instead, you need to take care of
calling mark_symbols_for_renaming yourself.


-- 


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (7 preceding siblings ...)
  2007-10-09 12:29 ` jakub at gcc dot gnu dot org
@ 2007-10-09 12:50 ` irar at il dot ibm dot com
  2007-10-09 14:45 ` jakub at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: irar at il dot ibm dot com @ 2007-10-09 12:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from irar at il dot ibm dot com  2007-10-09 12:49 -------
(In reply to comment #8)
> If you use force_gimple_operand_bsi, it takes care of that itself.

Thanks! I will try to see if we can use it. The problem is we don't have a bsi,
we insert those stmts using bsi_insert_on_edge_immediate on
loop_preheader_edge.

> If you e.g. use force_gimple_operand instead, you need to take care of
> calling mark_symbols_for_renaming yourself.

In order to do this, we will have to go through the statement list created by
force_gimple_operand, and I am not sure that it's a good idea.

Thanks,
Ira


-- 


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (8 preceding siblings ...)
  2007-10-09 12:50 ` irar at il dot ibm dot com
@ 2007-10-09 14:45 ` jakub at gcc dot gnu dot org
  2007-10-10 13:24 ` irar at il dot ibm dot com
                   ` (14 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-10-09 14:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jakub at gcc dot gnu dot org  2007-10-09 14:45 -------
Please see http://gcc.gnu.org/ml/gcc-patches/2007-09/msg00155.html
(the second patch in it).  While the first patch has been committed, if
there are other testcases which show that the lack of mark_symbols_for_renaming
calls in vectorizer breaks them, IMHO the second patch is needed (and other
force_gimple_operand calls in the vectorizer need checking as well).


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (9 preceding siblings ...)
  2007-10-09 14:45 ` jakub at gcc dot gnu dot org
@ 2007-10-10 13:24 ` irar at il dot ibm dot com
  2007-10-10 18:16 ` mmitchel at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: irar at il dot ibm dot com @ 2007-10-10 13:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from irar at il dot ibm dot com  2007-10-10 13:23 -------
I understand that those symbols have to be renamed, I am just saying that maybe
it   should be done in the gimplifier and not in the vectorizer. But since
force_gimple_operand_bsi also goes through the statements list, I guess it is
reasonable to do the same thing in the vectorizer. Or we can add a new API like
force_gimple_operand_and_mark_for_renaming.

Anyway, I tried your patch. Now we get a different ICE:
internal compiler error: in referenced_var_lookup, at tree-dfa.c:642

D.1556 is marked for renaming but then during update_ssa it cannot find it - 
htab_find_with_hash (tree-dfa.c:641) returns NULL.

#0  referenced_var_lookup (uid=1556) at ../../gcc/gcc/tree-dfa.c:642
#1  0x00000000006f9308 in update_ssa (update_flags=2048) at
../../gcc/gcc/tree-into-ssa.c:3207
#2  0x0000000000aac184 in vect_transform_loop (loop_vinfo=0xe94410) at
../../gcc/gcc/tree-vect-transform.c:7431
#3  0x00000000007fae09 in vectorize_loops () at
../../gcc/gcc/tree-vectorizer.c:2507
#4  0x0000000000631726 in execute_one_pass (pass=0xdfc0c0) at
../../gcc/gcc/passes.c:1116
#5  0x00000000006318ec in execute_pass_list (pass=0xdfc0c0) at
../../gcc/gcc/passes.c:1169
#6  0x00000000006318fe in execute_pass_list (pass=0xdfbee0) at
../../gcc/gcc/passes.c:1170
#7  0x00000000006318fe in execute_pass_list (pass=0xdfb2e0) at
../../gcc/gcc/passes.c:1170
#8  0x00000000007086ce in tree_rest_of_compilation (fndecl=0x2ba807b05800) at
../../gcc/gcc/tree-optimize.c:404
#9  0x000000000088a054 in cgraph_expand_function (node=0x2ba807b05900) at
../../gcc/gcc/cgraphunit.c:1070
#10 0x000000000088bbe7 in cgraph_optimize () at ../../gcc/gcc/cgraphunit.c:1139
#11 0x00000000004144fe in c_write_global_declarations () at
../../gcc/gcc/c-decl.c:8077
#12 0x00000000006ad2e7 in toplev_main (argc=<value optimized out>, argv=<value
optimized out>) at ../../gcc/gcc/toplev.c:1052
#13 0x00002ba8077d5154 in __libc_start_main () from /lib64/libc.so.6
#14 0x0000000000403cf9 in _start ()


Thanks,
Ira


-- 


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (10 preceding siblings ...)
  2007-10-10 13:24 ` irar at il dot ibm dot com
@ 2007-10-10 18:16 ` mmitchel at gcc dot gnu dot org
  2007-10-11  9:42 ` jakub at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-10-10 18:16 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (11 preceding siblings ...)
  2007-10-10 18:16 ` mmitchel at gcc dot gnu dot org
@ 2007-10-11  9:42 ` jakub at gcc dot gnu dot org
  2007-10-11 10:44 ` irar at il dot ibm dot com
                   ` (11 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-10-11  9:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from jakub at gcc dot gnu dot org  2007-10-11 09:41 -------
The problem is that D.1556 (the var that hasn't been renamed or with the patch
can't be looked up) has been deleted.
*.phiprop has:
  long unsigned intD.4 D.1556;
...
  D.1554_11 = (long unsigned intD.4) dimD.1539_4(D);
  D.1556_12 = D.1554_11 * 4;
...
  D.1561_23 = D.1556_12 /[ex] 4;
  D.1562_24 = &(*newcentroid.1D.1559_22)[0]{lb: 0 sz: D.1561_23 * 4};

then FRE does:
Replaced D.1556_12 /[ex] 4 with D.1554_11 in D.1561_23 = D.1556_12 /[ex] 4;
  long unsigned intD.4 D.1556;
...
  D.1554_11 = (long unsigned intD.4) dimD.1539_4(D);
  D.1556_12 = D.1554_11 * 4;
...
  newcentroid.1D.1559_22 = (intD.0[3][0:D.1553] *) D.1560_21;
  D.1561_23 = D.1554_11;
  D.1562_24 = &(*newcentroid.1D.1559_22)[0]{lb: 0 sz: D.1561_23 * 4};

and as D.1556 is unused, it is DCEd in dce2 pass.  But D.1556 (and D.1555) is
still present in TYPE_SIZE{,_UNIT} of the VLA type, so when vectorizer
regimplifies it, it adds back code to compute its size, but that assumes
D.1556 has the correct value.

Not sure what could be done here to fix this.  The easiest solution is not to
vectorize when VLA types are involved.  In any case it means that debuginfo
will
be incomplete if its size variable has been DCEd.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dnovillo at gcc dot gnu dot
                   |                            |org


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (12 preceding siblings ...)
  2007-10-11  9:42 ` jakub at gcc dot gnu dot org
@ 2007-10-11 10:44 ` irar at il dot ibm dot com
  2007-10-11 12:35 ` irar at il dot ibm dot com
                   ` (10 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: irar at il dot ibm dot com @ 2007-10-11 10:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from irar at il dot ibm dot com  2007-10-11 10:43 -------
Maybe we can fix DCE not to eliminate such vars?

Or somehow fix split_constant_offset?
The following patch changes the base from 
(int[0:D.1553] *) newcentroid.1_22 + (long unsigned int) dim_4(D) * 8
to (int[0:D.1553] *) D.1560_21 + (long unsigned int) dim_4(D) * 8
and, hence, there is no need in the size of newcentroid.1_22:

Index: tree-data-ref.c
===================================================================
--- tree-data-ref.c     (revision 128902)
+++ tree-data-ref.c     (working copy)
@@ -579,8 +579,10 @@ split_constant_offset (tree exp, tree *v
              {
                split_constant_offset (def_stmt_rhs, &var0, &off0);
                var0 = fold_convert (type, var0);
-               *var = var0;
-               *off = off0;
+               split_constant_offset (var0, &var2, &off2);
+               *var = var2;
+               *off = fold_build2 (PLUS_EXPR, TREE_TYPE (off2),
+                                off0, off2);
                return;
              }
          }
Maybe we can check if the base is of the VLA type and then try to further split
it as above (and not to vectorize if we fail)?

Thanks,
Ira


-- 

irar at il dot ibm dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rakdver at gcc dot gnu dot
                   |                            |org
           Priority|P1                          |P3


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (13 preceding siblings ...)
  2007-10-11 10:44 ` irar at il dot ibm dot com
@ 2007-10-11 12:35 ` irar at il dot ibm dot com
  2007-10-11 14:17 ` jsjodin at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: irar at il dot ibm dot com @ 2007-10-11 12:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from irar at il dot ibm dot com  2007-10-11 12:34 -------
BTW, without this patch http://gcc.gnu.org/ml/gcc-patches/2007-07/msg02122.html
there is no ICE and the loop gets vectorized.

Ira


-- 

irar at il dot ibm dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Jan dot Sjodin at amd dot
                   |                            |com


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (14 preceding siblings ...)
  2007-10-11 12:35 ` irar at il dot ibm dot com
@ 2007-10-11 14:17 ` jsjodin at gcc dot gnu dot org
  2007-10-15 10:42 ` irar at il dot ibm dot com
                   ` (8 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: jsjodin at gcc dot gnu dot org @ 2007-10-11 14:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from jsjodin at gcc dot gnu dot org  2007-10-11 14:17 -------
(In reply to comment #14)
> BTW, without this patch http://gcc.gnu.org/ml/gcc-patches/2007-07/msg02122.html
> there is no ICE and the loop gets vectorized.
> 
> Ira
> 

It may be that the test to go through an SSA_NAME in split_constant_offset is
still not strict enough. I was having problem knowing what to check for. See
thread: http://gcc.gnu.org/ml/gcc-patches/2007-07/msg01294.html

--- trunk/gcc/tree-data-ref.c   (revision 126953)
+++ trunk/gcc/tree-data-ref.c   (working copy)
@@ -565,6 +565,27 @@ split_constant_offset (tree exp, tree *v
        return;
       }

+    case SSA_NAME:
+      {
+       tree def_stmt = SSA_NAME_DEF_STMT (exp);
+       if (TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT)
+         {
+           tree def_stmt_rhs = GIMPLE_STMT_OPERAND (def_stmt, 1);
+
+           if (!TREE_SIDE_EFFECTS (def_stmt_rhs) 
+               && EXPR_P (def_stmt_rhs)
+               && !REFERENCE_CLASS_P (def_stmt_rhs))
+             {
+               split_constant_offset (def_stmt_rhs, &var0, &off0);
+               var0 = fold_convert (type, var0);
+               *var = var0;
+               *off = off0;
+               return;


-- 


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (15 preceding siblings ...)
  2007-10-11 14:17 ` jsjodin at gcc dot gnu dot org
@ 2007-10-15 10:42 ` irar at il dot ibm dot com
  2007-10-15 15:02 ` rakdver at kam dot mff dot cuni dot cz
                   ` (7 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: irar at il dot ibm dot com @ 2007-10-15 10:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from irar at il dot ibm dot com  2007-10-15 10:42 -------
This patch fixes the ICE and doesn't cause regressions in the vectorizer
testsuite:

Index: tree-data-ref.c
===================================================================
--- tree-data-ref.c     (revision 129292)
+++ tree-data-ref.c     (working copy)
@@ -571,11 +571,16 @@ split_constant_offset (tree exp, tree *v
        if (TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT)
          {
            tree def_stmt_rhs = GIMPLE_STMT_OPERAND (def_stmt, 1);
+            tree arr = NULL_TREE;
+
+            if (TREE_CODE (def_stmt_rhs) == ADDR_EXPR)
+              arr = TREE_OPERAND (def_stmt_rhs, 0);

            if (!TREE_SIDE_EFFECTS (def_stmt_rhs)
                && EXPR_P (def_stmt_rhs)
                && !REFERENCE_CLASS_P (def_stmt_rhs)
-               && !get_call_expr_in (def_stmt_rhs))
+               && !get_call_expr_in (def_stmt_rhs)
+                && (!arr || TREE_THIS_NOTRAP (arr)))
              {
                split_constant_offset (def_stmt_rhs, &var0, &off0);
                var0 = fold_convert (type, var0);

This way we avoid arrays with unknown size.

Ira


-- 


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (16 preceding siblings ...)
  2007-10-15 10:42 ` irar at il dot ibm dot com
@ 2007-10-15 15:02 ` rakdver at kam dot mff dot cuni dot cz
  2007-10-23 18:10 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: rakdver at kam dot mff dot cuni dot cz @ 2007-10-15 15:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from rakdver at kam dot mff dot cuni dot cz  2007-10-15 15:02 -------
Subject: Re:  [4.3 Regression] ICE when compilling elbg.c from ffmpeg
(vectorizer)

> This patch fixes the ICE and doesn't cause regressions in the vectorizer
> testsuite:
> 
> Index: tree-data-ref.c
> ===================================================================
> --- tree-data-ref.c     (revision 129292)
> +++ tree-data-ref.c     (working copy)
> @@ -571,11 +571,16 @@ split_constant_offset (tree exp, tree *v
>         if (TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT)
>           {
>             tree def_stmt_rhs = GIMPLE_STMT_OPERAND (def_stmt, 1);
> +            tree arr = NULL_TREE;
> +
> +            if (TREE_CODE (def_stmt_rhs) == ADDR_EXPR)
> +              arr = TREE_OPERAND (def_stmt_rhs, 0);
> 
>             if (!TREE_SIDE_EFFECTS (def_stmt_rhs)
>                 && EXPR_P (def_stmt_rhs)
>                 && !REFERENCE_CLASS_P (def_stmt_rhs)
> -               && !get_call_expr_in (def_stmt_rhs))
> +               && !get_call_expr_in (def_stmt_rhs)
> +                && (!arr || TREE_THIS_NOTRAP (arr)))

you would have to be more careful here, as arr does not have to be
array_ref, so applying TREE_THIS_NOTRAP to it may cause ICEs.
Anyway, this change does not make sense to me, I need to check
what this PR is about, but there is no reason for split_constant_offset
to special-case ADDR_EXPR's this way.


-- 


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (17 preceding siblings ...)
  2007-10-15 15:02 ` rakdver at kam dot mff dot cuni dot cz
@ 2007-10-23 18:10 ` pinskia at gcc dot gnu dot org
  2007-10-24 15:37 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-23 18:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from pinskia at gcc dot gnu dot org  2007-10-23 18:09 -------
*** Bug 33872 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lu_zero at gentoo dot org


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (18 preceding siblings ...)
  2007-10-23 18:10 ` pinskia at gcc dot gnu dot org
@ 2007-10-24 15:37 ` pinskia at gcc dot gnu dot org
  2007-10-31 16:32 ` jakub at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-24 15:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from pinskia at gcc dot gnu dot org  2007-10-24 15:37 -------
*** Bug 33882 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gregoire dot favre at gmail
                   |                            |dot com


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (19 preceding siblings ...)
  2007-10-24 15:37 ` pinskia at gcc dot gnu dot org
@ 2007-10-31 16:32 ` jakub at gcc dot gnu dot org
  2007-11-05  2:47 ` mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-10-31 16:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from jakub at gcc dot gnu dot org  2007-10-31 16:31 -------
What I'd try instead is something like:
--- tree-data-ref.c.jj11        2007-10-28 19:34:10.000000000 +0100
+++ tree-data-ref.c     2007-10-31 16:22:21.000000000 +0100
@@ -629,7 +629,7 @@ dr_analyze_innermost (struct data_refere
   enum machine_mode pmode;
   int punsignedp, pvolatilep;
   affine_iv base_iv, offset_iv;
-  tree init, dinit, step;
+  tree init, dinit, step, type;

   if (dump_file && (dump_flags & TDF_DETAILS))
     fprintf (dump_file, "analyze_innermost: ");
@@ -666,9 +666,21 @@ dr_analyze_innermost (struct data_refere

   init = ssize_int (pbitpos / BITS_PER_UNIT);
   split_constant_offset (base_iv.base, &base_iv.base, &dinit);
-  init =  size_binop (PLUS_EXPR, init, dinit);
+  init = size_binop (PLUS_EXPR, init, dinit);
   split_constant_offset (offset_iv.base, &offset_iv.base, &dinit);
-  init =  size_binop (PLUS_EXPR, init, dinit);
+  init = size_binop (PLUS_EXPR, init, dinit);
+
+  /* See if base address involves a variable length type somewhere.
+     Bases with such types shouldn't be gimplified again.  */
+  type = TREE_TYPE (base_iv.base);
+  while (POINTER_TYPE_P (type))
+    type = TREE_TYPE (type);
+  if (int_size_in_bytes (type) < 0)
+    {
+      if (dump_file && (dump_flags & TDF_DETAILS))
+        fprintf (dump_file, "failed: base involves a variable length
type.\n");
+      return;
+    }

   step = size_binop (PLUS_EXPR,
                     fold_convert (ssizetype, base_iv.step),

or similar check in the vectorizer instead.  This exact patch breaks
gfortran.dg/vect/vect-3.f90 and gfortran.dg/vect/pr19049.f90 (they are no
longer vectorized as expected), would need to see whether it tries to unsafely
gimplify the VLA type sizes in the vectorizer or not.


-- 


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (20 preceding siblings ...)
  2007-10-31 16:32 ` jakub at gcc dot gnu dot org
@ 2007-11-05  2:47 ` mmitchel at gcc dot gnu dot org
  2007-11-08 18:18 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-11-05  2:47 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (21 preceding siblings ...)
  2007-11-05  2:47 ` mmitchel at gcc dot gnu dot org
@ 2007-11-08 18:18 ` jakub at gcc dot gnu dot org
  2007-11-10  7:40 ` jakub at gcc dot gnu dot org
  2007-11-10  7:52 ` jakub at gcc dot gnu dot org
  24 siblings, 0 replies; 26+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-08 18:18 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2007-
                   |                            |11/msg00448.html
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-10-06 20:37:00         |2007-11-08 18:18:23
               date|                            |


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (22 preceding siblings ...)
  2007-11-08 18:18 ` jakub at gcc dot gnu dot org
@ 2007-11-10  7:40 ` jakub at gcc dot gnu dot org
  2007-11-10  7:52 ` jakub at gcc dot gnu dot org
  24 siblings, 0 replies; 26+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-10  7:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from jakub at gcc dot gnu dot org  2007-11-10 07:40 -------
Subject: Bug 33680

Author: jakub
Date: Sat Nov 10 07:40:37 2007
New Revision: 130067

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130067
Log:
        PR tree-optimization/33680
        * tree-data-ref.c (split_constant_offset) <case ADDR_EXPR>: Punt
        if the added cast involves variable length types.

        * gcc.c-torture/compile/20071108-1.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/20071108-1.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-data-ref.c


-- 


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer)
  2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
                   ` (23 preceding siblings ...)
  2007-11-10  7:40 ` jakub at gcc dot gnu dot org
@ 2007-11-10  7:52 ` jakub at gcc dot gnu dot org
  24 siblings, 0 replies; 26+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-10  7:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #22 from jakub at gcc dot gnu dot org  2007-11-10 07:52 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2007-11-10  7:52 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-06 18:15 [Bug middle-end/33680] New: ICE when compilling elbg.c from ffmpeg ismail at pardus dot org dot tr
2007-10-06 18:18 ` [Bug middle-end/33680] " ismail at pardus dot org dot tr
2007-10-06 19:09 ` [Bug tree-optimization/33680] [4.3 Regression] " pinskia at gcc dot gnu dot org
2007-10-06 19:37 ` [Bug tree-optimization/33680] [4.3 Regression] ICE when compilling elbg.c from ffmpeg (vectorizer) pinskia at gcc dot gnu dot org
2007-10-06 20:12 ` pinskia at gcc dot gnu dot org
2007-10-06 20:37 ` pinskia at gcc dot gnu dot org
2007-10-07 12:05 ` pinskia at gcc dot gnu dot org
2007-10-07 12:31 ` irar at il dot ibm dot com
2007-10-09 12:29 ` jakub at gcc dot gnu dot org
2007-10-09 12:50 ` irar at il dot ibm dot com
2007-10-09 14:45 ` jakub at gcc dot gnu dot org
2007-10-10 13:24 ` irar at il dot ibm dot com
2007-10-10 18:16 ` mmitchel at gcc dot gnu dot org
2007-10-11  9:42 ` jakub at gcc dot gnu dot org
2007-10-11 10:44 ` irar at il dot ibm dot com
2007-10-11 12:35 ` irar at il dot ibm dot com
2007-10-11 14:17 ` jsjodin at gcc dot gnu dot org
2007-10-15 10:42 ` irar at il dot ibm dot com
2007-10-15 15:02 ` rakdver at kam dot mff dot cuni dot cz
2007-10-23 18:10 ` pinskia at gcc dot gnu dot org
2007-10-24 15:37 ` pinskia at gcc dot gnu dot org
2007-10-31 16:32 ` jakub at gcc dot gnu dot org
2007-11-05  2:47 ` mmitchel at gcc dot gnu dot org
2007-11-08 18:18 ` jakub at gcc dot gnu dot org
2007-11-10  7:40 ` jakub at gcc dot gnu dot org
2007-11-10  7:52 ` jakub at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).