Bug 110675 - Using std::set with avx2 pragma is broken on latest gcc version (compilation fails)
Summary: Using std::set with avx2 pragma is broken on latest gcc version (compilation ...
Status: RESOLVED DUPLICATE of bug 109753
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 13.1.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on: 110334
Blocks:
  Show dependency treegraph
 
Reported: 2023-07-15 12:30 UTC by gcc.gnu.org
Modified: 2023-07-15 22:41 UTC (History)
2 users (show)

See Also:
Host:
Target: x86_64
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
All files (.cpp, .ii, .s) inclusing logs.zip (86.08 KB, application/zip)
2023-07-15 12:30 UTC, gcc.gnu.org
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gcc.gnu.org 2023-07-15 12:30:17 UTC
Created attachment 55549 [details]
All files (.cpp, .ii, .s) inclusing logs.zip

Code
```
#pragma GCC target ("avx2")
#include <set>

int main(void) {
    std::set<int> s;
    return 0;
}
```

Compilation command -
```
g++ -static -std=c++20 a.cpp
```

Expected behaviour - Program compiles successfully.            
Actual behaviour - Program fails to compile.             

Compiler logs (Detailed logs attached) -
```
/usr/include/c++/13.1.1/bits/allocator.h: In destructor ‘constexpr std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::_Rb_tree_impl<std::less<int>, true>::~_Rb_tree_impl()’:
/usr/include/c++/13.1.1/bits/allocator.h:184:7: error: inlining failed in call to ‘always_inline’ ‘constexpr std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = std::_Rb_tree_node<int>]’: target specific option mismatch
  184 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
/usr/include/c++/13.1.1/bits/stl_tree.h:662:16: note: called from here
  662 |         struct _Rb_tree_impl
```

System - Arch Linux (fully updated 2-3 days ago)
Comment 1 Andrew Pinski 2023-07-15 16:11:41 UTC
See bug 110334 comment #19
Comment 2 Xi Ruoyao 2023-07-15 17:23:33 UTC
Clearly related to PR109753, but I'm not sure if it's OK to just mark it as a dup.
Comment 3 Xi Ruoyao 2023-07-15 22:41:17 UTC
Now I think it's definitely PR109753 (considering the simple reduced test case in PR109753)...

*** This bug has been marked as a duplicate of bug 109753 ***