public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/64353] New: ICE: in execute_todo, at passes.c:1986
@ 2014-12-18 17:40 adam at os dot inf.tu-dresden.de
  2014-12-19 11:50 ` [Bug middle-end/64353] [5 Regression] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: adam at os dot inf.tu-dresden.de @ 2014-12-18 17:40 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 3783 bytes --]

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

            Bug ID: 64353
           Summary: ICE: in execute_todo, at passes.c:1986
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: adam at os dot inf.tu-dresden.de

The following code generates an ICE:

class C 
{
  int y, x;
  void i();
  bool __attribute__((const)) xx() { return x; }
};

void C::i()
{
  if (xx())
    x = 1;
}

$ g++ -c -O2 t.i
t.i: In member function ‘void C::i()’:
t.i:12:1: internal compiler error: in execute_todo, at passes.c:1986
 }
 ^
0xbc7b28 execute_todo
        ../../gcc/gcc/passes.c:1986
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.

$ g++ --version
g++ (GCC) 5.0.0 20141218 (experimental)

Admittedly the attribute((const)) should not be there. Also, removing 'y' will
also not emit an ICE.
>From gcc-bugs-return-471089-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Dec 18 17:41:38 2014
Return-Path: <gcc-bugs-return-471089-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 2415 invoked by alias); 18 Dec 2014 17:41:38 -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 2095 invoked by uid 48); 18 Dec 2014 17:41:34 -0000
From: "rrh at newrelic dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/64354] New: no preprocessor symbol __SANITIZE_THREAD__
Date: Thu, 18 Dec 2014 17:41:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: sanitizer
X-Bugzilla-Version: 4.9.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rrh at newrelic dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc
Message-ID: <bug-64354-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: 2014-12/txt/msg02096.txt.bz2
Content-length: 873

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

            Bug ID: 64354
           Summary: no preprocessor symbol __SANITIZE_THREAD__
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rrh at newrelic dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org

compiling
 gcc -fsanitize=thread
does not pre-define preprocessor symbol __SANITIZE_THREAD__ (bad)

however, compiling
 gcc -fsanitize­dress
does pre-define preprocessor symbol __SANITIZE_ADDRESS__ (good)

The situations should be symmetric.  I would suggest adding __SANITIZE_THREAD__
rather than deleting __SANITIZE_ADDRESS__.


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

* [Bug middle-end/64353] [5 Regression] ICE: in execute_todo, at passes.c:1986
  2014-12-18 17:40 [Bug c++/64353] New: ICE: in execute_todo, at passes.c:1986 adam at os dot inf.tu-dresden.de
@ 2014-12-19 11:50 ` rguenth at gcc dot gnu.org
  2015-01-05  9:54 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-12-19 11:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-12-19
          Component|c++                         |middle-end
      Known to work|                            |4.9.2
   Target Milestone|---                         |5.0
            Summary|ICE: in execute_todo, at    |[5 Regression] ICE: in
                   |passes.c:1986               |execute_todo, at
                   |                            |passes.c:1986
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.


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

* [Bug middle-end/64353] [5 Regression] ICE: in execute_todo, at passes.c:1986
  2014-12-18 17:40 [Bug c++/64353] New: ICE: in execute_todo, at passes.c:1986 adam at os dot inf.tu-dresden.de
  2014-12-19 11:50 ` [Bug middle-end/64353] [5 Regression] " rguenth at gcc dot gnu.org
@ 2015-01-05  9:54 ` jakub at gcc dot gnu.org
  2015-01-07  9:52 ` trippels 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-05  9:54 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r217125.


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

* [Bug middle-end/64353] [5 Regression] ICE: in execute_todo, at passes.c:1986
  2014-12-18 17:40 [Bug c++/64353] New: ICE: in execute_todo, at passes.c:1986 adam at os dot inf.tu-dresden.de
  2014-12-19 11:50 ` [Bug middle-end/64353] [5 Regression] " rguenth at gcc dot gnu.org
  2015-01-05  9:54 ` jakub at gcc dot gnu.org
@ 2015-01-07  9:52 ` trippels at gcc dot gnu.org
  2015-01-07  9:59 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-01-07  9:52 UTC (permalink / raw)
  To: gcc-bugs

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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

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

--- Comment #3 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
This bug triggers several times when building binutils.
Ilya?


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

* [Bug middle-end/64353] [5 Regression] ICE: in execute_todo, at passes.c:1986
  2014-12-18 17:40 [Bug c++/64353] New: ICE: in execute_todo, at passes.c:1986 adam at os dot inf.tu-dresden.de
                   ` (2 preceding siblings ...)
  2015-01-07  9:52 ` trippels at gcc dot gnu.org
@ 2015-01-07  9:59 ` jakub at gcc dot gnu.org
  2015-01-12 15:36 ` enkovich.gnu at gmail dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-01-07  9:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This really worries me a lot, when -fcheck-pointer-bounds is not enabled, I'd
really hope that the ipa-chkp changes make no difference at all on the
generated code or order of passes.


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

* [Bug middle-end/64353] [5 Regression] ICE: in execute_todo, at passes.c:1986
  2014-12-18 17:40 [Bug c++/64353] New: ICE: in execute_todo, at passes.c:1986 adam at os dot inf.tu-dresden.de
                   ` (3 preceding siblings ...)
  2015-01-07  9:59 ` jakub at gcc dot gnu.org
@ 2015-01-12 15:36 ` enkovich.gnu at gmail dot com
  2015-01-14 15:35 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: enkovich.gnu at gmail dot com @ 2015-01-12 15:36 UTC (permalink / raw)
  To: gcc-bugs

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

Ilya Enkovich <enkovich.gnu at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |enkovich.gnu at gmail dot com

--- Comment #5 from Ilya Enkovich <enkovich.gnu at gmail dot com> ---
When we process function C::xx early_ipa_sra pass performs a modification of
C::i in ipa_modify_call_arguments adding a load statements.  It marks function
C::i as requiring ssa renaming for vops.  Later we start processing of C::i and
get ICE at execute_todo (pass->todo_flags_start) because it expects update ssa
flags for functions requiring such update.

Before r217125 it worked because C::i was not in SSA form at the moment of load
insertion.

To fix it we may either call update_ssa from ipa_modify_call_arguments or add
update into todo_flags_start of fixup_cfg (we run it at the beginning of all
gimple passes lists anyway).

Possible fix (helps for the test, not fully tested):

diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 01f4111..533dcfe 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -4054,6 +4054,8 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gcall
*stmt,
                    expr = create_tmp_reg (TREE_TYPE (expr));
                  gimple_assign_set_lhs (tem, expr);
                  gsi_insert_before (&gsi, tem, GSI_SAME_STMT);
+                 if (gimple_in_ssa_p (cfun))
+                   update_ssa (TODO_update_ssa_only_virtuals);
                }
            }
          else


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

* [Bug middle-end/64353] [5 Regression] ICE: in execute_todo, at passes.c:1986
  2014-12-18 17:40 [Bug c++/64353] New: ICE: in execute_todo, at passes.c:1986 adam at os dot inf.tu-dresden.de
                   ` (4 preceding siblings ...)
  2015-01-12 15:36 ` enkovich.gnu at gmail dot com
@ 2015-01-14 15:35 ` rguenth at gcc dot gnu.org
  2015-01-14 15:53 ` enkovich.gnu at gmail dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-01-14 15:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Note the testcase is bogus because xx is clearly loading from global memory and
thus should be pure only.

Of course we should still not ICE here and treat xx as if it were const.

One possibility is to simply never apply IPA SRA to const functions.

Note that we will miscompile things if you change C::i to

void C::i()
{
  x = 1;
  if (xx())
   x = 0;
}

and you add noinline to xx.  sinking will then sink the x = 1 store
to the else arm (because of the bogus const attribute).


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

* [Bug middle-end/64353] [5 Regression] ICE: in execute_todo, at passes.c:1986
  2014-12-18 17:40 [Bug c++/64353] New: ICE: in execute_todo, at passes.c:1986 adam at os dot inf.tu-dresden.de
                   ` (5 preceding siblings ...)
  2015-01-14 15:35 ` rguenth at gcc dot gnu.org
@ 2015-01-14 15:53 ` enkovich.gnu at gmail dot com
  2015-01-16 15:39 ` ienkovich at gcc dot gnu.org
  2015-01-25 16:53 ` tbsaunde at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: enkovich.gnu at gmail dot com @ 2015-01-14 15:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Ilya Enkovich <enkovich.gnu at gmail dot com> ---
Right, wrong const attribute causes no VUSE for calls to the function which
leads to # VUSE <.MEM> generated for added loads and requires SSA update.

We may actually call update_ssa only in case of missing VUSE still allowing
optimization for functions wrongly marked as const.


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

* [Bug middle-end/64353] [5 Regression] ICE: in execute_todo, at passes.c:1986
  2014-12-18 17:40 [Bug c++/64353] New: ICE: in execute_todo, at passes.c:1986 adam at os dot inf.tu-dresden.de
                   ` (6 preceding siblings ...)
  2015-01-14 15:53 ` enkovich.gnu at gmail dot com
@ 2015-01-16 15:39 ` ienkovich at gcc dot gnu.org
  2015-01-25 16:53 ` tbsaunde at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: ienkovich at gcc dot gnu.org @ 2015-01-16 15:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from ienkovich at gcc dot gnu.org ---
Author: ienkovich
Date: Fri Jan 16 15:38:21 2015
New Revision: 219748

URL: https://gcc.gnu.org/viewcvs?rev=219748&root=gcc&view=rev
Log:
gcc/

    PR middle-end/64353
    * tree-cfg.c (pass_data_fixup_cfg): Update SSA for
    virtuals on start.

gcc/testsuite/

    PR middle-end/64353
    * g++.dg/pr64353.C: New.


Added:
    trunk/gcc/testsuite/g++.dg/pr64353.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-cfg.c


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

* [Bug middle-end/64353] [5 Regression] ICE: in execute_todo, at passes.c:1986
  2014-12-18 17:40 [Bug c++/64353] New: ICE: in execute_todo, at passes.c:1986 adam at os dot inf.tu-dresden.de
                   ` (7 preceding siblings ...)
  2015-01-16 15:39 ` ienkovich at gcc dot gnu.org
@ 2015-01-25 16:53 ` tbsaunde at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: tbsaunde at gcc dot gnu.org @ 2015-01-25 16:53 UTC (permalink / raw)
  To: gcc-bugs

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

tbsaunde at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |tbsaunde at gcc dot gnu.org
         Resolution|---                         |FIXED

--- Comment #9 from tbsaunde at gcc dot gnu.org ---
fixed


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

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

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-18 17:40 [Bug c++/64353] New: ICE: in execute_todo, at passes.c:1986 adam at os dot inf.tu-dresden.de
2014-12-19 11:50 ` [Bug middle-end/64353] [5 Regression] " rguenth at gcc dot gnu.org
2015-01-05  9:54 ` jakub at gcc dot gnu.org
2015-01-07  9:52 ` trippels at gcc dot gnu.org
2015-01-07  9:59 ` jakub at gcc dot gnu.org
2015-01-12 15:36 ` enkovich.gnu at gmail dot com
2015-01-14 15:35 ` rguenth at gcc dot gnu.org
2015-01-14 15:53 ` enkovich.gnu at gmail dot com
2015-01-16 15:39 ` ienkovich at gcc dot gnu.org
2015-01-25 16:53 ` tbsaunde 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).