public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39259]  New: internal compiler error: in initialize_cfun, at tree-inline.c:1749
@ 2009-02-21 17:39 patrakov at gmail dot com
  2009-02-21 17:57 ` [Bug tree-optimization/39259] [4.4 Regression] " rguenth at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: patrakov at gmail dot com @ 2009-02-21 17:39 UTC (permalink / raw)
  To: gcc-bugs

This meaningless testcase (reduced by delta from the real program), when
compiled with g++ 4.4 (but not 4.3), produces an ICE.

extern "C" int __mysetjmp () __attribute__ ((__returns_twice__));

class TContStatus {};

class TContEvent
{
public:
  inline void Execute () throw();
};

class TCont
{
public:
  TContStatus ReadD (void* buf, int deadline)
  {
    TContEvent event;
    event.Execute ();
    return TContStatus();
  }
  TContStatus ReadI (void *buf)
  {
    return ReadD (buf, 1);
  }
};

void TContEvent::Execute () throw ()
{
  __mysetjmp();
}

void Broken (TCont *mCont)
{
  mCont->ReadI(0);
  mCont->ReadI(0);
}


-- 
           Summary: internal compiler error: in initialize_cfun, at tree-
                    inline.c:1749
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: patrakov at gmail dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug tree-optimization/39259] [4.4 Regression] internal compiler error: in initialize_cfun, at tree-inline.c:1749
  2009-02-21 17:39 [Bug c++/39259] New: internal compiler error: in initialize_cfun, at tree-inline.c:1749 patrakov at gmail dot com
@ 2009-02-21 17:57 ` rguenth at gcc dot gnu dot org
  2009-02-21 19:58 ` hjl dot tools at gmail dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-02-21 17:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2009-02-21 17:56 -------
Confirmed.  IPA-CP clones the setjmp function what hits this assert.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jamborm at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
          Component|c++                         |tree-optimization
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|0000-00-00 00:00:00         |2009-02-21 17:56:56
               date|                            |
            Summary|internal compiler error: in |[4.4 Regression] internal
                   |initialize_cfun, at tree-   |compiler error: in
                   |inline.c:1749               |initialize_cfun, at tree-
                   |                            |inline.c:1749
   Target Milestone|---                         |4.4.0


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


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

* [Bug tree-optimization/39259] [4.4 Regression] internal compiler error: in initialize_cfun, at tree-inline.c:1749
  2009-02-21 17:39 [Bug c++/39259] New: internal compiler error: in initialize_cfun, at tree-inline.c:1749 patrakov at gmail dot com
  2009-02-21 17:57 ` [Bug tree-optimization/39259] [4.4 Regression] " rguenth at gcc dot gnu dot org
@ 2009-02-21 19:58 ` hjl dot tools at gmail dot com
  2009-02-21 20:04 ` hjl dot tools at gmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-02-21 19:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from hjl dot tools at gmail dot com  2009-02-21 19:58 -------
That assert is introduced by revision 139945:

http://gcc.gnu.org/ml/gcc-cvs/2008-09/msg00103.html


-- 


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


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

* [Bug tree-optimization/39259] [4.4 Regression] internal compiler error: in initialize_cfun, at tree-inline.c:1749
  2009-02-21 17:39 [Bug c++/39259] New: internal compiler error: in initialize_cfun, at tree-inline.c:1749 patrakov at gmail dot com
  2009-02-21 17:57 ` [Bug tree-optimization/39259] [4.4 Regression] " rguenth at gcc dot gnu dot org
  2009-02-21 19:58 ` hjl dot tools at gmail dot com
@ 2009-02-21 20:04 ` hjl dot tools at gmail dot com
  2009-02-21 20:22 ` hjl dot tools at gmail dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-02-21 20:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from hjl dot tools at gmail dot com  2009-02-21 20:03 -------
This may be introduce by revision 139946:

http://gcc.gnu.org/ml/gcc-cvs/2008-09/msg00104.html


-- 

hjl dot tools at gmail dot com changed:

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


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


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

* [Bug tree-optimization/39259] [4.4 Regression] internal compiler error: in initialize_cfun, at tree-inline.c:1749
  2009-02-21 17:39 [Bug c++/39259] New: internal compiler error: in initialize_cfun, at tree-inline.c:1749 patrakov at gmail dot com
                   ` (2 preceding siblings ...)
  2009-02-21 20:04 ` hjl dot tools at gmail dot com
@ 2009-02-21 20:22 ` hjl dot tools at gmail dot com
  2009-02-23 14:09 ` jamborm at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-02-21 20:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from hjl dot tools at gmail dot com  2009-02-21 20:22 -------
Revision 139945 caused this.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jh at suse dot cz


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


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

* [Bug tree-optimization/39259] [4.4 Regression] internal compiler error: in initialize_cfun, at tree-inline.c:1749
  2009-02-21 17:39 [Bug c++/39259] New: internal compiler error: in initialize_cfun, at tree-inline.c:1749 patrakov at gmail dot com
                   ` (3 preceding siblings ...)
  2009-02-21 20:22 ` hjl dot tools at gmail dot com
@ 2009-02-23 14:09 ` jamborm at gcc dot gnu dot org
  2009-02-23 15:05 ` jh at suse dot cz
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jamborm at gcc dot gnu dot org @ 2009-02-23 14:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jamborm at gcc dot gnu dot org  2009-02-23 14:09 -------
I don't understand the comment above the assert at all (Honza probably
does) and so this might not  be the correct approach but the following
patch should just obviously work.   At least it does for this testcase
and I am about to bootstrap and regression test it:

2009-02-23  Martin Jambor  <mjambor@suse.cz>

        * tree-inline.c (tree_versionable_function_p): Return false for
        functions calling setjmp or alloca.

Index: tree-inline.c
===================================================================
--- tree-inline.c       (revision 144380)
+++ tree-inline.c       (working copy)
@@ -4174,12 +4174,17 @@ copy_static_chain (tree static_chain, co
 bool
 tree_versionable_function_p (tree fndecl)
 {
+  struct function *fn_cfun;
   if (fndecl == NULL_TREE)
     return false;
   /* ??? There are cases where a function is
      uninlinable but can be versioned.  */
   if (!tree_inlinable_function_p (fndecl))
     return false;
+
+  fn_cfun = DECL_STRUCT_FUNCTION (fndecl);
+  if (fn_cfun->calls_setjmp || fn_cfun->calls_alloca)
+    return false;

   return true;
 }


-- 


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


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

* [Bug tree-optimization/39259] [4.4 Regression] internal compiler error: in initialize_cfun, at tree-inline.c:1749
  2009-02-21 17:39 [Bug c++/39259] New: internal compiler error: in initialize_cfun, at tree-inline.c:1749 patrakov at gmail dot com
                   ` (4 preceding siblings ...)
  2009-02-23 14:09 ` jamborm at gcc dot gnu dot org
@ 2009-02-23 15:05 ` jh at suse dot cz
  2009-02-24 13:44 ` jamborm at gcc dot gnu dot org
  2009-02-25 18:20 ` jamborm at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: jh at suse dot cz @ 2009-02-23 15:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jh at suse dot cz  2009-02-23 15:05 -------
Subject: Re:  [4.4 Regression] internal 
     compiler error: in initialize_cfun, at tree-inline.c:1749

Hi,
the assert seems confused.  We can clone setjmp/alloca, just can't inline it.
(well, in fact we even can inline alloca if we are cureful)
just replace src_cfun by cfun and add notice_special_calls into processing
of new statements.

Honza


-- 


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


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

* [Bug tree-optimization/39259] [4.4 Regression] internal compiler error: in initialize_cfun, at tree-inline.c:1749
  2009-02-21 17:39 [Bug c++/39259] New: internal compiler error: in initialize_cfun, at tree-inline.c:1749 patrakov at gmail dot com
                   ` (5 preceding siblings ...)
  2009-02-23 15:05 ` jh at suse dot cz
@ 2009-02-24 13:44 ` jamborm at gcc dot gnu dot org
  2009-02-25 18:20 ` jamborm at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: jamborm at gcc dot gnu dot org @ 2009-02-24 13:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jamborm at gcc dot gnu dot org  2009-02-24 13:44 -------
After discussion with Honza, I have tried a more complex approach, the
patch is at:

http://gcc.gnu.org/ml/gcc-patches/2009-02/msg01118.html


-- 

jamborm at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-02-21 17:56:56         |2009-02-24 13:44:34
               date|                            |


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


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

* [Bug tree-optimization/39259] [4.4 Regression] internal compiler error: in initialize_cfun, at tree-inline.c:1749
  2009-02-21 17:39 [Bug c++/39259] New: internal compiler error: in initialize_cfun, at tree-inline.c:1749 patrakov at gmail dot com
                   ` (6 preceding siblings ...)
  2009-02-24 13:44 ` jamborm at gcc dot gnu dot org
@ 2009-02-25 18:20 ` jamborm at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: jamborm at gcc dot gnu dot org @ 2009-02-25 18:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jamborm at gcc dot gnu dot org  2009-02-25 18:19 -------
Fixed with:

Author: jamborm
Date: Wed Feb 25 17:34:40 2009
New Revision: 144428

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144428
Log:
2009-02-25  Martin Jambor  <mjambor@suse.cz>

        * tree-inline.c (initialize_cfun): Remove asserts for calls_setjmp and
        alls_alloca function flags.
        (copy_bb): Set calls_setjmp and alls_alloca function flags if such
        calls are detected.


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


-- 

jamborm at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2009-02-25 18:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-21 17:39 [Bug c++/39259] New: internal compiler error: in initialize_cfun, at tree-inline.c:1749 patrakov at gmail dot com
2009-02-21 17:57 ` [Bug tree-optimization/39259] [4.4 Regression] " rguenth at gcc dot gnu dot org
2009-02-21 19:58 ` hjl dot tools at gmail dot com
2009-02-21 20:04 ` hjl dot tools at gmail dot com
2009-02-21 20:22 ` hjl dot tools at gmail dot com
2009-02-23 14:09 ` jamborm at gcc dot gnu dot org
2009-02-23 15:05 ` jh at suse dot cz
2009-02-24 13:44 ` jamborm at gcc dot gnu dot org
2009-02-25 18:20 ` jamborm 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).