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.

Reply via email to