public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/56034] New: ICE: verify_gimple failed (invalid PHI argument) with -ftree-loop-distribution
@ 2013-01-18 14:59 antoine.balestrat at gmail dot com
  2013-01-18 15:33 ` [Bug tree-optimization/56034] " mpolacek at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: antoine.balestrat at gmail dot com @ 2013-01-18 14:59 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56034
           Summary: ICE: verify_gimple failed (invalid PHI argument) with
                    -ftree-loop-distribution
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: antoine.balestrat@gmail.com


Hi !
Using GCC 4.8.0 as of 20130118 :

$ cat incompat.c
int a, b, *p;

void f(void)
{
    int *q;

    while(b++)
    {
        int i;
        p = &i;
        a = *q;
    }

    if(a)
        for(;; b++);
}

$ xgcc -O2 -w -ftree-loop-distribution incompat.c
incompat.c: In function ‘f’:
incompat.c:3:6: error: invalid PHI argument
 void f(void)
      ^
.MEM_10
incompat.c:3:6: error: incompatible types in PHI argument 0
int

void

a.0_26 = PHI <.MEM_10(5)>

incompat.c:3:6: internal compiler error: verify_gimple failed
0x90380c verify_gimple_in_cfg(function*)
    ../../srcdir/gcc/tree-cfg.c:4727
0x83e917 execute_function_todo
    ../../srcdir/gcc/passes.c:1966
0x83f297 execute_todo
    ../../srcdir/gcc/passes.c:1999
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.


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

* [Bug tree-optimization/56034] ICE: verify_gimple failed (invalid PHI argument) with -ftree-loop-distribution
  2013-01-18 14:59 [Bug tree-optimization/56034] New: ICE: verify_gimple failed (invalid PHI argument) with -ftree-loop-distribution antoine.balestrat at gmail dot com
@ 2013-01-18 15:33 ` mpolacek at gcc dot gnu.org
  2013-01-18 16:57 ` [Bug tree-optimization/56034] [4.8 Regression] " mpolacek at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-01-18 15:33 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-01-18
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> 2013-01-18 15:32:36 UTC ---
Confirmed.


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

* [Bug tree-optimization/56034] [4.8 Regression] ICE: verify_gimple failed (invalid PHI argument) with -ftree-loop-distribution
  2013-01-18 14:59 [Bug tree-optimization/56034] New: ICE: verify_gimple failed (invalid PHI argument) with -ftree-loop-distribution antoine.balestrat at gmail dot com
  2013-01-18 15:33 ` [Bug tree-optimization/56034] " mpolacek at gcc dot gnu.org
@ 2013-01-18 16:57 ` mpolacek at gcc dot gnu.org
  2013-01-21 13:25 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-01-18 16:57 UTC (permalink / raw)
  To: gcc-bugs


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

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

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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> 2013-01-18 16:57:44 UTC ---
Started with http://gcc.gnu.org/viewcvs?view=revision&revision=195239


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

* [Bug tree-optimization/56034] [4.8 Regression] ICE: verify_gimple failed (invalid PHI argument) with -ftree-loop-distribution
  2013-01-18 14:59 [Bug tree-optimization/56034] New: ICE: verify_gimple failed (invalid PHI argument) with -ftree-loop-distribution antoine.balestrat at gmail dot com
  2013-01-18 15:33 ` [Bug tree-optimization/56034] " mpolacek at gcc dot gnu.org
  2013-01-18 16:57 ` [Bug tree-optimization/56034] [4.8 Regression] " mpolacek at gcc dot gnu.org
@ 2013-01-21 13:25 ` rguenth at gcc dot gnu.org
  2013-01-25 15:34 ` mpolacek at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-01-21 13:25 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|---                         |4.8.0

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> 2013-01-21 13:24:57 UTC ---
Mine.


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

* [Bug tree-optimization/56034] [4.8 Regression] ICE: verify_gimple failed (invalid PHI argument) with -ftree-loop-distribution
  2013-01-18 14:59 [Bug tree-optimization/56034] New: ICE: verify_gimple failed (invalid PHI argument) with -ftree-loop-distribution antoine.balestrat at gmail dot com
                   ` (2 preceding siblings ...)
  2013-01-21 13:25 ` rguenth at gcc dot gnu.org
@ 2013-01-25 15:34 ` mpolacek at gcc dot gnu.org
  2013-01-25 18:16 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-01-25 15:34 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> 2013-01-25 15:33:57 UTC ---
So, we replace
# a.0_26 = PHI <a.0_10(5)>
with
# a.0_26 = PHI <.MEM_10(5)>
This happens when we call rewrite_into_loop_closed_ssa in case we're actually
performing some loop distribution transformation.  Then we call update_ssa and
here with
      FOR_EACH_VEC_ELT (symbols_to_rename, i, sym) 
        insert_updated_phi_nodes_for (sym, dfs, blocks_to_update,
                                      update_flags);
change the PHI argument.


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

* [Bug tree-optimization/56034] [4.8 Regression] ICE: verify_gimple failed (invalid PHI argument) with -ftree-loop-distribution
  2013-01-18 14:59 [Bug tree-optimization/56034] New: ICE: verify_gimple failed (invalid PHI argument) with -ftree-loop-distribution antoine.balestrat at gmail dot com
                   ` (3 preceding siblings ...)
  2013-01-25 15:34 ` mpolacek at gcc dot gnu.org
@ 2013-01-25 18:16 ` rguenth at gcc dot gnu.org
  2013-01-28 11:57 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-01-25 18:16 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> 2013-01-25 18:16:08 UTC ---
(In reply to comment #4)
> So, we replace
> # a.0_26 = PHI <a.0_10(5)>
> with
> # a.0_26 = PHI <.MEM_10(5)>
> This happens when we call rewrite_into_loop_closed_ssa in case we're actually
> performing some loop distribution transformation.  Then we call update_ssa and
> here with
>       FOR_EACH_VEC_ELT (symbols_to_rename, i, sym) 
>         insert_updated_phi_nodes_for (sym, dfs, blocks_to_update,
>                                       update_flags);
> change the PHI argument.

Note that this only can happen if a.0_10 was released but still used before.

I'm still going to look into this after I return on monday.


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

* [Bug tree-optimization/56034] [4.8 Regression] ICE: verify_gimple failed (invalid PHI argument) with -ftree-loop-distribution
  2013-01-18 14:59 [Bug tree-optimization/56034] New: ICE: verify_gimple failed (invalid PHI argument) with -ftree-loop-distribution antoine.balestrat at gmail dot com
                   ` (4 preceding siblings ...)
  2013-01-25 18:16 ` rguenth at gcc dot gnu.org
@ 2013-01-28 11:57 ` rguenth at gcc dot gnu.org
  2013-01-28 14:46 ` rguenth at gcc dot gnu.org
  2013-01-28 14:47 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-01-28 11:57 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> 2013-01-28 11:57:25 UTC ---
We have the producer of the loop closed PHI use not in the last partition
as it is designed to happen.  I have a patch.


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

* [Bug tree-optimization/56034] [4.8 Regression] ICE: verify_gimple failed (invalid PHI argument) with -ftree-loop-distribution
  2013-01-18 14:59 [Bug tree-optimization/56034] New: ICE: verify_gimple failed (invalid PHI argument) with -ftree-loop-distribution antoine.balestrat at gmail dot com
                   ` (5 preceding siblings ...)
  2013-01-28 11:57 ` rguenth at gcc dot gnu.org
@ 2013-01-28 14:46 ` rguenth at gcc dot gnu.org
  2013-01-28 14:47 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-01-28 14:46 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> 2013-01-28 14:45:50 UTC ---
Author: rguenth
Date: Mon Jan 28 14:45:46 2013
New Revision: 195508

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195508
Log:
2013-01-28  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/56034
    * tree-loop-distribution.c (enum partition_kind): Add
    PKIND_REDUCTION.
    (partition_builtin_p): Adjust.
    (generate_code_for_partition): Handle PKIND_REDUCTION.  Assert
    it is the last partition.
    (rdg_flag_uses): Check SSA_NAME_IS_DEFAULT_DEF before looking
    up the vertex for the definition.
    (classify_partition): Classify whether a partition is a
    PKIND_REDUCTION, thus has uses outside of the loop.
    (ldist_gen): Inherit PKIND_REDUCTION when merging partitions.
    Merge all PKIND_REDUCTION partitions into the last partition.
    (tree_loop_distribution): Seed partitions from reductions as well.

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

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr56034.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-loop-distribution.c


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

* [Bug tree-optimization/56034] [4.8 Regression] ICE: verify_gimple failed (invalid PHI argument) with -ftree-loop-distribution
  2013-01-18 14:59 [Bug tree-optimization/56034] New: ICE: verify_gimple failed (invalid PHI argument) with -ftree-loop-distribution antoine.balestrat at gmail dot com
                   ` (6 preceding siblings ...)
  2013-01-28 14:46 ` rguenth at gcc dot gnu.org
@ 2013-01-28 14:47 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-01-28 14:47 UTC (permalink / raw)
  To: gcc-bugs


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

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

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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> 2013-01-28 14:46:59 UTC ---
Fixed.


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

end of thread, other threads:[~2013-01-28 14:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-18 14:59 [Bug tree-optimization/56034] New: ICE: verify_gimple failed (invalid PHI argument) with -ftree-loop-distribution antoine.balestrat at gmail dot com
2013-01-18 15:33 ` [Bug tree-optimization/56034] " mpolacek at gcc dot gnu.org
2013-01-18 16:57 ` [Bug tree-optimization/56034] [4.8 Regression] " mpolacek at gcc dot gnu.org
2013-01-21 13:25 ` rguenth at gcc dot gnu.org
2013-01-25 15:34 ` mpolacek at gcc dot gnu.org
2013-01-25 18:16 ` rguenth at gcc dot gnu.org
2013-01-28 11:57 ` rguenth at gcc dot gnu.org
2013-01-28 14:46 ` rguenth at gcc dot gnu.org
2013-01-28 14:47 ` 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).