[Bug 1692525] Re: ICE from template local overload resolution
Matthias Klose
doko at ubuntu.com
Wed May 24 17:43:35 UTC 2017
** Bug watch added: GCC Bugzilla #80856
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80856
** Also affects: gcc via
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80856
Importance: Unknown
Status: Unknown
** Changed in: gcc-7 (Ubuntu)
Status: New => Confirmed
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-7 in Ubuntu.
https://bugs.launchpad.net/bugs/1692525
Title:
ICE from template local overload resolution
Status in gcc:
Confirmed
Status in gcc-7 package in Ubuntu:
Confirmed
Bug description:
This is reported upstream as
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80856, but as instructed
by /usr/share/doc/gcc-7-base/README.Bugs, I'm reporting it here too.
Compiling the attached source file with no flags ("g++-7
EngineReportWriter.cpp") results in an internal compiler error:
EngineReportWriter.cpp: In function ‘T WrapToCycle(T) [with T = int]’:
EngineReportWriter.cpp:2:10: internal compiler error: Segmentation fault
inline T WrapToCycle(T degrees)
^~~~~~~~~~~
0x86f4b4a crash_signal
../../src/gcc/toplev.c:337
0x84d576b useless_type_conversion_p(tree_node*, tree_node*)
../../src/gcc/gimple-expr.c:85
0x83b4b8f types_compatible_p
../../src/gcc/gimple-expr.h:66
0x83b4b8f gimple_check_call_args
../../src/gcc/cgraph.c:3733
0x83b4b8f gimple_check_call_matching_types(gimple*, tree_node*, bool)
../../src/gcc/cgraph.c:3783
0x83b6304 symbol_table::create_edge(cgraph_node*, cgraph_node*, gcall*, long long, int, bool)
../../src/gcc/cgraph.c:864
0x83b6529 cgraph_node::create_edge(cgraph_node*, gcall*, long long, int)
../../src/gcc/cgraph.c:900
0x83bbb06 execute
../../src/gcc/cgraphbuild.c:337
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
The bug appears to be triggered by the combination of a template plus local function declarations plus overload resolution. If I move the local scope function declarations to global scope, or if I change the function declarations so that overload resolution isn't necessary, then the bug goes away.
This is on Ubuntu 14.04 x86, running GCC 7.1.0 from the Ubuntu
Toolchain Test PPA (https://launchpad.net/~ubuntu-
toolchain-r/+archive/ubuntu/test).
Previous versions of GCC (including GCC 6.3.0 from the Ubuntu
Toolchain Test PPA) are unaffected.
GCC 7.1 on godbolt.org is also reporting errors:
https://godbolt.org/g/eAYhqd
To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/1692525/+subscriptions
More information about the foundations-bugs
mailing list