public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65127] New: internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'addr_expr' in parsing_nsdmi, at cp/parser.c:18311
@ 2015-02-20  1:14 lukeallardyce at gmail dot com
  2015-02-20  9:48 ` [Bug c++/65127] [5 Regression] " mpolacek at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: lukeallardyce at gmail dot com @ 2015-02-20  1:14 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65127
           Summary: internal compiler error: tree check: expected tree
                    that contains 'decl minimal' structure, have
                    'addr_expr' in parsing_nsdmi, at cp/parser.c:18311
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lukeallardyce at gmail dot com

void make_item()
{
  static int i{100};

  struct
  {
    int id{i++};
  } item;
}

int main()
{
  make_item<0>();
}

------

g++ -std=c++11 bug.cpp -c

bug.cpp: In instantiation of 'void make_item() [with int sz = 0]':
bug.cpp:14:16:   required from here
bug.cpp:9:5: internal compiler error: tree check: expected tree that contains
'decl minimal' structure, have 'addr_expr' in parsing_nsdmi, at
cp/parser.c:18311
   } item;
     ^

bug.cpp:9:5: internal compiler error: Abort trap: 6
g++: internal compiler error: Abort trap: 6 (program cc1plus)


GCC built from trunk on 2/16


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

* [Bug c++/65127] [5 Regression] internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'addr_expr' in parsing_nsdmi, at cp/parser.c:18311
  2015-02-20  1:14 [Bug c++/65127] New: internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'addr_expr' in parsing_nsdmi, at cp/parser.c:18311 lukeallardyce at gmail dot com
@ 2015-02-20  9:48 ` mpolacek at gcc dot gnu.org
  2015-02-20 13:55 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-02-20  9:48 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-02-20
                 CC|                            |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |5.0
            Summary|internal compiler error:    |[5 Regression] internal
                   |tree check: expected tree   |compiler error: tree check:
                   |that contains 'decl         |expected tree that contains
                   |minimal' structure, have    |'decl minimal' structure,
                   |'addr_expr' in              |have 'addr_expr' in
                   |parsing_nsdmi, at           |parsing_nsdmi, at
                   |cp/parser.c:18311           |cp/parser.c:18311
     Ever confirmed|0                           |1

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r216750.

Note that we ICE even on

template<int sz> void make_item()
{
  static int i{100};

  struct
  {
    int id{i++};
  } item;
}

int main()
{
  make_item<0>();
}

which is accepted by 4.9 and clang.


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

* [Bug c++/65127] [5 Regression] internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'addr_expr' in parsing_nsdmi, at cp/parser.c:18311
  2015-02-20  1:14 [Bug c++/65127] New: internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'addr_expr' in parsing_nsdmi, at cp/parser.c:18311 lukeallardyce at gmail dot com
  2015-02-20  9:48 ` [Bug c++/65127] [5 Regression] " mpolacek at gcc dot gnu.org
@ 2015-02-20 13:55 ` jakub at gcc dot gnu.org
  2015-02-24 20:38 ` ktietz at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-02-20 13:55 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So it seems current_class_ptr is no longer just NULL or a PARM_DECL, but can be
also ADDR_EXPR of a PLACEHOLDER_EXPR.  Dunno if the right fix is
just
 bool
 parsing_nsdmi (void)
 {
   /* We recognize NSDMI context by the context-less 'this' pointer set up
      by the function above.  */
-   if (current_class_ptr && DECL_CONTEXT (current_class_ptr) == NULL_TREE)
+   if (current_class_ptr
+       && TREE_CODE (current_class_ptr) == PARM_DECL
+       && DECL_CONTEXT (current_class_ptr) == NULL_TREE)
     return true;
   return false;
 }
or something different.


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

* [Bug c++/65127] [5 Regression] internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'addr_expr' in parsing_nsdmi, at cp/parser.c:18311
  2015-02-20  1:14 [Bug c++/65127] New: internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'addr_expr' in parsing_nsdmi, at cp/parser.c:18311 lukeallardyce at gmail dot com
  2015-02-20  9:48 ` [Bug c++/65127] [5 Regression] " mpolacek at gcc dot gnu.org
  2015-02-20 13:55 ` jakub at gcc dot gnu.org
@ 2015-02-24 20:38 ` ktietz at gcc dot gnu.org
  2015-03-10 16:47 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ktietz at gcc dot gnu.org @ 2015-02-24 20:38 UTC (permalink / raw)
  To: gcc-bugs

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

Kai Tietz <ktietz at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ktietz at gcc dot gnu.org

--- Comment #4 from Kai Tietz <ktietz at gcc dot gnu.org> ---
Hmm, this issue seems to be fixed by delayed folding.  By it I get the
following error-message:

t3.cpp: In function 'int main()':
t3.cpp:13:16: error: expected primary-expression before ')' token
   make_item<0>();
                ^
So there is still a parser-error, if this piece of code is considered to be
valid code


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

* [Bug c++/65127] [5 Regression] internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'addr_expr' in parsing_nsdmi, at cp/parser.c:18311
  2015-02-20  1:14 [Bug c++/65127] New: internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'addr_expr' in parsing_nsdmi, at cp/parser.c:18311 lukeallardyce at gmail dot com
                   ` (2 preceding siblings ...)
  2015-02-24 20:38 ` ktietz at gcc dot gnu.org
@ 2015-03-10 16:47 ` jason at gcc dot gnu.org
  2015-03-10 19:11 ` jakub at gcc dot gnu.org
  2015-03-11 19:11 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2015-03-10 16:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> So it seems current_class_ptr is no longer just NULL or a PARM_DECL, but can
> be also ADDR_EXPR of a PLACEHOLDER_EXPR.  Dunno if the right fix is
> just
>  bool
>  parsing_nsdmi (void)
>  {
>    /* We recognize NSDMI context by the context-less 'this' pointer set up
>       by the function above.  */
> -   if (current_class_ptr && DECL_CONTEXT (current_class_ptr) == NULL_TREE)
> +   if (current_class_ptr
> +       && TREE_CODE (current_class_ptr) == PARM_DECL
> +       && DECL_CONTEXT (current_class_ptr) == NULL_TREE)
>      return true;
>    return false;
>  }
> or something different.

This change is OK.


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

* [Bug c++/65127] [5 Regression] internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'addr_expr' in parsing_nsdmi, at cp/parser.c:18311
  2015-02-20  1:14 [Bug c++/65127] New: internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'addr_expr' in parsing_nsdmi, at cp/parser.c:18311 lukeallardyce at gmail dot com
                   ` (3 preceding siblings ...)
  2015-03-10 16:47 ` jason at gcc dot gnu.org
@ 2015-03-10 19:11 ` jakub at gcc dot gnu.org
  2015-03-11 19:11 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-10 19:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Tue Mar 10 19:10:43 2015
New Revision: 221332

URL: https://gcc.gnu.org/viewcvs?rev=221332&root=gcc&view=rev
Log:
    PR c++/65127
    * parser.c (parsing_nsdmi): Don't return true if current_class_ptr
    is not a PARM_DECL.

    * g++.dg/cpp0x/pr65127.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/pr65127.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/65127] [5 Regression] internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'addr_expr' in parsing_nsdmi, at cp/parser.c:18311
  2015-02-20  1:14 [Bug c++/65127] New: internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'addr_expr' in parsing_nsdmi, at cp/parser.c:18311 lukeallardyce at gmail dot com
                   ` (4 preceding siblings ...)
  2015-03-10 19:11 ` jakub at gcc dot gnu.org
@ 2015-03-11 19:11 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-11 19:11 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2015-03-11 19:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-20  1:14 [Bug c++/65127] New: internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'addr_expr' in parsing_nsdmi, at cp/parser.c:18311 lukeallardyce at gmail dot com
2015-02-20  9:48 ` [Bug c++/65127] [5 Regression] " mpolacek at gcc dot gnu.org
2015-02-20 13:55 ` jakub at gcc dot gnu.org
2015-02-24 20:38 ` ktietz at gcc dot gnu.org
2015-03-10 16:47 ` jason at gcc dot gnu.org
2015-03-10 19:11 ` jakub at gcc dot gnu.org
2015-03-11 19:11 ` jakub 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).