public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/32705]  New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
@ 2007-07-09 16:51 rguenth at gcc dot gnu dot org
  2007-07-09 17:36 ` [Bug tree-optimization/32705] " ebotcazou at gcc dot gnu dot org
                   ` (18 more replies)
  0 siblings, 19 replies; 21+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-07-09 16:51 UTC (permalink / raw)
  To: gcc-bugs

=== acats Summary ===
# of expected passes            2269
# of unexpected failures        46

*** FAILURES: ae2113a ae2113b c38202a c85014b c87b26b c910001 c930001 c93008b
c94002b c94002d c94002e c94002f c94002g c94008c c95012a c95085a c954015 c954019
c954022 c954026 c954a03 c97113a c97201g c97201h c97201x c97202a c97205a c97205b
c97305a c97305b c97305c c97305d c974002 c974003 c974008 c974009 c974010 c974011
cc1207b cc3019c cd92001 ce2103a ce2201l ce2202a ce3815a cxh1001 

nearly all of them are of the form

+===========================GNAT BUG DETECTED==============================+
| 4.3.0 20070709 (experimental) (x86_64-unknown-linux-gnu) GCC error:      |
| in set_ssa_val_to, at tree-ssa-sccvn.c:1022                              |
| Error detected around ae2113b.adb:33                                     |
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact gcc or gnatmake command that you entered.              |
| Also include sources listed below in gnatchop format                     |
| (concatenated together with no headers between files).                   |
+==========================================================================+


-- 
           Summary: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-
                    sccvn.c:1022
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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


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

* [Bug tree-optimization/32705] [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
@ 2007-07-09 17:36 ` ebotcazou at gcc dot gnu dot org
  2007-07-09 18:11 ` dberlin at dberlin dot org
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2007-07-09 17:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from ebotcazou at gcc dot gnu dot org  2007-07-09 17:36 -------
Confirmed on platforms where the Ada compiler bootstraps at all. :-)

I plan to look at them once I've found something plausible for PR 32589.


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-07-09 17:36:22
               date|                            |


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


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

* [Bug tree-optimization/32705] [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
  2007-07-09 17:36 ` [Bug tree-optimization/32705] " ebotcazou at gcc dot gnu dot org
@ 2007-07-09 18:11 ` dberlin at dberlin dot org
  2007-07-09 18:12 ` dberlin at dberlin dot org
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: dberlin at dberlin dot org @ 2007-07-09 18:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dberlin at gcc dot gnu dot org  2007-07-09 18:11 -------
Subject: Re:  [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022

Uh, this assert was removed, so i don't know how it could still trigger ;)


On 9 Jul 2007 17:36:22 -0000, ebotcazou at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #1 from ebotcazou at gcc dot gnu dot org  2007-07-09 17:36 -------
> Confirmed on platforms where the Ada compiler bootstraps at all. :-)
>
> I plan to look at them once I've found something plausible for PR 32589.
>
>
> --
>
> ebotcazou at gcc dot gnu dot org changed:
>
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |ebotcazou at gcc dot gnu dot
>                    |                            |org
>              Status|UNCONFIRMED                 |NEW
>      Ever Confirmed|0                           |1
>    Last reconfirmed|0000-00-00 00:00:00         |2007-07-09 17:36:22
>                date|                            |
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32705
>
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
>


-- 


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


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

* [Bug tree-optimization/32705] [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
  2007-07-09 17:36 ` [Bug tree-optimization/32705] " ebotcazou at gcc dot gnu dot org
  2007-07-09 18:11 ` dberlin at dberlin dot org
@ 2007-07-09 18:12 ` dberlin at dberlin dot org
  2007-07-10  8:11 ` ebotcazou at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: dberlin at dberlin dot org @ 2007-07-09 18:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dberlin at gcc dot gnu dot org  2007-07-09 18:12 -------
Subject: Re:  New: [4.3 Regression] ICE in set_ssa_val_to, at
tree-ssa-sccvn.c:1022

Oh, this assert, sorry, i removed the other assert int his function.

This means we have discovered some very very very strange value that
an ssa name value numbers to.

Can someone paste the output of debug_generic_stmt (to) and
debug_tree(to) at the point of failure?

On 9 Jul 2007 16:50:55 -0000, rguenth at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
> === acats Summary ===
> # of expected passes            2269
> # of unexpected failures        46
>
> *** FAILURES: ae2113a ae2113b c38202a c85014b c87b26b c910001 c930001 c93008b
> c94002b c94002d c94002e c94002f c94002g c94008c c95012a c95085a c954015 c954019
> c954022 c954026 c954a03 c97113a c97201g c97201h c97201x c97202a c97205a c97205b
> c97305a c97305b c97305c c97305d c974002 c974003 c974008 c974009 c974010 c974011
> cc1207b cc3019c cd92001 ce2103a ce2201l ce2202a ce3815a cxh1001
>
> nearly all of them are of the form
>
> +===========================GNAT BUG DETECTED==============================+
> | 4.3.0 20070709 (experimental) (x86_64-unknown-linux-gnu) GCC error:      |
> | in set_ssa_val_to, at tree-ssa-sccvn.c:1022                              |
> | Error detected around ae2113b.adb:33                                     |
> | Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |
> | Use a subject line meaningful to you and us to track the bug.            |
> | Include the entire contents of this bug box in the report.               |
> | Include the exact gcc or gnatmake command that you entered.              |
> | Also include sources listed below in gnatchop format                     |
> | (concatenated together with no headers between files).                   |
> +==========================================================================+
>
>
> --
>            Summary: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-
>                     sccvn.c:1022
>            Product: gcc
>            Version: 4.3.0
>             Status: UNCONFIRMED
>           Keywords: ice-on-valid-code
>           Severity: normal
>           Priority: P3
>          Component: tree-optimization
>         AssignedTo: unassigned at gcc dot gnu dot org
>         ReportedBy: rguenth at gcc dot gnu dot org
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32705
>
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
>


-- 


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


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

* [Bug tree-optimization/32705] [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-07-09 18:12 ` dberlin at dberlin dot org
@ 2007-07-10  8:11 ` ebotcazou at gcc dot gnu dot org
  2007-07-11 20:10 ` [Bug tree-optimization/32705] [4.3 regression] " ebotcazou at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2007-07-10  8:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from ebotcazou at gcc dot gnu dot org  2007-07-10 08:11 -------
Investigating.


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|ebotcazou at gcc dot gnu dot|
                   |org                         |
         AssignedTo|unassigned at gcc dot gnu   |ebotcazou at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-07-09 17:36:22         |2007-07-10 08:11:24
               date|                            |


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


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

* [Bug tree-optimization/32705] [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-07-10  8:11 ` ebotcazou at gcc dot gnu dot org
@ 2007-07-11 20:10 ` ebotcazou at gcc dot gnu dot org
  2007-07-11 22:20   ` Daniel Berlin
  2007-07-11 22:21 ` dberlin at dberlin dot org
                   ` (13 subsequent siblings)
  18 siblings, 1 reply; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2007-07-11 20:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from ebotcazou at gcc dot gnu dot org  2007-07-11 20:10 -------
> Can someone paste the output of debug_generic_stmt (to) and
> debug_tree(to) at the point of failure?

(gdb) p debug_tree(to)
 <var_decl 0x557f7114 vn_top.181
    type <void_type 0x55716804 void sizes-gimplified visited VOID
        align 8 symtab 0 alias set 36 canonical type 0x55716804
        pointer_to_this <pointer_type 0x55716870>>
    used ignored VOID file ../c87b26b.adb line 4
    align 8>
$4 = void
(gdb) p debug_generic_stmt(to)
vn_top.181


-- 


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


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

* Re: [Bug tree-optimization/32705] [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-11 20:10 ` [Bug tree-optimization/32705] [4.3 regression] " ebotcazou at gcc dot gnu dot org
@ 2007-07-11 22:20   ` Daniel Berlin
  0 siblings, 0 replies; 21+ messages in thread
From: Daniel Berlin @ 2007-07-11 22:20 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs

The only way i can see this happening is if you have a truly
uninitialized variable, or there is something we have missed.

Does this function have cfun->static_chain_decl being used, and we
have a copy of that here?

It is theoretically safe to call set_ssa_to_val with to == vn_top, but
it's probably a bug somewhere, and i'd rather eliminate the bug cases
before turning it off.

On 11 Jul 2007 20:10:10 -0000, ebotcazou at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #5 from ebotcazou at gcc dot gnu dot org  2007-07-11 20:10 -------
> > Can someone paste the output of debug_generic_stmt (to) and
> > debug_tree(to) at the point of failure?
>
> (gdb) p debug_tree(to)
>  <var_decl 0x557f7114 vn_top.181
>     type <void_type 0x55716804 void sizes-gimplified visited VOID
>         align 8 symtab 0 alias set 36 canonical type 0x55716804
>         pointer_to_this <pointer_type 0x55716870>>
>     used ignored VOID file ../c87b26b.adb line 4
>     align 8>
> $4 = void
> (gdb) p debug_generic_stmt(to)
> vn_top.181
>
>
> --
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32705
>
>


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

* [Bug tree-optimization/32705] [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-07-11 20:10 ` [Bug tree-optimization/32705] [4.3 regression] " ebotcazou at gcc dot gnu dot org
@ 2007-07-11 22:21 ` dberlin at dberlin dot org
  2007-07-13 14:37 ` ebotcazou at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: dberlin at dberlin dot org @ 2007-07-11 22:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from dberlin at gcc dot gnu dot org  2007-07-11 22:20 -------
Subject: Re:  [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022

The only way i can see this happening is if you have a truly
uninitialized variable, or there is something we have missed.

Does this function have cfun->static_chain_decl being used, and we
have a copy of that here?

It is theoretically safe to call set_ssa_to_val with to == vn_top, but
it's probably a bug somewhere, and i'd rather eliminate the bug cases
before turning it off.

On 11 Jul 2007 20:10:10 -0000, ebotcazou at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #5 from ebotcazou at gcc dot gnu dot org  2007-07-11 20:10 -------
> > Can someone paste the output of debug_generic_stmt (to) and
> > debug_tree(to) at the point of failure?
>
> (gdb) p debug_tree(to)
>  <var_decl 0x557f7114 vn_top.181
>     type <void_type 0x55716804 void sizes-gimplified visited VOID
>         align 8 symtab 0 alias set 36 canonical type 0x55716804
>         pointer_to_this <pointer_type 0x55716870>>
>     used ignored VOID file ../c87b26b.adb line 4
>     align 8>
> $4 = void
> (gdb) p debug_generic_stmt(to)
> vn_top.181
>
>
> --
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32705
>
>


-- 


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


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

* [Bug tree-optimization/32705] [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-07-11 22:21 ` dberlin at dberlin dot org
@ 2007-07-13 14:37 ` ebotcazou at gcc dot gnu dot org
  2007-07-13 15:12 ` ebotcazou at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2007-07-13 14:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from ebotcazou at gcc dot gnu dot org  2007-07-13 14:37 -------
> Does this function have cfun->static_chain_decl being used, and we
> have a copy of that here?

No, it's a toplevel function.

> It is theoretically safe to call set_ssa_to_val with to == vn_top, but
> it's probably a bug somewhere, and i'd rather eliminate the bug cases
> before turning it off.

visit_phi is called on a PHI node with 1 argument (shrinked by DOM):

  # NMT.152_89(ab) = PHI <NMT.152_264(ab)(22)>

and the SSA_VAL of NMT.152_264 is VN_TOP.


-- 


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


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

* [Bug tree-optimization/32705] [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-07-13 14:37 ` ebotcazou at gcc dot gnu dot org
@ 2007-07-13 15:12 ` ebotcazou at gcc dot gnu dot org
  2007-07-13 15:49 ` ebotcazou at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2007-07-13 15:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from ebotcazou at gcc dot gnu dot org  2007-07-13 15:12 -------
> visit_phi is called on a PHI node with 1 argument (shrinked by DOM):

I presume this degenerated PHI is not eliminated because it is abnormal:

(gdb) p debug_tree(phi)
 <phi_node 0x5577f700 asm_written>

(gdb) p debug_tree(def)
 <ssa_name 0x557f04e0
    type <record_type 0x5577672c string___XUB readonly DI
        size <integer_cst 0x55709738 constant invariant 64>
        unit size <integer_cst 0x55709754 constant invariant 8>
        align 32 symtab 0 alias set 45 canonical type 0x5577672c
        fields <field_decl 0x5576a5a0 LB0 type <integer_type 0x557162f4
integer>
            nonaddressable SI file gcc/ada/rts/a-except.ads line 306
            size <integer_cst 0x5570963c constant invariant 32>
            unit size <integer_cst 0x55709428 constant invariant 4>
            align 32 offset_align 128
            offset <integer_cst 0x55709968 constant invariant 0>
            bit offset <integer_cst 0x55709984 constant invariant 0> context
<record_type 0x5577672c string___XUB> chain <field_decl 0x5576a600 UB0>> Ada
size <integer_cst 0x55709738 64>
        pointer_to_this <pointer_type 0x55776798> chain <type_decl 0x55776b64
D.690>>
    asm_written visited var <name_memory_tag 0x557de958 NMT.152> def_stmt
<call_expr 0x5571439c>
    version 264 in-abnormal-phi>

/* Propagate RHS into all uses of LHS (when possible).

   RHS and LHS are derived from STMT, which is passed in solely so
   that we can remove it if propagation is successful.

   When propagating into a PHI node or into a statement which turns
   into a trivial copy or constant initialization, set the
   appropriate bit in INTERESTING_NAMEs so that we will visit those
   nodes as well in an effort to pick up secondary optimization
   opportunities.  */

static void 
propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap
interesting_names)
{
  /* First verify that propagation is valid and isn't going to move a
     loop variant variable outside its loop.  */
  if (! SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs)
      && (TREE_CODE (rhs) != SSA_NAME
          || ! SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rhs))


-- 


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


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

* [Bug tree-optimization/32705] [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2007-07-13 15:12 ` ebotcazou at gcc dot gnu dot org
@ 2007-07-13 15:49 ` ebotcazou at gcc dot gnu dot org
  2007-07-13 16:47 ` dberlin at dberlin dot org
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2007-07-13 15:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from ebotcazou at gcc dot gnu dot org  2007-07-13 15:48 -------
And of course the naive patch:

eric@linux:~/svn/gcc/gcc> Index: tree-ssa-sccvn.c
===================================================================
--- tree-ssa-sccvn.c    (revision 126547)
+++ tree-ssa-sccvn.c    (working copy)
@@ -1279,7 +1279,7 @@ visit_phi (tree phi)

   /* If all value numbered to the same value, the phi node has that
      value.  */
-  if (allsame)
+  if (allsame && sameval != VN_TOP)
     {
       if (is_gimple_min_invariant (sameval))
        {


-- 


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


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

* [Bug tree-optimization/32705] [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2007-07-13 15:49 ` ebotcazou at gcc dot gnu dot org
@ 2007-07-13 16:47 ` dberlin at dberlin dot org
  2007-07-13 17:16 ` ebotcazou at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: dberlin at dberlin dot org @ 2007-07-13 16:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from dberlin at gcc dot gnu dot org  2007-07-13 16:47 -------
Subject: Re:  [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022

On 13 Jul 2007 15:49:03 -0000, ebotcazou at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #9 from ebotcazou at gcc dot gnu dot org  2007-07-13 15:48 -------
> And of course the naive patch:
>
> eric@linux:~/svn/gcc/gcc> Index: tree-ssa-sccvn.c
> ===================================================================
> --- tree-ssa-sccvn.c    (revision 126547)
> +++ tree-ssa-sccvn.c    (working copy)
> @@ -1279,7 +1279,7 @@ visit_phi (tree phi)
>
>    /* If all value numbered to the same value, the phi node has that
>       value.  */
> -  if (allsame)
> +  if (allsame && sameval != VN_TOP)
>      {
>        if (is_gimple_min_invariant (sameval))
>         {
>

Nah, that's not quite right, since this is a legal value.
Instead, where we init everything to VN_TOP, init everything with
SSA_NAME_OCCURS_IN_ABNORMAL_PHI to itself instead of VN_TOP.

IE VN_INFO (a)->valnum = a iff SSA_NAME_OCCURS_IN_ABNORMAL_PHI (a)


-- 


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


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

* [Bug tree-optimization/32705] [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2007-07-13 16:47 ` dberlin at dberlin dot org
@ 2007-07-13 17:16 ` ebotcazou at gcc dot gnu dot org
  2007-07-13 17:19 ` dberlin at dberlin dot org
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2007-07-13 17:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from ebotcazou at gcc dot gnu dot org  2007-07-13 17:16 -------
> Nah, that's not quite right, since this is a legal value.
> Instead, where we init everything to VN_TOP, init everything with
> SSA_NAME_OCCURS_IN_ABNORMAL_PHI to itself instead of VN_TOP.

Note that we already deal with SSA_NAME_OCCURS_IN_ABNORMAL_PHI in visit_use,
but not for PHI nodes:

      if (TREE_CODE (stmt) == PHI_NODE)
        {
          changed = visit_phi (stmt);
        }
      else if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT
               || (ann && ann->has_volatile_ops))
        {
          changed = defs_to_varying (stmt);
        }

[...]

          if (TREE_CODE (lhs) == SSA_NAME
              && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
            changed = defs_to_varying (stmt);

What about doing the same for them?


-- 


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


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

* [Bug tree-optimization/32705] [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2007-07-13 17:16 ` ebotcazou at gcc dot gnu dot org
@ 2007-07-13 17:19 ` dberlin at dberlin dot org
  2007-07-13 19:09 ` ebotcazou at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: dberlin at dberlin dot org @ 2007-07-13 17:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from dberlin at gcc dot gnu dot org  2007-07-13 17:18 -------
Subject: Re:  [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022

On 13 Jul 2007 17:16:27 -0000, ebotcazou at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #11 from ebotcazou at gcc dot gnu dot org  2007-07-13 17:16 -------
> > Nah, that's not quite right, since this is a legal value.
> > Instead, where we init everything to VN_TOP, init everything with
> > SSA_NAME_OCCURS_IN_ABNORMAL_PHI to itself instead of VN_TOP.
>
> Note that we already deal with SSA_NAME_OCCURS_IN_ABNORMAL_PHI in visit_use,
> but not for PHI nodes:
>
>       if (TREE_CODE (stmt) == PHI_NODE)
>         {
>           changed = visit_phi (stmt);
>         }
>       else if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT
>                || (ann && ann->has_volatile_ops))
>         {
>           changed = defs_to_varying (stmt);
>         }
>
> [...]
>
>           if (TREE_CODE (lhs) == SSA_NAME
>               && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
>             changed = defs_to_varying (stmt);
>
> What about doing the same for them?

Sure, that would work too.


-- 


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


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

* [Bug tree-optimization/32705] [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2007-07-13 17:19 ` dberlin at dberlin dot org
@ 2007-07-13 19:09 ` ebotcazou at gcc dot gnu dot org
  2007-07-13 20:43 ` ebotcazou at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2007-07-13 19:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from ebotcazou at gcc dot gnu dot org  2007-07-13 19:09 -------
> What about doing the same for them?

That doesn't work as easily as I expected. :-)

Now I get the same assertion failure for non-degenerate PHI nodes whose result
is not SSA_NAME_OCCURS_IN_ABNORMAL_PHI but whose operands are, so something
like

--- tree-ssa-sccvn.c    (revision 126547)
+++ tree-ssa-sccvn.c    (working copy)
@@ -1502,7 +1502,11 @@ visit_use (tree use)
     {
       if (TREE_CODE (stmt) == PHI_NODE)
        {
-         changed = visit_phi (stmt);
+         tree result = PHI_RESULT (stmt);
+         if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (result))
+           changed = set_ssa_val_to (result, result);
+         else
+           changed = visit_phi (stmt);
        }
       else if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT
               || (ann && ann->has_volatile_ops))

is not sufficient.  So I'm going to test your solution.


-- 


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


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

* [Bug tree-optimization/32705] [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
                   ` (12 preceding siblings ...)
  2007-07-13 19:09 ` ebotcazou at gcc dot gnu dot org
@ 2007-07-13 20:43 ` ebotcazou at gcc dot gnu dot org
  2007-07-14  2:05 ` dberlin at dberlin dot org
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2007-07-13 20:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from ebotcazou at gcc dot gnu dot org  2007-07-13 20:43 -------
> Instead, where we init everything to VN_TOP, init everything with
> SSA_NAME_OCCURS_IN_ABNORMAL_PHI to itself instead of VN_TOP.

@@ -1912,13 +1912,16 @@ init_scc_vn (void)
   VN_TOP = create_tmp_var_raw (void_type_node, "vn_top");

   /* Create the VN_INFO structures, and initialize value numbers to
-     TOP.  */
+     TOP, except for SSA names appearing in abnormal PHI nodes.  */
   for (i = 0; i < num_ssa_names; i++)
     {
       tree name = ssa_name (i);
       if (name)
        {
-         VN_INFO_GET (name)->valnum = VN_TOP;
+         if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (name))
+           VN_INFO_GET (name)->valnum = name;
+         else
+           VN_INFO_GET (name)->valnum = VN_TOP;
          VN_INFO (name)->expr = name;
        }
     }

is not sufficient to eliminate all the failures.  I get the same assertion
failure for non-degenerate PHI nodes without SSA_NAME_OCCURS_IN_ABNORMAL_PHI
anywhere, all operands having SSA_VAL set to VN_TOP.  Top-level function too.


-- 


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


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

* [Bug tree-optimization/32705] [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
                   ` (13 preceding siblings ...)
  2007-07-13 20:43 ` ebotcazou at gcc dot gnu dot org
@ 2007-07-14  2:05 ` dberlin at dberlin dot org
  2007-07-14  6:12 ` ebotcazou at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: dberlin at dberlin dot org @ 2007-07-14  2:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from dberlin at gcc dot gnu dot org  2007-07-14 02:04 -------
Subject: Re:  [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022

On 13 Jul 2007 20:43:37 -0000, ebotcazou at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #14 from ebotcazou at gcc dot gnu dot org  2007-07-13 20:43 -------
> > Instead, where we init everything to VN_TOP, init everything with
> > SSA_NAME_OCCURS_IN_ABNORMAL_PHI to itself instead of VN_TOP.
>
> @@ -1912,13 +1912,16 @@ init_scc_vn (void)
>    VN_TOP = create_tmp_var_raw (void_type_node, "vn_top");
>
>    /* Create the VN_INFO structures, and initialize value numbers to
> -     TOP.  */
> +     TOP, except for SSA names appearing in abnormal PHI nodes.  */
>    for (i = 0; i < num_ssa_names; i++)
>      {
>        tree name = ssa_name (i);
>        if (name)
>         {
> -         VN_INFO_GET (name)->valnum = VN_TOP;
> +         if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (name))
> +           VN_INFO_GET (name)->valnum = name;
> +         else
> +           VN_INFO_GET (name)->valnum = VN_TOP;
>           VN_INFO (name)->expr = name;
>         }
>      }
>
> is not sufficient to eliminate all the failures.  I get the same assertion
> failure for non-degenerate PHI nodes without SSA_NAME_OCCURS_IN_ABNORMAL_PHI
> anywhere, all operands having SSA_VAL set to VN_TOP.  Top-level function too.

Change the assert to allow to == VN_TOP.
It can happen when we have aliasing issues, and we believe some piece
of memory/a value to be truly undefined.
This is what is happening in your case, and since your case is legal,
we must allow it.
It's likely a bug in the rest of the compiler, however, since we
should almost *never* end up with bare NMT's like that.


-- 


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


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

* [Bug tree-optimization/32705] [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
                   ` (14 preceding siblings ...)
  2007-07-14  2:05 ` dberlin at dberlin dot org
@ 2007-07-14  6:12 ` ebotcazou at gcc dot gnu dot org
  2007-07-14  8:44 ` ebotcazou at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2007-07-14  6:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from ebotcazou at gcc dot gnu dot org  2007-07-14 06:12 -------
> Change the assert to allow to == VN_TOP.
> It can happen when we have aliasing issues, and we believe some piece
> of memory/a value to be truly undefined.
> This is what is happening in your case, and since your case is legal,
> we must allow it.
> It's likely a bug in the rest of the compiler, however, since we
> should almost *never* end up with bare NMT's like that.

OK, thanks.


-- 


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


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

* [Bug tree-optimization/32705] [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
                   ` (15 preceding siblings ...)
  2007-07-14  6:12 ` ebotcazou at gcc dot gnu dot org
@ 2007-07-14  8:44 ` ebotcazou at gcc dot gnu dot org
  2007-07-14  8:46 ` ebotcazou at gcc dot gnu dot org
  2007-07-21  8:37 ` pinskia at gcc dot gnu dot org
  18 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2007-07-14  8:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from ebotcazou at gcc dot gnu dot org  2007-07-14 08:43 -------
Subject: Bug 32705

Author: ebotcazou
Date: Sat Jul 14 08:43:48 2007
New Revision: 126637

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126637
Log:
        PR tree-optimization/32705
        * tree-ssa-sccvn.c (set_ssa_val_to): Accept VN_TOP as value number.
        (simplify_binary_expression): Use SSA_VAL consistently.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-ssa-sccvn.c


-- 


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


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

* [Bug tree-optimization/32705] [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
                   ` (16 preceding siblings ...)
  2007-07-14  8:44 ` ebotcazou at gcc dot gnu dot org
@ 2007-07-14  8:46 ` ebotcazou at gcc dot gnu dot org
  2007-07-21  8:37 ` pinskia at gcc dot gnu dot org
  18 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2007-07-14  8:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from ebotcazou at gcc dot gnu dot org  2007-07-14 08:46 -------
The ACATS testsuite is in nominal state again.


-- 

ebotcazou at gcc dot gnu dot org changed:

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


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


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

* [Bug tree-optimization/32705] [4.3 regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022
  2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
                   ` (17 preceding siblings ...)
  2007-07-14  8:46 ` ebotcazou at gcc dot gnu dot org
@ 2007-07-21  8:37 ` pinskia at gcc dot gnu dot org
  18 siblings, 0 replies; 21+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-07-21  8:37 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.3.0


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


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

end of thread, other threads:[~2007-07-21  8:37 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-09 16:51 [Bug tree-optimization/32705] New: [4.3 Regression] ICE in set_ssa_val_to, at tree-ssa-sccvn.c:1022 rguenth at gcc dot gnu dot org
2007-07-09 17:36 ` [Bug tree-optimization/32705] " ebotcazou at gcc dot gnu dot org
2007-07-09 18:11 ` dberlin at dberlin dot org
2007-07-09 18:12 ` dberlin at dberlin dot org
2007-07-10  8:11 ` ebotcazou at gcc dot gnu dot org
2007-07-11 20:10 ` [Bug tree-optimization/32705] [4.3 regression] " ebotcazou at gcc dot gnu dot org
2007-07-11 22:20   ` Daniel Berlin
2007-07-11 22:21 ` dberlin at dberlin dot org
2007-07-13 14:37 ` ebotcazou at gcc dot gnu dot org
2007-07-13 15:12 ` ebotcazou at gcc dot gnu dot org
2007-07-13 15:49 ` ebotcazou at gcc dot gnu dot org
2007-07-13 16:47 ` dberlin at dberlin dot org
2007-07-13 17:16 ` ebotcazou at gcc dot gnu dot org
2007-07-13 17:19 ` dberlin at dberlin dot org
2007-07-13 19:09 ` ebotcazou at gcc dot gnu dot org
2007-07-13 20:43 ` ebotcazou at gcc dot gnu dot org
2007-07-14  2:05 ` dberlin at dberlin dot org
2007-07-14  6:12 ` ebotcazou at gcc dot gnu dot org
2007-07-14  8:44 ` ebotcazou at gcc dot gnu dot org
2007-07-14  8:46 ` ebotcazou at gcc dot gnu dot org
2007-07-21  8:37 ` pinskia 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).