Debian Codegraph @

debian/patches/forceinline-virtual-dtor-gcc16-ftbfs-1133488

raw
1 Description: Drop always_inline on three virtual destructors that delete polymorphic members
2 (Patch from Claude)
3 .
4 Three destructors in gecode/search/cutoff.hpp (CutoffAppend, CutoffMerge,
5 CutoffRepeat) are marked `forceinline`, which expands under GCC to
6 `inline __attribute__((__always_inline__))`. Their bodies invoke
7 `delete` on members of type `Cutoff*`, a class with a virtual destructor.
8 The inlined call graph therefore folds the recursive destruction of every
9 derived Cutoff subclass into each call site, and under g++-16 the cost
10 model rejects the expansion with
11 .
12 error: inlining failed in call to 'always_inline'
13 'virtual Gecode::Search::CutoffAppend::~CutoffAppend() noexcept':
14 --param max-inline-insns-single limit reached
15 .
16 With g++-15 the same source compiled because the inliner budget happened
17 to admit the bodies; nothing semantically depends on inlining a virtual
18 destructor that is always invoked through a vtable, so the `always_inline`
19 annotation was never load-bearing. Replace `forceinline` with plain
20 `inline` on the three destructor definitions. `inline` preserves ODR
21 (the bodies sit in a header pulled into ~48 translation units via
22 gecode/search.hh) and lets the compiler decide. The constructors keep
23 `forceinline`; only the three destructors change.
24 Author: Kari Pahula <[email protected]>
25 Forwarded: no
26 Last-Update: 2026-05-17
27
28 Index: gecode-6.2.0/gecode/search/cutoff.hpp
29 ===================================================================
30 --- gecode-6.2.0.orig/gecode/search/cutoff.hpp
31 +++ gecode-6.2.0/gecode/search/cutoff.hpp
32 @@ -99,7 +99,7 @@ namespace Gecode { namespace Search {
33 forceinline
34 CutoffAppend::CutoffAppend(Cutoff* d1, unsigned long int n0, Cutoff* d2)
35 : c1(d1), c2(d2), n(n0) {}
36 - forceinline
37 + inline
38 CutoffAppend::~CutoffAppend(void) {
39 delete c1; delete c2;
40 }
41 @@ -108,7 +108,7 @@ namespace Gecode { namespace Search {
42 forceinline
43 CutoffMerge::CutoffMerge(Cutoff* d1, Cutoff* d2)
44 : c1(d1), c2(d2) {}
45 - forceinline
46 + inline
47 CutoffMerge::~CutoffMerge(void) {
48 delete c1; delete c2;
49 }
50 @@ -119,7 +119,7 @@ namespace Gecode { namespace Search {
51 : c(c1), i(0), n(n0) {
52 cutoff = (*c)();
53 }
54 - forceinline
55 + inline
56 CutoffRepeat::~CutoffRepeat(void) {
57 delete c;
58 }