https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97273

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
      Known to work|                            |7.5.0
   Target Milestone|---                         |8.5
   Last reconfirmed|                            |2020-10-02
      Known to fail|                            |10.2.1, 11.0, 8.4.1, 9.3.1
             Status|UNCONFIRMED                 |NEW
            Summary|Strange behaviour of        |[8/9/10/11 Regression]
                   |unordered_set when vector   |Strange behaviour of
                   |is included (i686)          |unordered_set when vector
                   |                            |is included (i686)
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I've been trying to reduce this a bit. So far I've cut it down to:

#include <bits/stl_algobase.h>
#include <bits/allocator.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <bits/stl_vector.h>

#include <unordered_set>
#include <cstdint>

uint64_t getBegin(const std::unordered_set<uint64_t> & set) {
    return *set.begin();
}

which is less than everything in <vector> and still generates the bad code:

  _3 = MEM[(const long long unsigned int &)_4 + 4];

The problem appeared between gcc 7 and gcc 8, apparently due to something added
in the libstdc++ headers. But I'm not sure yet if the actual bug is in the
compiler or library.

Reply via email to