public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65626] New: [5 Regression] ICE in fixup_noreturn_call called by tree-ssa-forwprop.c:2492
@ 2015-03-30 11:46 marxin at gcc dot gnu.org
  2015-03-30 12:19 ` [Bug c++/65626] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2015-03-30 11:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65626
           Summary: [5 Regression] ICE in fixup_noreturn_call called by
                    tree-ssa-forwprop.c:2492
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org

Starting from r221409, GCC produces ICE on following code:

$ cat /home/marxin/Programming/mosesdecoder/1.ii
class A {
  virtual unsigned long m_fn1() const;
  virtual int &m_fn2(unsigned long) const;
};
class C : A {
public:
  int &m_fn2(unsigned long) const;
  unsigned long m_fn1() const;
};
class B {
  void m_fn3(const A &, const int &, const C &, int &) const;
};
void B::m_fn3(const A &, const int &, const C &, int &) const {
  C &a(a);
  for (long b = 0; a.m_fn1(); b++)
    a.m_fn2(0);
}

$ ./xgcc -B . /home/marxin/Programming/mosesdecoder/1.ii -c -O2 
/home/marxin/Programming/mosesdecoder/1.ii: In member function ‘void
B::m_fn3(const A&, const int&, const C&, int&) const’:
/home/marxin/Programming/mosesdecoder/1.ii:17:1: internal compiler error:
Segmentation fault
 }
 ^
0xd8c428 crash_signal
    ../../gcc/toplev.c:383
0xdd5b35 bb_seq_addr
    ../../gcc/gimple.h:1535
0xdd5ff6 gsi_last_bb
    ../../gcc/gimple-iterator.h:162
0xdd7726 fixup_noreturn_call(gimple_statement_base*)
    ../../gcc/tree-cfgcleanup.c:594
0xeb4c9d execute
    ../../gcc/tree-ssa-forwprop.c:2492

   │585     bool
   │586     fixup_noreturn_call (gimple stmt)
   │587     {
B+ │588       basic_block bb = gimple_bb (stmt);
   │589
  >│590       if (gimple_call_builtin_p (stmt, BUILT_IN_RETURN))
   │591         return false;

Here bb == NULL, which is set here:
Old value = -154917976
New value = 0
gimple_set_bb (stmt=0x7ffff6da9a80, bb=0x0) at ../../gcc/gimple.c:1544
1544      if (gimple_code (stmt) != GIMPLE_LABEL)
(gdb) bt
#0  gimple_set_bb (stmt=0x7ffff6da9a80, bb=0x0) at ../../gcc/gimple.c:1544
#1  0x0000000000a9f5a3 in gsi_remove (i=0x7fffffffd290,
remove_permanently=true) at ../../gcc/gimple-iterator.c:595
#2  0x0000000000dc4299 in remove_bb (bb=0x7ffff6c423a8) at
../../gcc/tree-cfg.c:2129
#3  0x00000000009206ad in delete_basic_block (bb=0x7ffff6c423a8) at
../../gcc/cfghooks.c:585
#4  0x0000000000dd199d in remove_edge_and_dominated_blocks (e=0x7ffff6c43348)
at ../../gcc/tree-cfg.c:7905
#5  0x0000000000dd6525 in remove_fallthru_edge (ev=0x7ffff6db6050) at
../../gcc/tree-cfgcleanup.c:107
#6  0x0000000000dd78ad in fixup_noreturn_call (stmt=0x7ffff6da9b00) at
../../gcc/tree-cfgcleanup.c:631
#7  0x0000000000eb4c9e in (anonymous namespace)::pass_forwprop::execute
(this=0x20d5ee0, fun=0x7ffff6db0000)
    at ../../gcc/tree-ssa-forwprop.c:2492
#8  0x0000000000ca3d80 in execute_one_pass (pass=0x20d5ee0) at
../../gcc/passes.c:2328
#9  0x0000000000ca3fba in execute_pass_list_1 (pass=0x20d5ee0) at
../../gcc/passes.c:2380
#10 0x0000000000ca3feb in execute_pass_list_1 (pass=0x20d5d60) at
../../gcc/passes.c:2381
#11 0x0000000000ca4028 in execute_pass_list (fn=0x7ffff6db0000, pass=0x20d5be0)
at ../../gcc/passes.c:2391
#12 0x0000000000ca29c6 in do_per_function_toporder (callback=0xca4000
<execute_pass_list(function*, opt_pass*)>, data=0x20d5be0)
    at ../../gcc/passes.c:1726
#13 0x0000000000ca4bbd in execute_ipa_pass_list (pass=0x20d5b80) at
../../gcc/passes.c:2734
#14 0x00000000009555c5 in ipa_passes () at ../../gcc/cgraphunit.c:2154
#15 0x00000000009559bd in symbol_table::compile (this=0x7ffff6c3b000) at
../../gcc/cgraphunit.c:2295
#16 0x0000000000955c32 in symbol_table::finalize_compilation_unit
(this=0x7ffff6c3b000) at ../../gcc/cgraphunit.c:2444
#17 0x0000000000765803 in cp_write_global_declarations () at
../../gcc/cp/decl2.c:4754
#18 0x0000000000d8ca61 in compile_file () at ../../gcc/toplev.c:608
#19 0x0000000000d8ee5a in do_compile () at ../../gcc/toplev.c:2076
#20 0x0000000000d8f086 in toplev::main (this=0x7fffffffd990, argc=13,
argv=0x7fffffffda98) at ../../gcc/toplev.c:2174
#21 0x000000000160d2cc in main (argc=13, argv=0x7fffffffda98) at
../../gcc/main.c:39

Thanks,
Martin
>From gcc-bugs-return-482243-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Mar 30 10:42:07 2015
Return-Path: <gcc-bugs-return-482243-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 14398 invoked by alias); 30 Mar 2015 10:42:07 -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 14367 invoked by uid 48); 30 Mar 2015 10:42:03 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/65626] [5 Regression] ICE in fixup_noreturn_call called by tree-ssa-forwprop.c:2492
Date: Mon, 30 Mar 2015 11:46:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on assigned_to target_milestone everconfirmed
Message-ID: <bug-65626-4-cNQRPuzVAv@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65626-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65626-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-03/txt/msg03387.txt.bz2
Content-length: 619

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2015-03-30
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
   Target Milestone|---                         |5.0
     Ever confirmed|0                           |1

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


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

* [Bug c++/65626] [5 Regression] ICE in fixup_noreturn_call called by tree-ssa-forwprop.c:2492
  2015-03-30 11:46 [Bug c++/65626] New: [5 Regression] ICE in fixup_noreturn_call called by tree-ssa-forwprop.c:2492 marxin at gcc dot gnu.org
@ 2015-03-30 12:19 ` rguenth at gcc dot gnu.org
  2015-03-30 12:36 ` marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-30 12:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 35181
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35181&action=edit
patch

Testing the attached.


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

* [Bug c++/65626] [5 Regression] ICE in fixup_noreturn_call called by tree-ssa-forwprop.c:2492
  2015-03-30 11:46 [Bug c++/65626] New: [5 Regression] ICE in fixup_noreturn_call called by tree-ssa-forwprop.c:2492 marxin at gcc dot gnu.org
  2015-03-30 12:19 ` [Bug c++/65626] " rguenth at gcc dot gnu.org
@ 2015-03-30 12:36 ` marxin at gcc dot gnu.org
  2015-03-31  9:49 ` rguenth at gcc dot gnu.org
  2015-03-31  9:50 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2015-03-30 12:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
I can confirm that the patch fixed mosesdecoder compilation with enabled LTO.

Thanks,
Martin
>From gcc-bugs-return-482249-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Mar 30 11:46:27 2015
Return-Path: <gcc-bugs-return-482249-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 7427 invoked by alias); 30 Mar 2015 11:46:27 -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 7366 invoked by uid 48); 30 Mar 2015 11:46:24 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/65549] [5 Regression] crash in htab_hash_string with -flto -g
Date: Mon, 30 Mar 2015 13:11:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: debug
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords: lto
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: NEW
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:
Message-ID: <bug-65549-4-Lxo1CgPgzn@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65549-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65549-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-03/txt/msg03393.txt.bz2
Content-length: 241

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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Btw, I always wondered why dwarf2out.c doesn't create such stubs itself when it
requires a parent (via force_decl_die).


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

* [Bug c++/65626] [5 Regression] ICE in fixup_noreturn_call called by tree-ssa-forwprop.c:2492
  2015-03-30 11:46 [Bug c++/65626] New: [5 Regression] ICE in fixup_noreturn_call called by tree-ssa-forwprop.c:2492 marxin at gcc dot gnu.org
  2015-03-30 12:19 ` [Bug c++/65626] " rguenth at gcc dot gnu.org
  2015-03-30 12:36 ` marxin at gcc dot gnu.org
@ 2015-03-31  9:49 ` rguenth at gcc dot gnu.org
  2015-03-31  9:50 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-31  9:49 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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


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

* [Bug c++/65626] [5 Regression] ICE in fixup_noreturn_call called by tree-ssa-forwprop.c:2492
  2015-03-30 11:46 [Bug c++/65626] New: [5 Regression] ICE in fixup_noreturn_call called by tree-ssa-forwprop.c:2492 marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-03-31  9:49 ` rguenth at gcc dot gnu.org
@ 2015-03-31  9:50 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-31  9:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Tue Mar 31 09:34:08 2015
New Revision: 221790

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

    PR middle-end/65626
    * tree-cfgcleanup.c (fixup_noreturn_call): Only split the block
    of the noreturn call so it is last and cleanup_control_flow_bb
    can do the CFG part.

    * g++.dg/torture/pr65626.C: New testcase.

Added:
    trunk/gcc/testsuite/g++.dg/torture/pr65626.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-cfgcleanup.c


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

end of thread, other threads:[~2015-03-31  9:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-30 11:46 [Bug c++/65626] New: [5 Regression] ICE in fixup_noreturn_call called by tree-ssa-forwprop.c:2492 marxin at gcc dot gnu.org
2015-03-30 12:19 ` [Bug c++/65626] " rguenth at gcc dot gnu.org
2015-03-30 12:36 ` marxin at gcc dot gnu.org
2015-03-31  9:49 ` rguenth at gcc dot gnu.org
2015-03-31  9:50 ` 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).