public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/57993] New: ICE: verify_ssa failed (definition in block n does not dominate use in block m)
@ 2013-07-26 11:30 antoine.balestrat at gmail dot com
  2013-07-26 12:54 ` [Bug tree-optimization/57993] [4.9 Regression] " mpolacek at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: antoine.balestrat at gmail dot com @ 2013-07-26 11:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57993
           Summary: ICE: verify_ssa failed (definition in block n does not
                    dominate use in block m)
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: antoine.balestrat at gmail dot com

Hello !
I'm using GCC 4.9.0 as of 20130726 :

$ cat dom.c
int a, b, c, d;
char e;
unsigned g;

void f(void)
{
    int h;

    for(; d; d++)
        if(d)
lbl:
            g + a || (d = 0);

    b && (a = e);

    for(h = 0; h < 1; ++h)
    {
        h = c ? : (d = 0);
        g = a = (e | 0);
    }

    if(a)
        goto lbl;

    a = e = 0;
    goto lbl;
}

$ xgcc -w -O2 dom.c
dom.c: In function ‘f’:
dom.c:5:6: error: definition in block 11 does not dominate use in block 10
 void f(void)
      ^
for SSA_NAME: pretmp_51 in statement:
slsr_41 = PHI <pretmp_51(10), pretmp_51(9)>
PHI argument
pretmp_51
for PHI node
slsr_41 = PHI <pretmp_51(10), pretmp_51(9)>
dom.c:5:6: internal compiler error: verify_ssa failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
>From gcc-bugs-return-426759-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jul 26 11:49:43 2013
Return-Path: <gcc-bugs-return-426759-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 14568 invoked by alias); 26 Jul 2013 11:49:43 -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 14487 invoked by uid 48); 26 Jul 2013 11:49:40 -0000
From: "henner.sudek at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/57974] std::pow(std::complex<long double>(0),1) returns  (-nan,-nan)
Date: Fri, 26 Jul 2013 11:49:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: henner.sudek at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-57974-4-lihjor9ULv@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57974-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57974-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: 2013-07/txt/msg01266.txt.bz2
Content-length: 356

http://gcc.gnu.org/bugzilla/show_bug.cgi?idW974

--- Comment #14 from Henner Sudek <henner.sudek at gmail dot com> ---
First i want to thank you all for the quick response and solving my problem. I
just want to point out that std::pow(std::complex<long double>(0,0),1.) still
returns nan. Maybe there is an way to unify the behavior of these functions?


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

* [Bug tree-optimization/57993] [4.9 Regression] ICE: verify_ssa failed (definition in block n does not dominate use in block m)
  2013-07-26 11:30 [Bug tree-optimization/57993] New: ICE: verify_ssa failed (definition in block n does not dominate use in block m) antoine.balestrat at gmail dot com
@ 2013-07-26 12:54 ` mpolacek at gcc dot gnu.org
  2013-07-26 13:14 ` mpolacek at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-07-26 12:54 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-07-26
                 CC|                            |mpolacek at gcc dot gnu.org
      Known to work|                            |4.8.1
   Target Milestone|---                         |4.9.0
            Summary|ICE: verify_ssa failed      |[4.9 Regression] ICE:
                   |(definition in block n does |verify_ssa failed
                   |not dominate use in block   |(definition in block n does
                   |m)                          |not dominate use in block
                   |                            |m)
     Ever confirmed|0                           |1
      Known to fail|                            |4.9.0

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.


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

* [Bug tree-optimization/57993] [4.9 Regression] ICE: verify_ssa failed (definition in block n does not dominate use in block m)
  2013-07-26 11:30 [Bug tree-optimization/57993] New: ICE: verify_ssa failed (definition in block n does not dominate use in block m) antoine.balestrat at gmail dot com
  2013-07-26 12:54 ` [Bug tree-optimization/57993] [4.9 Regression] " mpolacek at gcc dot gnu.org
@ 2013-07-26 13:14 ` mpolacek at gcc dot gnu.org
  2013-07-26 16:36 ` wschmidt at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-07-26 13:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with http://gcc.gnu.org/r198627


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

* [Bug tree-optimization/57993] [4.9 Regression] ICE: verify_ssa failed (definition in block n does not dominate use in block m)
  2013-07-26 11:30 [Bug tree-optimization/57993] New: ICE: verify_ssa failed (definition in block n does not dominate use in block m) antoine.balestrat at gmail dot com
  2013-07-26 12:54 ` [Bug tree-optimization/57993] [4.9 Regression] " mpolacek at gcc dot gnu.org
  2013-07-26 13:14 ` mpolacek at gcc dot gnu.org
@ 2013-07-26 16:36 ` wschmidt at gcc dot gnu.org
  2013-07-26 16:46 ` mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2013-07-26 16:36 UTC (permalink / raw)
  To: gcc-bugs

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

Bill Schmidt <wschmidt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |wschmidt at gcc dot gnu.org

--- Comment #3 from Bill Schmidt <wschmidt at gcc dot gnu.org> ---
Mine.  I'll investigate.

To reproduce this on powerpc64-unknown-linux-gnu requires adding -fsigned-char
to the compile flags (a clue!).

Bill


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

* [Bug tree-optimization/57993] [4.9 Regression] ICE: verify_ssa failed (definition in block n does not dominate use in block m)
  2013-07-26 11:30 [Bug tree-optimization/57993] New: ICE: verify_ssa failed (definition in block n does not dominate use in block m) antoine.balestrat at gmail dot com
                   ` (2 preceding siblings ...)
  2013-07-26 16:36 ` wschmidt at gcc dot gnu.org
@ 2013-07-26 16:46 ` mpolacek at gcc dot gnu.org
  2013-07-26 17:25 ` wschmidt at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-07-26 16:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Thanks.  I'd guess that something in slsr_process_phi causes this, but so far I
don't know much more.


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

* [Bug tree-optimization/57993] [4.9 Regression] ICE: verify_ssa failed (definition in block n does not dominate use in block m)
  2013-07-26 11:30 [Bug tree-optimization/57993] New: ICE: verify_ssa failed (definition in block n does not dominate use in block m) antoine.balestrat at gmail dot com
                   ` (3 preceding siblings ...)
  2013-07-26 16:46 ` mpolacek at gcc dot gnu.org
@ 2013-07-26 17:25 ` wschmidt at gcc dot gnu.org
  2013-07-26 18:18 ` wschmidt at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2013-07-26 17:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Bill Schmidt <wschmidt at gcc dot gnu.org> ---
Looks like the casting is confusing us into replacing PHIs not dominated by the
prospective basis.  Shouldn't be too hard to fix.


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

* [Bug tree-optimization/57993] [4.9 Regression] ICE: verify_ssa failed (definition in block n does not dominate use in block m)
  2013-07-26 11:30 [Bug tree-optimization/57993] New: ICE: verify_ssa failed (definition in block n does not dominate use in block m) antoine.balestrat at gmail dot com
                   ` (4 preceding siblings ...)
  2013-07-26 17:25 ` wschmidt at gcc dot gnu.org
@ 2013-07-26 18:18 ` wschmidt at gcc dot gnu.org
  2013-07-28  0:53 ` wschmidt at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2013-07-26 18:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Bill Schmidt <wschmidt at gcc dot gnu.org> ---
Here's the patch I'm currently testing, which corrects the problem for this
test case.  We'll see how it does on regressions.

Index: gcc/gimple-ssa-strength-reduction.c
===================================================================
--- gcc/gimple-ssa-strength-reduction.c    (revision 201267)
+++ gcc/gimple-ssa-strength-reduction.c    (working copy)
@@ -2179,6 +2179,18 @@ phi_add_costs (gimple phi, slsr_cand_t c, int one_
   int cost = 0;
   slsr_cand_t phi_cand = base_cand_from_table (gimple_phi_result (phi));

+  /* If we work our way back to a phi that isn't dominated by the hidden
+     basis, this isn't a candidate for replacement.  Indicate this by
+     returning an unreasonably high cost.  It's not easy to detect
+     these situations when determining the basis, so we defer the
+     decision until now.  */
+  basic_block phi_bb = gimple_bb (phi_cand->cand_stmt);
+  slsr_cand_t basis = lookup_cand (c->basis);
+  basic_block basis_bb = gimple_bb (basis->cand_stmt);
+
+  if (phi_bb == basis_bb || !dominated_by_p (CDI_DOMINATORS, phi_bb,
basis_bb))
+    return COST_INFINITE;
+
   for (i = 0; i < gimple_phi_num_args (phi); i++)
     {
       tree arg = gimple_phi_arg_def (phi, i);


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

* [Bug tree-optimization/57993] [4.9 Regression] ICE: verify_ssa failed (definition in block n does not dominate use in block m)
  2013-07-26 11:30 [Bug tree-optimization/57993] New: ICE: verify_ssa failed (definition in block n does not dominate use in block m) antoine.balestrat at gmail dot com
                   ` (5 preceding siblings ...)
  2013-07-26 18:18 ` wschmidt at gcc dot gnu.org
@ 2013-07-28  0:53 ` wschmidt at gcc dot gnu.org
  2013-07-30  1:02 ` wschmidt at gcc dot gnu.org
  2013-08-03 14:42 ` wschmidt at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2013-07-28  0:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Bill Schmidt <wschmidt at gcc dot gnu.org> ---
More complete fix submitted as
http://gcc.gnu.org/ml/gcc-patches/2013-07/msg01326.html.


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

* [Bug tree-optimization/57993] [4.9 Regression] ICE: verify_ssa failed (definition in block n does not dominate use in block m)
  2013-07-26 11:30 [Bug tree-optimization/57993] New: ICE: verify_ssa failed (definition in block n does not dominate use in block m) antoine.balestrat at gmail dot com
                   ` (6 preceding siblings ...)
  2013-07-28  0:53 ` wschmidt at gcc dot gnu.org
@ 2013-07-30  1:02 ` wschmidt at gcc dot gnu.org
  2013-08-03 14:42 ` wschmidt at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2013-07-30  1:02 UTC (permalink / raw)
  To: gcc-bugs

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

Bill Schmidt <wschmidt at gcc dot gnu.org> changed:

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

--- Comment #8 from Bill Schmidt <wschmidt at gcc dot gnu.org> ---
Fixed as r201325.


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

* [Bug tree-optimization/57993] [4.9 Regression] ICE: verify_ssa failed (definition in block n does not dominate use in block m)
  2013-07-26 11:30 [Bug tree-optimization/57993] New: ICE: verify_ssa failed (definition in block n does not dominate use in block m) antoine.balestrat at gmail dot com
                   ` (7 preceding siblings ...)
  2013-07-30  1:02 ` wschmidt at gcc dot gnu.org
@ 2013-08-03 14:42 ` wschmidt at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2013-08-03 14:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Bill Schmidt <wschmidt at gcc dot gnu.org> ---
I missed a couple of candidate replacements in the previous fix; these are
fixed in r201466.


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

end of thread, other threads:[~2013-08-03 14:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-26 11:30 [Bug tree-optimization/57993] New: ICE: verify_ssa failed (definition in block n does not dominate use in block m) antoine.balestrat at gmail dot com
2013-07-26 12:54 ` [Bug tree-optimization/57993] [4.9 Regression] " mpolacek at gcc dot gnu.org
2013-07-26 13:14 ` mpolacek at gcc dot gnu.org
2013-07-26 16:36 ` wschmidt at gcc dot gnu.org
2013-07-26 16:46 ` mpolacek at gcc dot gnu.org
2013-07-26 17:25 ` wschmidt at gcc dot gnu.org
2013-07-26 18:18 ` wschmidt at gcc dot gnu.org
2013-07-28  0:53 ` wschmidt at gcc dot gnu.org
2013-07-30  1:02 ` wschmidt at gcc dot gnu.org
2013-08-03 14:42 ` wschmidt 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).