public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/50561] New: [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine
@ 2011-09-28 21:00 matt at use dot net
  2011-09-28 21:10 ` [Bug middle-end/50561] " matt at use dot net
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: matt at use dot net @ 2011-09-28 21:00 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50561
           Summary: [4.7 regression] ICE when compiling zlib with -O2
                    -floop-flatten -floop-strip-mine
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: matt@use.net


getting this with trunk r179143, on Ubuntu 11.10/x86-64:

/usr/lib/gcc-snapshot/bin/x86_64-linux-gnu-gcc  -O2 -floop-flatten
-floop-strip-mine -c ~/src/trees.i trees.c: In function 'init_block':
trees.c:414:13: internal compiler error: in psct_dynamic_dim, at
graphite-poly.h:659

It doesn't happen with -O1, or if you remove either of the loop options. This
doesn't happen with 4.6.1.

Pre-processed source is attached, but it quick to reproduce with zlib 1.2.3.4
sources.


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

* [Bug middle-end/50561] [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine
  2011-09-28 21:00 [Bug middle-end/50561] New: [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine matt at use dot net
@ 2011-09-28 21:10 ` matt at use dot net
  2011-09-28 21:22 ` matt at use dot net
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: matt at use dot net @ 2011-09-28 21:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Matt Hargett <matt at use dot net> 2011-09-28 20:59:07 UTC ---
Created attachment 25378
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25378
pre-processed source of the file that triggers the ICE


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

* [Bug middle-end/50561] [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine
  2011-09-28 21:00 [Bug middle-end/50561] New: [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine matt at use dot net
  2011-09-28 21:10 ` [Bug middle-end/50561] " matt at use dot net
@ 2011-09-28 21:22 ` matt at use dot net
  2011-09-29 10:43 ` rguenth at gcc dot gnu.org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: matt at use dot net @ 2011-09-28 21:22 UTC (permalink / raw)
  To: gcc-bugs

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

Matt Hargett <matt at use dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |major


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

* [Bug middle-end/50561] [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine
  2011-09-28 21:00 [Bug middle-end/50561] New: [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine matt at use dot net
  2011-09-28 21:10 ` [Bug middle-end/50561] " matt at use dot net
  2011-09-28 21:22 ` matt at use dot net
@ 2011-09-29 10:43 ` rguenth at gcc dot gnu.org
  2011-10-27 10:33 ` [Bug tree-optimization/50561] " rguenth at gcc dot gnu.org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-09-29 10:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.7.0


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

* [Bug tree-optimization/50561] [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine
  2011-09-28 21:00 [Bug middle-end/50561] New: [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine matt at use dot net
                   ` (2 preceding siblings ...)
  2011-09-29 10:43 ` rguenth at gcc dot gnu.org
@ 2011-10-27 10:33 ` rguenth at gcc dot gnu.org
  2011-12-10  1:49 ` matt at use dot net
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-27 10:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-10-27
                 CC|                            |spop at gcc dot gnu.org
          Component|middle-end                  |tree-optimization
     Ever Confirmed|0                           |1
           Severity|major                       |normal

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-27 10:32:06 UTC ---
Confirmed.


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

* [Bug tree-optimization/50561] [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine
  2011-09-28 21:00 [Bug middle-end/50561] New: [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine matt at use dot net
                   ` (3 preceding siblings ...)
  2011-10-27 10:33 ` [Bug tree-optimization/50561] " rguenth at gcc dot gnu.org
@ 2011-12-10  1:49 ` matt at use dot net
  2012-01-09 14:41 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: matt at use dot net @ 2011-12-10  1:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Matt Hargett <matt at use dot net> 2011-12-10 01:38:00 UTC ---
Just re-verified that this is still a problem with trunk as of 2011-12-09.


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

* [Bug tree-optimization/50561] [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine
  2011-09-28 21:00 [Bug middle-end/50561] New: [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine matt at use dot net
                   ` (4 preceding siblings ...)
  2011-12-10  1:49 ` matt at use dot net
@ 2012-01-09 14:41 ` rguenth at gcc dot gnu.org
  2012-01-09 15:29 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-01-09 14:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-09 14:41:04 UTC ---
Re-confirmed.  Reduced testcase:

void f (unsigned *s)
{
  int n;
  for (n = 0; n < 256; n++)
    s[n] = 0;
}


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

* [Bug tree-optimization/50561] [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine
  2011-09-28 21:00 [Bug middle-end/50561] New: [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine matt at use dot net
                   ` (5 preceding siblings ...)
  2012-01-09 14:41 ` rguenth at gcc dot gnu.org
@ 2012-01-09 15:29 ` rguenth at gcc dot gnu.org
  2012-02-08 13:43 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-01-09 15:29 UTC (permalink / raw)
  To: gcc-bugs

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

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 #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-09 15:28:01 UTC ---
The asserts in

static inline ppl_dimension_type
psct_dynamic_dim (poly_bb_p pbb, graphite_dim_t level)
{
  graphite_dim_t result = 1 + 2 * level;

  gcc_assert (result < pbb_nb_scattering_transform (pbb));
  return result;
}

static inline ppl_dimension_type
psct_static_dim (poly_bb_p pbb, graphite_dim_t level)
{
  graphite_dim_t result = 2 * level;

  gcc_assert (result < pbb_nb_scattering_transform (pbb));
  return result;
}

are not consistent in case both a dynamic and static dimension should
always exist at the same time.  Changing psct_dynamic_dim to use <=
fixes the issue.


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

* [Bug tree-optimization/50561] [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine
  2011-09-28 21:00 [Bug middle-end/50561] New: [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine matt at use dot net
                   ` (6 preceding siblings ...)
  2012-01-09 15:29 ` rguenth at gcc dot gnu.org
@ 2012-02-08 13:43 ` rguenth at gcc dot gnu.org
  2012-02-08 15:39 ` grosser at gcc dot gnu.org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-08 13:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-08 13:43:24 UTC ---
Not mine, my fix was bogus.  Tobias?


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

* [Bug tree-optimization/50561] [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine
  2011-09-28 21:00 [Bug middle-end/50561] New: [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine matt at use dot net
                   ` (7 preceding siblings ...)
  2012-02-08 13:43 ` rguenth at gcc dot gnu.org
@ 2012-02-08 15:39 ` grosser at gcc dot gnu.org
  2012-02-08 16:02 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: grosser at gcc dot gnu.org @ 2012-02-08 15:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Tobias Grosser <grosser at gcc dot gnu.org> 2012-02-08 15:38:19 UTC ---
Created attachment 26614
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26614
A possible fix

Here a possible fix. The commit message is:

    Removing old scattering dimensions after loop flattening is incorrect.

    As long as we use PPL we are not able to remove the old scattering
dimensions.
    The reason is that these dimensions are not entirely unused.  They are not
    necessary as part of the scheduling vector, as the earlier dimensions
already
    unambiguously define the execution time, however they may still be needed
to
    carry modulo constraints as introduced e.g. by strip mining.  The correct
    solution would be to project these dimensions out of the scattering
polyhedra.
    In case they are still required to carry modulo constraints they should be
kept
    internally as existentially quantified dimensions.  PPL does only support
    projection of rational polyhedra, however in this case we need an integer
    projection. With isl this will be trivial to implement.  For now we just
leave
    the dimensions. This is a little ugly, but should be correct.

Could you verify it it works for you?


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

* [Bug tree-optimization/50561] [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine
  2011-09-28 21:00 [Bug middle-end/50561] New: [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine matt at use dot net
                   ` (8 preceding siblings ...)
  2012-02-08 15:39 ` grosser at gcc dot gnu.org
@ 2012-02-08 16:02 ` rguenth at gcc dot gnu.org
  2012-02-08 17:03 ` dominiq at lps dot ens.fr
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-08 16:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-08 16:02:18 UTC ---
Sure, I will check.


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

* [Bug tree-optimization/50561] [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine
  2011-09-28 21:00 [Bug middle-end/50561] New: [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine matt at use dot net
                   ` (9 preceding siblings ...)
  2012-02-08 16:02 ` rguenth at gcc dot gnu.org
@ 2012-02-08 17:03 ` dominiq at lps dot ens.fr
  2012-02-15 12:20 ` rguenth at gcc dot gnu.org
  2012-02-15 12:23 ` rguenth at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: dominiq at lps dot ens.fr @ 2012-02-08 17:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2012-02-08 17:02:16 UTC ---
I saw a similar ICE for the polyhedron test air.f90. The patch in comment #7
fixes the ICE. However it produces a wrong code for -O2 and above, unless I use
-fwhole-program.


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

* [Bug tree-optimization/50561] [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine
  2011-09-28 21:00 [Bug middle-end/50561] New: [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine matt at use dot net
                   ` (10 preceding siblings ...)
  2012-02-08 17:03 ` dominiq at lps dot ens.fr
@ 2012-02-15 12:20 ` rguenth at gcc dot gnu.org
  2012-02-15 12:23 ` rguenth at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-15 12:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-15 12:20:23 UTC ---
Author: rguenth
Date: Wed Feb 15 12:20:10 2012
New Revision: 184265

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184265
Log:
2012-02-15  Tobias Grosser <grosser@fim.uni-passau.de>

    PR tree-optimization/50561
    * graphite-flattening.c (lst_project_loop): Do not
    remove old scattering dimensions after flattening.
    (lst_do_flatten): Likewise.

    * gcc.dg/graphite/pr50561.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/graphite/pr50561.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/graphite-flattening.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug tree-optimization/50561] [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine
  2011-09-28 21:00 [Bug middle-end/50561] New: [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine matt at use dot net
                   ` (11 preceding siblings ...)
  2012-02-15 12:20 ` rguenth at gcc dot gnu.org
@ 2012-02-15 12:23 ` rguenth at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-15 12:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #11 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-15 12:21:18 UTC ---
Fixed.


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

end of thread, other threads:[~2012-02-15 12:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-28 21:00 [Bug middle-end/50561] New: [4.7 regression] ICE when compiling zlib with -O2 -floop-flatten -floop-strip-mine matt at use dot net
2011-09-28 21:10 ` [Bug middle-end/50561] " matt at use dot net
2011-09-28 21:22 ` matt at use dot net
2011-09-29 10:43 ` rguenth at gcc dot gnu.org
2011-10-27 10:33 ` [Bug tree-optimization/50561] " rguenth at gcc dot gnu.org
2011-12-10  1:49 ` matt at use dot net
2012-01-09 14:41 ` rguenth at gcc dot gnu.org
2012-01-09 15:29 ` rguenth at gcc dot gnu.org
2012-02-08 13:43 ` rguenth at gcc dot gnu.org
2012-02-08 15:39 ` grosser at gcc dot gnu.org
2012-02-08 16:02 ` rguenth at gcc dot gnu.org
2012-02-08 17:03 ` dominiq at lps dot ens.fr
2012-02-15 12:20 ` rguenth at gcc dot gnu.org
2012-02-15 12:23 ` 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).