public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/64728] New: internal compiler error: SSA corruption
@ 2015-01-22 11:32 mpolacek at gcc dot gnu.org
  2015-01-22 11:36 ` [Bug tree-optimization/64728] [5 Regression] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-01-22 11:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64728

            Bug ID: 64728
           Summary: internal compiler error: SSA corruption
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org

Created attachment 34528
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34528&action=edit
preprocessed source

$ ./cc1 -quiet -O x.i -o /dev/null 

Unable to coalesce ssa_names 158 and 160 which are marked as MUST COALESCE.
start_position_158(ab) and  start_position_160(ab)
src/openslide-vendor-hamamatsu.c: In function ‘read_from_jpeg’:
src/openslide-vendor-hamamatsu.c:599:11: internal compiler error: SSA
corruption
0xe31965 fail_abnormal_edge_coalesce
    /home/marek/src/gcc/gcc/tree-ssa-coalesce.c:927
0xe32950 coalesce_partitions
    /home/marek/src/gcc/gcc/tree-ssa-coalesce.c:1225
0xe3301a coalesce_ssa_name()
    /home/marek/src/gcc/gcc/tree-ssa-coalesce.c:1370
0xdb8a08 remove_ssa_form
    /home/marek/src/gcc/gcc/tree-outof-ssa.c:1018
0xdb9318 rewrite_out_of_ssa(ssaexpand*)
    /home/marek/src/gcc/gcc/tree-outof-ssa.c:1252
0x7edd69 execute
    /home/marek/src/gcc/gcc/cfgexpand.c:5817
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
>From gcc-bugs-return-474359-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jan 22 11:32:45 2015
Return-Path: <gcc-bugs-return-474359-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 31360 invoked by alias); 22 Jan 2015 11:32:44 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 31320 invoked by uid 48); 22 Jan 2015 11:32:39 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/64728] [5 Regression] internal compiler error: SSA corruption
Date: Thu, 22 Jan 2015 11:32:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mpolacek at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: target_milestone short_desc
Message-ID: <bug-64728-4-7VqXvLxys9@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-64728-4@http.gcc.gnu.org/bugzilla/>
References: <bug-64728-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-01/txt/msg02353.txt.bz2
Content-length: 494

https://gcc.gnu.org/bugzilla/show_bug.cgi?idd728

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |5.0
            Summary|internal compiler error:    |[5 Regression] internal
                   |SSA corruption              |compiler error: SSA
                   |                            |corruption


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

* [Bug tree-optimization/64728] [5 Regression] internal compiler error: SSA corruption
  2015-01-22 11:32 [Bug tree-optimization/64728] New: internal compiler error: SSA corruption mpolacek at gcc dot gnu.org
@ 2015-01-22 11:36 ` rguenth at gcc dot gnu.org
  2015-01-22 11:52 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-01-22 11:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64728

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2015-01-22
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed, mine (but waiting for a reduced testcase).


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

* [Bug tree-optimization/64728] [5 Regression] internal compiler error: SSA corruption
  2015-01-22 11:32 [Bug tree-optimization/64728] New: internal compiler error: SSA corruption mpolacek at gcc dot gnu.org
  2015-01-22 11:36 ` [Bug tree-optimization/64728] [5 Regression] " rguenth at gcc dot gnu.org
@ 2015-01-22 11:52 ` jakub at gcc dot gnu.org
  2015-01-22 12:05 ` ktkachov at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-01-22 11:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64728

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I'll reduce and bisect.


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

* [Bug tree-optimization/64728] [5 Regression] internal compiler error: SSA corruption
  2015-01-22 11:32 [Bug tree-optimization/64728] New: internal compiler error: SSA corruption mpolacek at gcc dot gnu.org
  2015-01-22 11:36 ` [Bug tree-optimization/64728] [5 Regression] " rguenth at gcc dot gnu.org
  2015-01-22 11:52 ` jakub at gcc dot gnu.org
@ 2015-01-22 12:05 ` ktkachov at gcc dot gnu.org
  2015-01-22 12:31 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2015-01-22 12:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64728

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ktkachov at gcc dot gnu.org

--- Comment #3 from ktkachov at gcc dot gnu.org ---
Created attachment 34529
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34529&action=edit
Somewhat reduced testcase

Here's what I managed to reduce from a arm cross


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

* [Bug tree-optimization/64728] [5 Regression] internal compiler error: SSA corruption
  2015-01-22 11:32 [Bug tree-optimization/64728] New: internal compiler error: SSA corruption mpolacek at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-01-22 12:05 ` ktkachov at gcc dot gnu.org
@ 2015-01-22 12:31 ` jakub at gcc dot gnu.org
  2015-01-22 12:49 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-01-22 12:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64728

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r217034.
Reduced testcase for -O:
char a[128];
int b, d;
void baz (long);
int setjmp (char [128]);

static void
bar (long *x)
{
  if (d)
    *x = b;
}

void
foo ()
{
  baz (0);
  if (setjmp (a))
    {
      long c;
      bar (&c);
      baz (c);
    }
  baz (0);
}


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

* [Bug tree-optimization/64728] [5 Regression] internal compiler error: SSA corruption
  2015-01-22 11:32 [Bug tree-optimization/64728] New: internal compiler error: SSA corruption mpolacek at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-01-22 12:31 ` jakub at gcc dot gnu.org
@ 2015-01-22 12:49 ` rguenth at gcc dot gnu.org
  2015-01-22 13:07 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-01-22 12:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64728

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Index: tree-ssa-coalesce.c
===================================================================
--- tree-ssa-coalesce.c (revision 219989)
+++ tree-ssa-coalesce.c (working copy)
@@ -1213,8 +1215,11 @@ coalesce_partitions (var_map map, ssa_co
                 gsi_next (&gsi))
              {
                gphi *phi = gsi.phi ();
-               tree res = PHI_RESULT (phi);
                tree arg = PHI_ARG_DEF (phi, e->dest_idx);
+               if (SSA_NAME_IS_DEFAULT_DEF (arg))
+                 continue;
+
+               tree res = PHI_RESULT (phi);
                int v1 = SSA_NAME_VERSION (res);
                int v2 = SSA_NAME_VERSION (arg);


fixes it for me.


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

* [Bug tree-optimization/64728] [5 Regression] internal compiler error: SSA corruption
  2015-01-22 11:32 [Bug tree-optimization/64728] New: internal compiler error: SSA corruption mpolacek at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2015-01-22 12:49 ` rguenth at gcc dot gnu.org
@ 2015-01-22 13:07 ` jakub at gcc dot gnu.org
  2015-01-22 13:11 ` rguenther at suse dot de
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-01-22 13:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64728

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #5)
> Index: tree-ssa-coalesce.c
> ===================================================================
> --- tree-ssa-coalesce.c (revision 219989)
> +++ tree-ssa-coalesce.c (working copy)
> @@ -1213,8 +1215,11 @@ coalesce_partitions (var_map map, ssa_co
>                  gsi_next (&gsi))
>               {
>                 gphi *phi = gsi.phi ();
> -               tree res = PHI_RESULT (phi);
>                 tree arg = PHI_ARG_DEF (phi, e->dest_idx);
> +               if (SSA_NAME_IS_DEFAULT_DEF (arg))
> +                 continue;
> +
> +               tree res = PHI_RESULT (phi);
>                 int v1 = SSA_NAME_VERSION (res);
>                 int v2 = SSA_NAME_VERSION (arg);
>  
> 
> fixes it for me.

Is that right even when SSA_NAME_VAR is a PARM_DECL?


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

* [Bug tree-optimization/64728] [5 Regression] internal compiler error: SSA corruption
  2015-01-22 11:32 [Bug tree-optimization/64728] New: internal compiler error: SSA corruption mpolacek at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2015-01-22 13:07 ` jakub at gcc dot gnu.org
@ 2015-01-22 13:11 ` rguenther at suse dot de
  2015-01-22 16:08 ` rguenth at gcc dot gnu.org
  2015-01-22 16:20 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenther at suse dot de @ 2015-01-22 13:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64728

--- Comment #7 from rguenther at suse dot de <rguenther at suse dot de> ---
On Thu, 22 Jan 2015, jakub at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64728
> 
> --- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> (In reply to Richard Biener from comment #5)
> > Index: tree-ssa-coalesce.c
> > ===================================================================
> > --- tree-ssa-coalesce.c (revision 219989)
> > +++ tree-ssa-coalesce.c (working copy)
> > @@ -1213,8 +1215,11 @@ coalesce_partitions (var_map map, ssa_co
> >                  gsi_next (&gsi))
> >               {
> >                 gphi *phi = gsi.phi ();
> > -               tree res = PHI_RESULT (phi);
> >                 tree arg = PHI_ARG_DEF (phi, e->dest_idx);
> > +               if (SSA_NAME_IS_DEFAULT_DEF (arg))
> > +                 continue;
> > +
> > +               tree res = PHI_RESULT (phi);
> >                 int v1 = SSA_NAME_VERSION (res);
> >                 int v2 = SSA_NAME_VERSION (arg);
> >  
> > 
> > fixes it for me.
> 
> Is that right even when SSA_NAME_VAR is a PARM_DECL?

No, of course not.

> 
>


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

* [Bug tree-optimization/64728] [5 Regression] internal compiler error: SSA corruption
  2015-01-22 11:32 [Bug tree-optimization/64728] New: internal compiler error: SSA corruption mpolacek at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2015-01-22 13:11 ` rguenther at suse dot de
@ 2015-01-22 16:08 ` rguenth at gcc dot gnu.org
  2015-01-22 16:20 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-01-22 16:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64728

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Thu Jan 22 16:07:36 2015
New Revision: 220003

URL: https://gcc.gnu.org/viewcvs?rev=220003&root=gcc&view=rev
Log:
2015-01-22  Richard Biener  <rguenther@suse.de>

    PR middle-end/64728
    * tree-ssa-coalesce.c (coalesce_partitions): Do not perform
    abnormal coalescing on undefined SSA names.

    * gcc.dg/torture/pr64728.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr64728.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-coalesce.c


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

* [Bug tree-optimization/64728] [5 Regression] internal compiler error: SSA corruption
  2015-01-22 11:32 [Bug tree-optimization/64728] New: internal compiler error: SSA corruption mpolacek at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2015-01-22 16:08 ` rguenth at gcc dot gnu.org
@ 2015-01-22 16:20 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-01-22 16:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64728

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

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

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2015-01-22 16:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-22 11:32 [Bug tree-optimization/64728] New: internal compiler error: SSA corruption mpolacek at gcc dot gnu.org
2015-01-22 11:36 ` [Bug tree-optimization/64728] [5 Regression] " rguenth at gcc dot gnu.org
2015-01-22 11:52 ` jakub at gcc dot gnu.org
2015-01-22 12:05 ` ktkachov at gcc dot gnu.org
2015-01-22 12:31 ` jakub at gcc dot gnu.org
2015-01-22 12:49 ` rguenth at gcc dot gnu.org
2015-01-22 13:07 ` jakub at gcc dot gnu.org
2015-01-22 13:11 ` rguenther at suse dot de
2015-01-22 16:08 ` rguenth at gcc dot gnu.org
2015-01-22 16:20 ` 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).