This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/37568] [4.4 regression] ICE returning a struct



------- Comment #1 from jakub at gcc dot gnu dot org  2008-09-19 16:01 -------
Caused by http://gcc.gnu.org/viewcvs?view=rev&revision=140415
C++ FE has a weird habit of sticking error_mark_node in DECL_INITIAL, in this
case in finalize_nrv_r:
      if (DECL_INITIAL (dp->var)
          && DECL_INITIAL (dp->var) != error_mark_node)
        {
          init = build2 (INIT_EXPR, void_type_node, dp->result,
                         DECL_INITIAL (dp->var));
          DECL_INITIAL (dp->var) = error_mark_node;
        }
      else
        init = build_empty_stmt ();

IMHO either we relax the checking, allowing DECL_INITIAL to be error_mark_node
even for !TREE_STATIC, or finalize_nrv_r would need to clear DECL_INITIAL.
I don't know what consequences the latter might have though.


-- 

jakub at gcc dot gnu dot org changed:

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]