Bug 2435317 - error interno del compilador: en on_throw, en analyzer/engine.cc:1814
Summary: error interno del compilador: en on_throw, en analyzer/engine.cc:1814
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 44
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL: https://pccito.ugr.es/bug/
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-01-29 16:22 UTC by gustavo
Modified: 2026-03-04 11:55 UTC (History)
12 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2026-03-04 11:55:49 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 123880 0 P3 UNCONFIRMED [16 Regression] ICE with -fanalyzer in ana::exploded_node::on_throw 2026-01-29 18:40:43 UTC

Description gustavo 2026-01-29 16:22:27 UTC
gustavo@casa:~/src/c++/bug$ LANG=C make
g++ -fanalyzer -g -march=native -O3 -std=c++23    tree.cc   -o tree
during IPA pass: analyzer
In file included from tree.cc:1:
/usr/include/c++/16/generator: In member function 'void std::__gen::_Promise_erased<_Yielded>::unhandled_exception() [with _Yielded = const char&]':
/usr/include/c++/16/generator:198:13: internal compiler error: in on_throw, at analyzer/engine.cc:1814
  198 |             throw;
      |             ^~~~~
Please submit a full bug report, with preprocessed source.
See <https://bugzilla.redhat.com/> for instructions.
rm cc	Preprocessed source stored into /tmp/ccsgapIK.out file, please attach this to your bugreport.
make: *** [<builtin>: tree] Error 1

Reproducible: Always

Steps to Reproduce:
1. try to compile the source code with -fanalyzer activated on gcc
2.
3.
Actual Results:
interna compiler error


Additional Information:
gcc versión 16.0.1 20260115 (Red Hat 16.0.1-0) (GCC) from rawhide

Comment 1 gustavo 2026-01-29 16:25:24 UTC
// this is the source code...

#include <generator>
#include <iostream>

template<typename T> struct Tree
{
    T value;
    Tree *left{}, *right{};

    std::generator<const T &> traverse_preorder() const
    {
        co_yield value;
        if (left)
            co_yield std::ranges::elements_of(left->traverse_preorder());
        if (right)
            co_yield std::ranges::elements_of(right->traverse_preorder());
    }
};

int main()
{
    Tree<char> tree[]
    {
                                    {'D', tree + 1, tree + 2},
        //                            │
        //            ┌───────────────┴────────────────┐
        //            │                                │
                    {'B', tree + 3, tree + 4},       {'F', tree + 5, tree + 6},
        //            │                                │
        //  ┌─────────┴─────────────┐      ┌───────────┴─────────────┐
        //  │                       │      │                         │
          {'A'},                  {'C'}, {'E'},                    {'G'}
    };

    std::cout << " Preorder: ";
    for (char x : tree->traverse_preorder())
        std::cout << x << ' ';
    std::cout << '\n';
}

Comment 2 Dave Malcolm 2026-01-29 17:53:27 UTC
Reproducer on Compiler Explorer: https://godbolt.org/z/Ez7xnbddf

Comment 3 Dave Malcolm 2026-01-29 18:40:44 UTC
Filed upstream as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123880

Comment 4 Dave Malcolm 2026-01-31 04:39:41 UTC
Should be fixed upstream on trunk by r16-7206-gb5d5cab8e4b807.

Comment 5 Jakub Jelinek 2026-03-04 11:55:49 UTC
So should be then fixed in gcc-16.0.1-0.6.fc4* and later.


Note You need to log in before you can comment on or make changes to this bug.