public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53693] New: [4.7 regression] ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1438
@ 2012-06-16  2:01 bearoso at gmail dot com
  2012-06-16 15:01 ` [Bug tree-optimization/53693] [4.7/4.8 " hjl.tools at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: bearoso at gmail dot com @ 2012-06-16  2:01 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53693
           Summary: [4.7 regression] ICE in
                    vect_get_vec_def_for_stmt_copy, at
                    tree-vect-stmts.c:1438
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: bearoso@gmail.com


Created attachment 27628
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27628
Code that generates ICE

With 4.7.0 and up I'm now getting an ICE when building this bit of code with
-O3 or -ftree-vectorize and the C++ compiler:

$ g++ -O1 -ftree-vectorize ice.cxx -o ice
ice.cxx: In function 'void filter_scanlines(void*, int, void*, int, int, int)':
ice.cxx:2:1: internal compiler error: in vect_get_vec_def_for_stmt_copy, at
tree-vect-stmts.c:1438


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

* [Bug tree-optimization/53693] [4.7/4.8 regression] ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1438
  2012-06-16  2:01 [Bug c++/53693] New: [4.7 regression] ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1438 bearoso at gmail dot com
@ 2012-06-16 15:01 ` hjl.tools at gmail dot com
  2012-06-18  9:11 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2012-06-16 15:01 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-06-16
   Target Milestone|---                         |4.7.3
            Summary|[4.7 regression] ICE in     |[4.7/4.8 regression] ICE in
                   |vect_get_vec_def_for_stmt_c |vect_get_vec_def_for_stmt_c
                   |opy, at                     |opy, at
                   |tree-vect-stmts.c:1438      |tree-vect-stmts.c:1438
     Ever Confirmed|0                           |1

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2012-06-16 15:01:03 UTC ---
It is caused by revision 177409:

http://gcc.gnu.org/ml/gcc-cvs/2011-08/msg00420.html


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

* [Bug tree-optimization/53693] [4.7/4.8 regression] ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1438
  2012-06-16  2:01 [Bug c++/53693] New: [4.7 regression] ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1438 bearoso at gmail dot com
  2012-06-16 15:01 ` [Bug tree-optimization/53693] [4.7/4.8 " hjl.tools at gmail dot com
@ 2012-06-18  9:11 ` rguenth at gcc dot gnu.org
  2012-06-18 10:22 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-18  9:11 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-18 09:11:00 UTC ---
Confirmed, mine.


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

* [Bug tree-optimization/53693] [4.7/4.8 regression] ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1438
  2012-06-16  2:01 [Bug c++/53693] New: [4.7 regression] ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1438 bearoso at gmail dot com
  2012-06-16 15:01 ` [Bug tree-optimization/53693] [4.7/4.8 " hjl.tools at gmail dot com
  2012-06-18  9:11 ` rguenth at gcc dot gnu.org
@ 2012-06-18 10:22 ` rguenth at gcc dot gnu.org
  2012-06-18 10:56 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-18 10:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-18 10:22:24 UTC ---
Reduced testcase, it seems we are getting conflicts between two patterns.

void
filter_scanlines (void *src_buffer, void *dst_buffer, int dst_pitch, int width)
{
  int x;
  unsigned short *src, *dst_a, *dst_b;

  src = (unsigned short *) src_buffer;
  dst_a = (unsigned short *) dst_buffer;
  dst_b = ((unsigned short *) dst_buffer) + (dst_pitch >> 1);

  for (x = 0; x < width; x++)
    {
      unsigned char gs, gh;
      gs = src[x];
      gh = gs + (gs >> 1);
      dst_a[x] = (gh << 5) | (gh);
      dst_b[x] = ((gs  - gh) << 5)  | (gs  - gh);
    }
}


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

* [Bug tree-optimization/53693] [4.7/4.8 regression] ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1438
  2012-06-16  2:01 [Bug c++/53693] New: [4.7 regression] ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1438 bearoso at gmail dot com
                   ` (2 preceding siblings ...)
  2012-06-18 10:22 ` rguenth at gcc dot gnu.org
@ 2012-06-18 10:56 ` rguenth at gcc dot gnu.org
  2012-06-18 14:05 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-18 10:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-18 10:56:23 UTC ---
Fact is we detect

  D.2215_20 = (int) gh_18;
  D.2216_21 = D.2215_20 << 5;
  D.2217_22 = (signed short) D.2216_21;

but do not see the use

  D.2222_27 = D.2211_15 - D.2215_20;

for some reason and thus set STMT_IN_PATTER_P on the D.2215_20 def and fail
to vectorize it.  I am testing a patch.


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

* [Bug tree-optimization/53693] [4.7/4.8 regression] ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1438
  2012-06-16  2:01 [Bug c++/53693] New: [4.7 regression] ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1438 bearoso at gmail dot com
                   ` (3 preceding siblings ...)
  2012-06-18 10:56 ` rguenth at gcc dot gnu.org
@ 2012-06-18 14:05 ` rguenth at gcc dot gnu.org
  2012-06-18 14:11 ` [Bug tree-optimization/53693] [4.7 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-18 14:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-18 14:05:33 UTC ---
Author: rguenth
Date: Mon Jun 18 14:05:27 2012
New Revision: 188733

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188733
Log:
2012-06-18  Richard Guenther  <rguenther@suse.de>

    PR tree-optimization/53693
    * tree-vect-patterns.c (vect_operation_fits_smaller_type):
    Reject operands with more than one use.

    * g++.dg/torture/pr53693.C: New testcase.

Added:
    trunk/gcc/testsuite/g++.dg/torture/pr53693.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-patterns.c


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

* [Bug tree-optimization/53693] [4.7 regression] ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1438
  2012-06-16  2:01 [Bug c++/53693] New: [4.7 regression] ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1438 bearoso at gmail dot com
                   ` (4 preceding siblings ...)
  2012-06-18 14:05 ` rguenth at gcc dot gnu.org
@ 2012-06-18 14:11 ` rguenth at gcc dot gnu.org
  2012-07-06  9:21 ` rguenth at gcc dot gnu.org
  2012-07-06  9:26 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-18 14:11 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.8.0
   Target Milestone|4.7.3                       |4.7.2
            Summary|[4.7/4.8 regression] ICE in |[4.7 regression] ICE in
                   |vect_get_vec_def_for_stmt_c |vect_get_vec_def_for_stmt_c
                   |opy, at                     |opy, at
                   |tree-vect-stmts.c:1438      |tree-vect-stmts.c:1438
      Known to fail|                            |4.7.1

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-18 14:10:57 UTC ---
Fixed on trunk sofar.


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

* [Bug tree-optimization/53693] [4.7 regression] ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1438
  2012-06-16  2:01 [Bug c++/53693] New: [4.7 regression] ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1438 bearoso at gmail dot com
                   ` (5 preceding siblings ...)
  2012-06-18 14:11 ` [Bug tree-optimization/53693] [4.7 " rguenth at gcc dot gnu.org
@ 2012-07-06  9:21 ` rguenth at gcc dot gnu.org
  2012-07-06  9:26 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-07-06  9:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-06 09:21:39 UTC ---
Author: rguenth
Date: Fri Jul  6 09:21:36 2012
New Revision: 189313

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189313
Log:
2012-07-06  Richard Guenther  <rguenther@suse.de>

    Backport from mainline
    2012-06-18  Richard Guenther  <rguenther@suse.de>

    PR tree-optimization/53693
    * tree-vect-patterns.c (vect_operation_fits_smaller_type):
    Reject operands with more than one use.

    * g++.dg/torture/pr53693.C: New testcase.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/torture/pr53693.C
Modified:
    branches/gcc-4_7-branch/gcc/ChangeLog
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_7-branch/gcc/tree-vect-patterns.c


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

* [Bug tree-optimization/53693] [4.7 regression] ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1438
  2012-06-16  2:01 [Bug c++/53693] New: [4.7 regression] ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1438 bearoso at gmail dot com
                   ` (6 preceding siblings ...)
  2012-07-06  9:21 ` rguenth at gcc dot gnu.org
@ 2012-07-06  9:26 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-07-06  9:26 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

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

--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-06 09:26:10 UTC ---
Fixed.


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

end of thread, other threads:[~2012-07-06  9:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-16  2:01 [Bug c++/53693] New: [4.7 regression] ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1438 bearoso at gmail dot com
2012-06-16 15:01 ` [Bug tree-optimization/53693] [4.7/4.8 " hjl.tools at gmail dot com
2012-06-18  9:11 ` rguenth at gcc dot gnu.org
2012-06-18 10:22 ` rguenth at gcc dot gnu.org
2012-06-18 10:56 ` rguenth at gcc dot gnu.org
2012-06-18 14:05 ` rguenth at gcc dot gnu.org
2012-06-18 14:11 ` [Bug tree-optimization/53693] [4.7 " rguenth at gcc dot gnu.org
2012-07-06  9:21 ` rguenth at gcc dot gnu.org
2012-07-06  9:26 ` rguenth at gcc dot gnu.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).