https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78060
Bug ID: 78060 Summary: -O3 causes "error: type mismatch in binary expression" Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: dcb314 at hotmail dot com Target Milestone: --- Created attachment 39859 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39859&action=edit C++ source code The attached source code, when compiled by gcc dated 20161021, and the compiler flags -O3 -std=c++98, does this: $ ../results/bin/g++ -c -O3 -std=c++98 bug314.cc alm_map_tools.cc: In function ‘void map2alm_pol(const std::vector<ringpair>&, const T*, const T*, const T*, Alm<xcomplex<T> >&, Alm<xcomplex<T> >&, Alm<xcomplex<T> >&, bool) [with T = float]’: alm_map_tools.cc:314:27: error: type mismatch in binary expression long int long int int _2419 = _2421 - m_1338; alm_map_tools.cc:314:27: internal compiler error: verify_gimple failed 0xec77f9 verify_gimple_in_cfg(function*, bool) ../../trunk/gcc/tree-cfg.c:5208 0xd750bb execute_function_todo ../../trunk/gcc/passes.c:1965 0xd762e8 do_per_function ../../trunk/gcc/passes.c:1649 0xd762e8 execute_todo ../../trunk/gcc/passes.c:2015 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. Compiles fine with -O2 $ ../results/bin/g++ -c -O2 -std=c++98 bug314.cc $