public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/95984] New: [11 Regression] Internal compiler error: Error reporting routines re-entered. since r11-1697-g75ff24e1920ea6b1
@ 2020-06-29 18:36 marxin at gcc dot gnu.org
  2020-06-29 20:46 ` [Bug tree-optimization/95984] " msebor at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-06-29 18:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95984
           Summary: [11 Regression] Internal compiler error: Error
                    reporting routines re-entered. since
                    r11-1697-g75ff24e1920ea6b1
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: msebor at gcc dot gnu.org
  Target Milestone: ---

Since the revision I see:

$ cat
/home/marxin/Programming/gcc/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic6.C
// PR c++/78816
// { dg-do compile { target c++14 } }

void f(void (*f1)(int)) {
  f1(42);
}

template <typename Lambda>
static auto callback(Lambda &&l)
{
  static auto* p = &l;
  p = &l;
  return [](auto... x){ return (*p)(x...); };
}

int main() {
  int x = 5;
  f(callback([=](int y){}));
}

$ g++
/home/marxin/Programming/gcc/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic6.C
-Wnonnull
/home/marxin/Programming/gcc/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic6.C:
In substitution of ‘template<class ... auto:1> constexpr
callback<main()::<lambda(int)> >::<lambda(auto:1 ...)>::operator decltype
(((const callback<main()::<lambda(int)> >::<lambda(auto:1
...)>*)0)->operator()<auto:1
...>(static_cast<auto:1&&>(callback::._anon_2::_FUN::<unnamed>) ...))
(*)(auto:1 ...)() const [with auto:1 = {int}]’:
/home/marxin/Programming/gcc/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic6.C:18:27:
  required from here
/home/marxin/Programming/gcc/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic6.C:13:10:
warning: ‘this’ pointer null [-Wnonnull]
   13 |   return [](auto... x){ return (*p)(x...); };
      |          ^
/home/marxin/Programming/gcc/gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic6.C:13:10:
note: in a call to non-static member function ‘callback<main()::<lambda(int)>
>::<lambda(auto:1 ...)> [with auto:1 = {int}]’
‘
Internal compiler error: Error reporting routines re-entered.
0xb04ef1 check_nonnull_arg
        /home/marxin/Programming/gcc/gcc/c-family/c-common.c:5523
0xb05f72 check_function_arguments_recurse(void (*)(void*, tree_node*, unsigned
long), void*, tree_node*, unsigned long)
        /home/marxin/Programming/gcc/gcc/c-family/c-common.c:5881
0xb05cd1 check_function_arguments_recurse(void (*)(void*, tree_node*, unsigned
long), void*, tree_node*, unsigned long)
        /home/marxin/Programming/gcc/gcc/c-family/c-common.c:5813
0xb043e8 check_function_nonnull
        /home/marxin/Programming/gcc/gcc/c-family/c-common.c:5315
0xb05a9e check_function_arguments(unsigned int, tree_node const*, tree_node
const*, int, tree_node**, vec<unsigned int, va_heap, vl_ptr>*)
        /home/marxin/Programming/gcc/gcc/c-family/c-common.c:5764
0x867a94 build_over_call
        /home/marxin/Programming/gcc/gcc/cp/call.c:8868
0x869e3c build_new_method_call_1
        /home/marxin/Programming/gcc/gcc/cp/call.c:10348
0x86ad5f build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
        /home/marxin/Programming/gcc/gcc/cp/call.c:10423
0xa2b3f2 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:20042
0xa2d1c0 tsubst(tree_node*, tree_node*, int, tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:15913
0x935ad7 dump_template_bindings
        /home/marxin/Programming/gcc/gcc/cp/error.c:416
0x935d30 dump_substitution
        /home/marxin/Programming/gcc/gcc/cp/error.c:1562
0x935d30 dump_substitution
        /home/marxin/Programming/gcc/gcc/cp/error.c:1550
0x92f610 dump_function_decl
        /home/marxin/Programming/gcc/gcc/cp/error.c:1720
0x937178 decl_to_string
        /home/marxin/Programming/gcc/gcc/cp/error.c:3101
0x937178 cp_printer
        /home/marxin/Programming/gcc/gcc/cp/error.c:4261
0x1e2aafc pp_format(pretty_printer*, text_info*)
        /home/marxin/Programming/gcc/gcc/pretty-print.c:1475
0x1e2cb80 pp_format_verbatim(pretty_printer*, text_info*)
        /home/marxin/Programming/gcc/gcc/pretty-print.c:1536
0x1e2cb80 pp_verbatim(pretty_printer*, char const*, ...)
        /home/marxin/Programming/gcc/gcc/pretty-print.c:1790
0x92ce56 print_instantiation_full_context
        /home/marxin/Programming/gcc/gcc/cp/error.c:3503
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

* [Bug tree-optimization/95984] [11 Regression] Internal compiler error: Error reporting routines re-entered. since r11-1697-g75ff24e1920ea6b1
  2020-06-29 18:36 [Bug tree-optimization/95984] New: [11 Regression] Internal compiler error: Error reporting routines re-entered. since r11-1697-g75ff24e1920ea6b1 marxin at gcc dot gnu.org
@ 2020-06-29 20:46 ` msebor at gcc dot gnu.org
  2020-06-30 17:56 ` [Bug c++/95984] " dje at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-06-29 20:46 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-06-29
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |mpolacek at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
If I'm reading the dump right the front end constructs a lambda object and
calls its member operator() with a null this pointer:

;; Function static decltype (((const callback<main()::<lambda(int)>
>::<lambda(auto:1 ...)>*)0)->operator()<auto:1
...>(static_cast<auto:1&&>(callback::._anon_2::_FUN::<unnamed>) ...))
callback<main()::<lambda(int)> >::<lambda(auto:1 ...)>::_FUN(auto:1 ...) [with
auto:1 = {int}; decltype (((const callback<main()::<lambda(int)>
>::<lambda(auto:1 ...)>*)0)->operator()<auto:1
...>(static_cast<auto:1&&>(callback::._anon_2::_FUN::<unnamed>) ...)) = void]
(null)
;; enabled by -tree-original


<<cleanup_point <<< Unknown tree: expr_stmt
  callback<main()::<lambda(int)> >::<lambda(auto:1 ...)>::operator()<int> (0B,
D.2439) >>>>>;
return;

So it seems like the warning code is doing what it's supposed to.

The ICE is triggered by the C++ front end printing the instantiation context
(print_instantiation_full_context), the pretty printer formatting the template
specialization, calling into the C++ front end to perform type substitution,
and the FE ending up calling check_nonnull_arg() on the call, which ends up
triggering the warning and re-entering the diagnostic machinery.  There is
nothing out of the ordinary the warning does to do this so it must be a latent
problem in the C++ front end that the warning exposed.  I expect Jason or Marek
have seen and deal with something like this before.

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

* [Bug c++/95984] [11 Regression] Internal compiler error: Error reporting routines re-entered. since r11-1697-g75ff24e1920ea6b1
  2020-06-29 18:36 [Bug tree-optimization/95984] New: [11 Regression] Internal compiler error: Error reporting routines re-entered. since r11-1697-g75ff24e1920ea6b1 marxin at gcc dot gnu.org
  2020-06-29 20:46 ` [Bug tree-optimization/95984] " msebor at gcc dot gnu.org
@ 2020-06-30 17:56 ` dje at gcc dot gnu.org
  2020-06-30 17:57 ` msebor at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dje at gcc dot gnu.org @ 2020-06-30 17:56 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0

David Edelsohn <dje at gcc dot gnu.org> changed:

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

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

* [Bug c++/95984] [11 Regression] Internal compiler error: Error reporting routines re-entered. since r11-1697-g75ff24e1920ea6b1
  2020-06-29 18:36 [Bug tree-optimization/95984] New: [11 Regression] Internal compiler error: Error reporting routines re-entered. since r11-1697-g75ff24e1920ea6b1 marxin at gcc dot gnu.org
  2020-06-29 20:46 ` [Bug tree-optimization/95984] " msebor at gcc dot gnu.org
  2020-06-30 17:56 ` [Bug c++/95984] " dje at gcc dot gnu.org
@ 2020-06-30 17:57 ` msebor at gcc dot gnu.org
  2020-07-01 16:37 ` msebor at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-06-30 17:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
*** Bug 96008 has been marked as a duplicate of this bug. ***

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

* [Bug c++/95984] [11 Regression] Internal compiler error: Error reporting routines re-entered. since r11-1697-g75ff24e1920ea6b1
  2020-06-29 18:36 [Bug tree-optimization/95984] New: [11 Regression] Internal compiler error: Error reporting routines re-entered. since r11-1697-g75ff24e1920ea6b1 marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-06-30 17:57 ` msebor at gcc dot gnu.org
@ 2020-07-01 16:37 ` msebor at gcc dot gnu.org
  2020-07-06 21:24 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-07-01 16:37 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |msebor at gcc dot gnu.org

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
I'm testing a fix.

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

* [Bug c++/95984] [11 Regression] Internal compiler error: Error reporting routines re-entered. since r11-1697-g75ff24e1920ea6b1
  2020-06-29 18:36 [Bug tree-optimization/95984] New: [11 Regression] Internal compiler error: Error reporting routines re-entered. since r11-1697-g75ff24e1920ea6b1 marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-07-01 16:37 ` msebor at gcc dot gnu.org
@ 2020-07-06 21:24 ` cvs-commit at gcc dot gnu.org
  2020-07-06 21:25 ` msebor at gcc dot gnu.org
  2020-07-08  7:55 ` slyfox at inbox dot ru
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-07-06 21:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Sebor <msebor@gcc.gnu.org>:

https://gcc.gnu.org/g:67a493a0b9e7ce6caba4b8bedf1f3295e477ec00

commit r11-1860-g67a493a0b9e7ce6caba4b8bedf1f3295e477ec00
Author: Martin Sebor <msebor@redhat.com>
Date:   Mon Jul 6 15:23:37 2020 -0600

    Exclude calls to variadic lambda stubs from -Wnonnull checking (PR
c++/95984).

    Resolves:
    PR c++/95984 - Internal compiler error: Error reporting routines re-entered
in -Wnonnull on a variadic lamnda
    PR c++/96021 - missing -Wnonnull passing nullptr to a nonnull variadic
lambda

    gcc/c-family/ChangeLog:

            PR c++/95984
            * c-common.c (check_function_nonnull): Avoid checking syntesized
calls
            to stub lambda objects with null this pointer.
            (check_nonnull_arg): Handle C++ nullptr.

    gcc/cp/ChangeLog:

            PR c++/95984
            * call.c (build_over_call): Check calls only when tf_warning is
set.

    gcc/testsuite/ChangeLog:

            PR c++/95984
            * g++.dg/warn/Wnonnull6.C: New test.

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

* [Bug c++/95984] [11 Regression] Internal compiler error: Error reporting routines re-entered. since r11-1697-g75ff24e1920ea6b1
  2020-06-29 18:36 [Bug tree-optimization/95984] New: [11 Regression] Internal compiler error: Error reporting routines re-entered. since r11-1697-g75ff24e1920ea6b1 marxin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2020-07-06 21:24 ` cvs-commit at gcc dot gnu.org
@ 2020-07-06 21:25 ` msebor at gcc dot gnu.org
  2020-07-08  7:55 ` slyfox at inbox dot ru
  6 siblings, 0 replies; 8+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-07-06 21:25 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Sebor <msebor at gcc dot gnu.org> changed:

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

--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
Fixed by r11-1860.

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

* [Bug c++/95984] [11 Regression] Internal compiler error: Error reporting routines re-entered. since r11-1697-g75ff24e1920ea6b1
  2020-06-29 18:36 [Bug tree-optimization/95984] New: [11 Regression] Internal compiler error: Error reporting routines re-entered. since r11-1697-g75ff24e1920ea6b1 marxin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2020-07-06 21:25 ` msebor at gcc dot gnu.org
@ 2020-07-08  7:55 ` slyfox at inbox dot ru
  6 siblings, 0 replies; 8+ messages in thread
From: slyfox at inbox dot ru @ 2020-07-08  7:55 UTC (permalink / raw)
  To: gcc-bugs

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

Sergei Trofimovich <slyfox at inbox dot ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |slyfox at inbox dot ru

--- Comment #6 from Sergei Trofimovich <slyfox at inbox dot ru> ---
*** Bug 96107 has been marked as a duplicate of this bug. ***

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

end of thread, other threads:[~2020-07-08  7:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-29 18:36 [Bug tree-optimization/95984] New: [11 Regression] Internal compiler error: Error reporting routines re-entered. since r11-1697-g75ff24e1920ea6b1 marxin at gcc dot gnu.org
2020-06-29 20:46 ` [Bug tree-optimization/95984] " msebor at gcc dot gnu.org
2020-06-30 17:56 ` [Bug c++/95984] " dje at gcc dot gnu.org
2020-06-30 17:57 ` msebor at gcc dot gnu.org
2020-07-01 16:37 ` msebor at gcc dot gnu.org
2020-07-06 21:24 ` cvs-commit at gcc dot gnu.org
2020-07-06 21:25 ` msebor at gcc dot gnu.org
2020-07-08  7:55 ` slyfox at inbox dot ru

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).