public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/44808]  New: ICE: tree check: expected var_decl, have result_decl in gimplify_modify_expr
@ 2010-07-04 12:50 marc dot glisse at normalesup dot org
  2010-07-04 14:38 ` [Bug c++/44808] [4.6 Regression] " rguenth at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: marc dot glisse at normalesup dot org @ 2010-07-04 12:50 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1288 bytes --]

The following code produces the error:

$ c++    -c triangles_test.cpp  -O9
triangles_test.cpp: In member function ‘virtual Halfedge_handle
Ovl_visitor::insert_at_vertices()’:
triangles_test.cpp:12:24: internal compiler error: tree check: expected
var_decl, have result_decl in gimplify_modify_expr, at gimplify.c:4571
Please submit a full bug report,

I checked with a snapshot from the 3rd of July, so this shouldn't be the same
as bug 44706 (the closest thing I could find in bugzilla).

struct Halfedge_handle
{
        void *a,*b;
        int c;
};

struct Ovl_visitor
{
        virtual Halfedge_handle insert_at_vertices ()
        {
                Halfedge_handle res;
                Halfedge_handle he = res;
                return res;
        }
};

Ovl_visitor               visitor ;


-- 
           Summary: ICE: tree check: expected var_decl, have result_decl in
                    gimplify_modify_expr
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: marc dot glisse at normalesup dot org
  GCC host triplet: x86_64-unknown-linux-gnu


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


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

* [Bug c++/44808] [4.6 Regression] ICE: tree check: expected var_decl, have result_decl in gimplify_modify_expr
  2010-07-04 12:50 [Bug c++/44808] New: ICE: tree check: expected var_decl, have result_decl in gimplify_modify_expr marc dot glisse at normalesup dot org
@ 2010-07-04 14:38 ` rguenth at gcc dot gnu dot org
  2010-07-05 10:55 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-07-04 14:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2010-07-04 14:38 -------
Confirmed.

The value-expr is odd:

;; Function virtual Halfedge_handle Ovl_visitor::insert_at_vertices() (null)
;; enabled by -tree-original


{
  struct Halfedge_handle res [value-expr: <retval>];
  struct Halfedge_handle he;

  (void) 0;
    struct Halfedge_handle he;
  <<cleanup_point <<< Unknown tree: expr_stmt
  (void) (he = TARGET_EXPR <D.1722, <retval>>) >>>
>>;
  <<cleanup_point return <retval>>>;
}

so are assignments from <retval> anyway.  Because <retval> has DECL_IGNORED_P
set we try to

  /* Try to alleviate the effects of the gimplification creating artificial
     temporaries (see for example is_gimple_reg_rhs) on the debug info.  */
  if (!gimplify_ctxp->into_ssa
      && DECL_P (*from_p)
      && DECL_IGNORED_P (*from_p)
      && DECL_P (*to_p)
      && !DECL_IGNORED_P (*to_p))
    {
      if (!DECL_NAME (*from_p) && DECL_NAME (*to_p))
        DECL_NAME (*from_p)
          = create_tmp_var_name (IDENTIFIER_POINTER (DECL_NAME (*to_p)));
      DECL_DEBUG_EXPR_IS_FROM (*from_p) = 1;
      SET_DECL_DEBUG_EXPR (*from_p, *to_p);

which requires a VAR_DECL as *from_p.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-07-04 14:38:16
               date|                            |
            Summary|ICE: tree check: expected   |[4.6 Regression] ICE: tree
                   |var_decl, have result_decl  |check: expected var_decl,
                   |in gimplify_modify_expr     |have result_decl in
                   |                            |gimplify_modify_expr
   Target Milestone|---                         |4.6.0


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


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

* [Bug c++/44808] [4.6 Regression] ICE: tree check: expected var_decl, have result_decl in gimplify_modify_expr
  2010-07-04 12:50 [Bug c++/44808] New: ICE: tree check: expected var_decl, have result_decl in gimplify_modify_expr marc dot glisse at normalesup dot org
  2010-07-04 14:38 ` [Bug c++/44808] [4.6 Regression] " rguenth at gcc dot gnu dot org
@ 2010-07-05 10:55 ` jakub at gcc dot gnu dot org
  2010-07-05 11:05 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-07-05 10:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2010-07-05 10:55 -------
I don't see anything odd on the value-expr (the variable res has been NRVed in
the FE to the RESULT_DECL) nor on the assignments from RESULT_DECL.

So, I think either we should guard this hunk in gimplify.c with TREE_CODE
(*from_p) == VAR_DECL instead of DECL_P (*from_p), or change the check in
tree.h in {,SET_}DECL_DEBUG_EXPR from VAR_DECL_CHECK to DECL_COMMON_CHECK.
There is nothing VAR_DECL specific on the lookups (all it needs is DECL_UID,
which RESULT_DECL and PARM_DECLs etc. have too).  var-tracking will unlikely
use it though.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2010-07-04 14:38:16         |2010-07-05 10:55:02
               date|                            |


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


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

* [Bug c++/44808] [4.6 Regression] ICE: tree check: expected var_decl, have result_decl in gimplify_modify_expr
  2010-07-04 12:50 [Bug c++/44808] New: ICE: tree check: expected var_decl, have result_decl in gimplify_modify_expr marc dot glisse at normalesup dot org
  2010-07-04 14:38 ` [Bug c++/44808] [4.6 Regression] " rguenth at gcc dot gnu dot org
  2010-07-05 10:55 ` jakub at gcc dot gnu dot org
@ 2010-07-05 11:05 ` jakub at gcc dot gnu dot org
  2010-07-05 14:43 ` jakub at gcc dot gnu dot org
  2010-07-12 10:38 ` jakub at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-07-05 11:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2010-07-05 11:04 -------
Created an attachment (id=21091)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21091&action=view)
gcc46-pr44808.patch

Untested fix.


-- 


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


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

* [Bug c++/44808] [4.6 Regression] ICE: tree check: expected var_decl, have result_decl in gimplify_modify_expr
  2010-07-04 12:50 [Bug c++/44808] New: ICE: tree check: expected var_decl, have result_decl in gimplify_modify_expr marc dot glisse at normalesup dot org
                   ` (2 preceding siblings ...)
  2010-07-05 11:05 ` jakub at gcc dot gnu dot org
@ 2010-07-05 14:43 ` jakub at gcc dot gnu dot org
  2010-07-12 10:38 ` jakub at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-07-05 14:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2010-07-05 14:42 -------
Subject: Bug 44808

Author: jakub
Date: Mon Jul  5 14:42:20 2010
New Revision: 161838

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161838
Log:
        PR c++/44808
        * gimplify.c (gimplify_modify_expr): Only SET_DECL_DEBUG_EXPR if
        *from_p is VAR_DECL.

        * g++.dg/opt/nrv16.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/opt/nrv16.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gimplify.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/44808] [4.6 Regression] ICE: tree check: expected var_decl, have result_decl in gimplify_modify_expr
  2010-07-04 12:50 [Bug c++/44808] New: ICE: tree check: expected var_decl, have result_decl in gimplify_modify_expr marc dot glisse at normalesup dot org
                   ` (3 preceding siblings ...)
  2010-07-05 14:43 ` jakub at gcc dot gnu dot org
@ 2010-07-12 10:38 ` jakub at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-07-12 10:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2010-07-12 10:38 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2010-07-12 10:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-04 12:50 [Bug c++/44808] New: ICE: tree check: expected var_decl, have result_decl in gimplify_modify_expr marc dot glisse at normalesup dot org
2010-07-04 14:38 ` [Bug c++/44808] [4.6 Regression] " rguenth at gcc dot gnu dot org
2010-07-05 10:55 ` jakub at gcc dot gnu dot org
2010-07-05 11:05 ` jakub at gcc dot gnu dot org
2010-07-05 14:43 ` jakub at gcc dot gnu dot org
2010-07-12 10:38 ` jakub 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).