Public bug reported:

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

** Affects: gcc-7 (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "EngineReportWriter.cpp"
   
https://bugs.launchpad.net/bugs/1692525/+attachment/4881372/+files/EngineReportWriter.cpp

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1692525

Title:
  ICE from template local overload resolution

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-7/+bug/1692525/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to