Bug 102242 - [12 regression] analyzer/engine.cc built with clang: /usr/include/c++/v1/typeinfo:346:5: error: no member named 'fancy_abort'
Summary: [12 regression] analyzer/engine.cc built with clang: /usr/include/c++/v1/type...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 12.0
: P3 normal
Target Milestone: 12.0
Assignee: Gerald Pfeifer
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2021-09-08 19:00 UTC by Gerald Pfeifer
Modified: 2021-09-17 12:57 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2021-09-08 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Pfeifer 2021-09-08 19:00:44 UTC
Only with clang as bootstrap compiler:

  In file included from
/scratch/tmp/gerald/GCC-HEAD/gcc/analyzer/engine.cc:69:
  In file included from /usr/include/c++/v1/memory:653:
  /usr/include/c++/v1/typeinfo:346:5: error: no member named 'fancy_abort' 
    in name space 'std::__1'; did you mean simply 'fancy_abort'?
    _VSTD::abort();
    ^~~~~~~
  /usr/include/c++/v1/__config:782:15: note: expanded from macro '_VSTD'
  #define _VSTD std::_LIBCPP_ABI_NAMESPACE
                ^
  /scratch/tmp/gerald/GCC-HEAD/gcc/system.h:777:13: note: 'fancy_abort'
declared here
  extern void fancy_abort (const char *, int, const char *)
              ^

I am pretty sure this is caused by

  gcc/analyzer/ChangeLog:
       PR analyzer/99260
       * analyzer.h (class custom_edge_info): New class, adapted from
       exploded_edge::custom_info_t.  Make member functions const.
       Make update_model return bool, converting edge param from
       reference to a pointer, and adding a ctxt param.
       (class path_context): New class.
       * call-info.cc: New file.
       * call-info.h: New file.
       * engine.cc: Include "analyzer/call-info.h" and <memory>.

and think I have an idea how to tackle this. Prototype patch in testing...
Comment 1 David Malcolm 2021-09-08 19:15:20 UTC
Sorry about the breakage.

I think I need to #define INCLUDE_UNIQUE_PTR before including system.h, rather than manually including <memory>.  Was that what your patch does?
Comment 2 Andrew Pinski 2021-09-08 22:24:39 UTC
Confirmed.
Comment 3 Gerald Pfeifer 2021-09-08 22:34:17 UTC
(In reply to David Malcolm from comment #1)
> Sorry about the breakage.

That's what my nightly testers are here for to catch. :)

> I think I need to #define INCLUDE_UNIQUE_PTR before including system.h,
> rather than manually including <memory>.  Was that what your patch does?

In my patch, which passed bootstrap in the meantime, I added

    #ifdef INCLUDE_MEMORY
    # include <memory>
    #endif

to gcc/system.h and defined INCLUDE_MEMORY early in analyzer/engine.cc.

Your patch sounds a little lighter and in fact more portable, so happy if
you want to go with it.
Comment 4 Iain Sandoe 2021-09-14 12:27:10 UTC
maxim has posted the (IMO obvious) patch here:

https://gcc.gnu.org/pipermail/gcc-patches/2021-September/579159.html

as noted any platform that might be bootstrapped using clang is affected.
Comment 5 GCC Commits 2021-09-16 22:36:49 UTC
The master branch has been updated by Gerald Pfeifer <gerald@gcc.gnu.org>:

https://gcc.gnu.org/g:745781d24cd7562202687cfbe05597ee673d4537

commit r12-3598-g745781d24cd7562202687cfbe05597ee673d4537
Author: Maxim Blinov <maxim.blinov@embecosm.com>
Date:   Fri Sep 17 00:32:58 2021 +0200

    analyzer: Fix bootstrap with clang
    
    gcc/analyzer/ChangeLog:
            PR bootstrap/102242
            * engine.cc (INCLUDE_UNIQUE_PTR): Define.
Comment 6 Gerald Pfeifer 2021-09-17 10:02:41 UTC
Passed testing on my regular tester that flagged this issue last night.
Comment 7 David Malcolm 2021-09-17 12:57:21 UTC
Thanks for taking care of this.