public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/41377] [4.5 Regression] ICE in unsplit_eh
  2009-09-16 14:39 [Bug tree-optimization/41377] New: [4.5 Regression] ICE in unsplit_eh reichelt at gcc dot gnu dot org
@ 2009-09-16 14:39 ` reichelt at gcc dot gnu dot org
  2009-09-18  4:11 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2009-09-16 14:39 UTC (permalink / raw)
  To: gcc-bugs



-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.5.0


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


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

* [Bug tree-optimization/41377]  New: [4.5 Regression] ICE in unsplit_eh
@ 2009-09-16 14:39 reichelt at gcc dot gnu dot org
  2009-09-16 14:39 ` [Bug tree-optimization/41377] " reichelt at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2009-09-16 14:39 UTC (permalink / raw)
  To: gcc-bugs

The following testcase triggers an ICE on the trunk when compiled with "-O3":

===============================================================
struct A
{
  bool foo(int*) const;
} a;

struct B {};

struct B1 : B
{
  bool (A::*pmf)(int*) const;
  const A* pa;

  B1() : pmf(&A::foo), pa(&a) {}
  bool operator()() const { return (pa->*pmf)(new int); }
};

struct B2 : B
{
  B1 b1;

  B2(const B1& _b1) : b1(_b1) {}
  bool operator()() const { return b1(); }
};

template<int> struct C
{
  void bar(B2 b2) { while (b2()) ; }
  C() { bar(B2(B1())); }
};

void baz(int i)
{
  switch(i)
  {
    case 0: new C<0>;
    case 1: new C<1>;
    case 2: new C<2>;
  }
}
===============================================================

bug.cc: In function 'baz(int)':
bug.cc:31:6: internal compiler error: in unsplit_eh, at tree-eh.c:3359
Please submit a full bug report, [etc.]


-- 
           Summary: [4.5 Regression] ICE in unsplit_eh
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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


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

* [Bug tree-optimization/41377] [4.5 Regression] ICE in unsplit_eh
  2009-09-16 14:39 [Bug tree-optimization/41377] New: [4.5 Regression] ICE in unsplit_eh reichelt at gcc dot gnu dot org
  2009-09-16 14:39 ` [Bug tree-optimization/41377] " reichelt at gcc dot gnu dot org
@ 2009-09-18  4:11 ` pinskia at gcc dot gnu dot org
  2009-09-18  9:25 ` rguenth at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-09-18  4:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2009-09-18 04:11 -------
This works with:
gcc version 4.5.0 20090706 (experimental) [trunk revision 149292] (GCC) 

On i386-darwin8.11.


-- 


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


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

* [Bug tree-optimization/41377] [4.5 Regression] ICE in unsplit_eh
  2009-09-16 14:39 [Bug tree-optimization/41377] New: [4.5 Regression] ICE in unsplit_eh reichelt at gcc dot gnu dot org
  2009-09-16 14:39 ` [Bug tree-optimization/41377] " reichelt at gcc dot gnu dot org
  2009-09-18  4:11 ` pinskia at gcc dot gnu dot org
@ 2009-09-18  9:25 ` rguenth at gcc dot gnu dot org
  2009-09-18 13:49 ` [Bug tree-optimization/41377] [4.5 Regression] Revision 151696 caused " hjl dot tools at gmail dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-09-18  9:25 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


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

* [Bug tree-optimization/41377] [4.5 Regression] Revision 151696 caused ICE in unsplit_eh
  2009-09-16 14:39 [Bug tree-optimization/41377] New: [4.5 Regression] ICE in unsplit_eh reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2009-09-18  9:25 ` rguenth at gcc dot gnu dot org
@ 2009-09-18 13:49 ` hjl dot tools at gmail dot com
  2009-09-19 20:41 ` rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-09-18 13:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from hjl dot tools at gmail dot com  2009-09-18 13:49 -------
This is caused by revision 151696:

http://gcc.gnu.org/ml/gcc-cvs/2009-09/msg00443.html


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Priority|P1                          |P3
   Last reconfirmed|0000-00-00 00:00:00         |2009-09-18 13:49:16
               date|                            |
            Summary|[4.5 Regression] ICE in     |[4.5 Regression] Revision
                   |unsplit_eh                  |151696 caused ICE in
                   |                            |unsplit_eh


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


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

* [Bug tree-optimization/41377] [4.5 Regression] Revision 151696 caused ICE in unsplit_eh
  2009-09-16 14:39 [Bug tree-optimization/41377] New: [4.5 Regression] ICE in unsplit_eh reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2009-09-18 13:49 ` [Bug tree-optimization/41377] [4.5 Regression] Revision 151696 caused " hjl dot tools at gmail dot com
@ 2009-09-19 20:41 ` rguenth at gcc dot gnu dot org
  2009-09-20 20:50 ` [Bug tree-optimization/41377] [4.5 Regression] gimple EH rewrite causes ICE with PPRE (enabled at -O3) pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-09-19 20:41 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


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

* [Bug tree-optimization/41377] [4.5 Regression] gimple EH rewrite causes ICE with PPRE (enabled at -O3)
  2009-09-16 14:39 [Bug tree-optimization/41377] New: [4.5 Regression] ICE in unsplit_eh reichelt at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2009-09-19 20:41 ` rguenth at gcc dot gnu dot org
@ 2009-09-20 20:50 ` pinskia at gcc dot gnu dot org
  2009-10-11 12:05 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-09-20 20:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2009-09-20 20:49 -------
This is a PPRE issue as turning off PRE fixes the issue and 
  do_partial_partial = optimize > 2;

changing that to 0 instead also does not expose the issue.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.5 Regression] Revision   |[4.5 Regression] gimple EH
                   |151696 caused ICE in        |rewrite causes ICE with PPRE
                   |unsplit_eh                  |(enabled at -O3)


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


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

* [Bug tree-optimization/41377] [4.5 Regression] gimple EH rewrite causes ICE with PPRE (enabled at -O3)
  2009-09-16 14:39 [Bug tree-optimization/41377] New: [4.5 Regression] ICE in unsplit_eh reichelt at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2009-09-20 20:50 ` [Bug tree-optimization/41377] [4.5 Regression] gimple EH rewrite causes ICE with PPRE (enabled at -O3) pinskia at gcc dot gnu dot org
@ 2009-10-11 12:05 ` rguenth at gcc dot gnu dot org
  2009-10-12 22:34 ` rth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-10-11 12:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2009-10-11 12:05 -------
ehcleanup does not deal with the virtual PHI node appearing in BB13:

  # BLOCK 11 freq:4067
  # PRED: 10 [100.0%]  (fallthru,exec)
  D.2166_92 = (int *) D.2165_108;
  # .MEM_148 = VDEF <.MEM_106>
  D.2148_59 = A::foo (&a, D.2166_92);
  # SUCC: 12 [100.0%]  (fallthru,exec) 13 (eh,exec)

...

  # BLOCK 13
  # PRED: 11 (eh,exec)
  # .MEM_44 = PHI <.MEM_148(11)>
<L13>:
  goto <bb 27> (<L5>);
  # SUCC: 27 [100.0%]  (fallthru,exec)

...

  # BLOCK 27
  # PRED: 13 [100.0%]  (fallthru,exec) 26 [100.0%]  (fallthru,exec)
  # .MEM_138 = PHI <.MEM_44(13), .MEM_60(26)>
<L5>:
  # .MEM_19 = VDEF <.MEM_138>
  operator delete (D.1857_5);
  resx 3
  # SUCC:

as the comment suggests this should be easy to fix.  Honza?

#1  0x0880ed28 in unsplit_eh (lp=0xb7d6c0c0)
    at /home/richard/src/trunk/gcc/tree-eh.c:3389
3389      gcc_assert (gimple_seq_empty_p (phi_nodes (bb)));
(gdb) l
3384      /* ??? I can't imagine there would be PHI nodes, since by nature
3385         of critical edge splitting this block should never have been
3386         a dominance frontier.  If cfg cleanups somehow confuse this,
3387         due to single edges in and out we ought to have degenerate PHIs
3388         and can easily propagate the PHI arguments.  */
3389      gcc_assert (gimple_seq_empty_p (phi_nodes (bb)));


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu dot
                   |                            |org


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


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

* [Bug tree-optimization/41377] [4.5 Regression] gimple EH rewrite causes ICE with PPRE (enabled at -O3)
  2009-09-16 14:39 [Bug tree-optimization/41377] New: [4.5 Regression] ICE in unsplit_eh reichelt at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2009-10-11 12:05 ` rguenth at gcc dot gnu dot org
@ 2009-10-12 22:34 ` rth at gcc dot gnu dot org
  2009-10-13 18:42 ` rth at gcc dot gnu dot org
  2009-10-13 18:45 ` rth at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: rth at gcc dot gnu dot org @ 2009-10-12 22:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rth at gcc dot gnu dot org  2009-10-12 22:34 -------
Mine.


-- 

rth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rth at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-10-05 00:09:08         |2009-10-12 22:34:01
               date|                            |


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


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

* [Bug tree-optimization/41377] [4.5 Regression] gimple EH rewrite causes ICE with PPRE (enabled at -O3)
  2009-09-16 14:39 [Bug tree-optimization/41377] New: [4.5 Regression] ICE in unsplit_eh reichelt at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2009-10-12 22:34 ` rth at gcc dot gnu dot org
@ 2009-10-13 18:42 ` rth at gcc dot gnu dot org
  2009-10-13 18:45 ` rth at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: rth at gcc dot gnu dot org @ 2009-10-13 18:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rth at gcc dot gnu dot org  2009-10-13 18:42 -------
Subject: Bug 41377

Author: rth
Date: Tue Oct 13 18:41:56 2009
New Revision: 152728

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152728
Log:
        PR tree-optimization/41377
        * tree-eh.c (unsplit_eh): Propagate degenerate PHIs.
        (cleanup_empty_eh_merge_phis): New change_region parameter;
        pass it on to redirect_eh_edge_1.  Update callers.
        (cleanup_empty_eh_unsplit): Don't require an existing EH label
        at the destination block.

Added:
    trunk/gcc/testsuite/g++.dg/opt/eh5.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-eh.c


-- 


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


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

* [Bug tree-optimization/41377] [4.5 Regression] gimple EH rewrite causes ICE with PPRE (enabled at -O3)
  2009-09-16 14:39 [Bug tree-optimization/41377] New: [4.5 Regression] ICE in unsplit_eh reichelt at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2009-10-13 18:42 ` rth at gcc dot gnu dot org
@ 2009-10-13 18:45 ` rth at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: rth at gcc dot gnu dot org @ 2009-10-13 18:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from rth at gcc dot gnu dot org  2009-10-13 18:45 -------
Fixed.


-- 

rth at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2009-10-13 18:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-16 14:39 [Bug tree-optimization/41377] New: [4.5 Regression] ICE in unsplit_eh reichelt at gcc dot gnu dot org
2009-09-16 14:39 ` [Bug tree-optimization/41377] " reichelt at gcc dot gnu dot org
2009-09-18  4:11 ` pinskia at gcc dot gnu dot org
2009-09-18  9:25 ` rguenth at gcc dot gnu dot org
2009-09-18 13:49 ` [Bug tree-optimization/41377] [4.5 Regression] Revision 151696 caused " hjl dot tools at gmail dot com
2009-09-19 20:41 ` rguenth at gcc dot gnu dot org
2009-09-20 20:50 ` [Bug tree-optimization/41377] [4.5 Regression] gimple EH rewrite causes ICE with PPRE (enabled at -O3) pinskia at gcc dot gnu dot org
2009-10-11 12:05 ` rguenth at gcc dot gnu dot org
2009-10-12 22:34 ` rth at gcc dot gnu dot org
2009-10-13 18:42 ` rth at gcc dot gnu dot org
2009-10-13 18:45 ` rth 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).