This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81410] New: O3 breaks code
- From: "gcc at sjor dot sg" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 12 Jul 2017 11:25:56 +0000
- Subject: [Bug c++/81410] New: O3 breaks code
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81410
Bug ID: 81410
Summary: O3 breaks code
Product: gcc
Version: 7.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gcc at sjor dot sg
Target Milestone: ---
Created attachment 41729
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41729&action=edit
Minimal test case
See attached code. Tested on Ubuntu's gcc 6.2.0, Debian's 6.3.0, Arch's 7.1.1.
Testcase is about as minimal as I could get it.
Compile with -O3 -std=c++11.
As you see, it extracts data from a vector<pair> to two vectors. Then, it
checks whether the vector<pair>.first and vector<pair.first> have the same
values. If so, it exit(1)'s which confirms the bug is present.