[Bug tree-optimization/95984] [11 Regression] Internal compiler error: Error reporting routines re-entered. since r11-1697-g75ff24e1920ea6b1

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jun 29 20:46:04 GMT 2020


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.


More information about the Gcc-bugs mailing list