https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82107
Bug ID: 82107 Summary: O2 optimisation on amd64 leads to error Product: gcc Version: 6.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: loquens at yandex dot ru Target Milestone: --- Created attachment 42129 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42129&action=edit full error example sources Complete source code attached. Steps to reproduce this bug in amd64-environment: * extract archive contents * enter directory optfail * call make * run ./optimization_fail - program will hang Please see comments marked "IMPORTANT" in sources and Makefile. All theese notes change behaviour (error dissapears). Originally found on GCC-6.3.0 compiled from sources, but 7.0.1 (from Ubuntu 17.04 repos, full version shown below) and 7.2.0 (compiled from sources, same flags as 6.3.0, shown below) also produce error. $ lsb_release -a LSB Version: core-9.20160110ubuntu5-amd64:core-9.20160110ubuntu5-noarch:security-9.20160110ubuntu5-amd64:security-9.20160110ubuntu5-noarch Distributor ID: Ubuntu Description: Ubuntu 17.04 Release: 17.04 Codename: zesty $ g++ --version g++ (Ubuntu 7-20170407-0ubuntu2) 7.0.1 20170407 (experimental) [trunk revision 246759] Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. gcc-7.2.0 compilation flags: ./configure --disable-cloog-version-check \ --disable-ppl-version-check --enable-cloog-backend=isl \ --enable-gold --enable-languages=c,c++ --enable-lto --enable-libssp \ --prefix=/install/prefix --with-cloog=/install/prefix \ --with-gmp=/install/prefix --with-mlgmp=/install/prefix \ --with-mpc=/install/prefix --with-mpfr=/install/prefix \ --with-ppl=/install/prefix With best regards, loquens