[Bug c++/114013] [14 Regression] Specializations of var templates no longer emitted since r14-8987

2024-02-27 Thread enrico.seiler+gccbugs at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114013

--- Comment #3 from Enrico Seiler  ---
For -O0 and -O1, this also does not link:

template  int value;
template <> inline int value<1>;
void bar(int) { bar(value<1>); }

https://godbolt.org/z/Wxv7PE8ob

[Bug libstdc++/109737] New: [13/14] Hitting unreachable code when using std::string::assign with iterators

2023-05-04 Thread enrico.seiler+gccbugs at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109737

Bug ID: 109737
   Summary: [13/14] Hitting unreachable code when using
std::string::assign with iterators
   Product: gcc
   Version: 13.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: enrico.seiler+gccbugs at outlook dot com
  Target Milestone: ---

The following emits "runtime error: execution reached an unreachable program
poin" when compiling with `-g -fsanitize=undefined -std=c++20`:

```

#include 
#include 
#include 

void fits_in_local_buffer()
{
std::stringstream source{"123457890123456"};
std::string str;
str.assign(std::istreambuf_iterator{source},
std::istreambuf_iterator{});
assert(str == "123457890123456");
}

void does_not_fit_in_local_buffer()
{
std::stringstream source{"1234578901234567"};
std::string str;
str.assign(std::istreambuf_iterator{source},
std::istreambuf_iterator{});
assert(str == "1234578901234567");
}

int main()
{
fits_in_local_buffer(); // OK
does_not_fit_in_local_buffer(); // Not OK
return 0;
}

```

Compiler Explorer: https://godbolt.org/z/6obr7afon

* Must be at least compiled with CPP20
* Using std::string's constructor with the iterators works.
* Unreachable was introduced with PR109299
https://github.com/gcc-mirror/gcc/commit/bf78b43873b0b7e8f9a430df38749b8b61f9c9b8
* The std::istreambuf_iterator is used as an example, but the same happens when
using, for example, a std::views::iota and using its iterators

[Bug libstdc++/107636] [13 regression] r13-3761-ga239a63f868e29 breaks build on powerpc64le with __float128 support

2022-11-11 Thread enrico.seiler+gccbugs at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107636

--- Comment #1 from Enrico Seiler  ---
The `#define`s can also be omitted. Then the error will occur when compiling
with -std=c++23

[Bug libstdc++/107636] New: [13 regression] r13-3761-ga239a63f868e29 breaks build on powerpc64le with __float128 support

2022-11-11 Thread enrico.seiler+gccbugs at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107636

Bug ID: 107636
   Summary: [13 regression] r13-3761-ga239a63f868e29 breaks build
on powerpc64le with __float128 support
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: enrico.seiler+gccbugs at outlook dot com
  Target Milestone: ---

The following does not compile:

```
#define __STDCPP_FLOAT128_T__
#define _GLIBCXX_HAVE_FLOAT128_MATH
#define _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT

#include 

int main()
{}
```

```
include/c++/13.0.0/charconv: In function ‘std::to_chars_result
std::to_chars(char*, char*, _Float128)’:
include/c++/13.0.0/charconv:890:5: error: expected primary-expression before
‘return’
  890 | return to_chars(__first, __last, static_cast<__float128>(__value));
  | ^~
include/c++/13.0.0/charconv: In function ‘std::to_chars_result
std::to_chars(char*, char*, _Float128, chars_format)’:
include/c++/13.0.0/charconv:897:5: error: expected primary-expression before
‘return’
  897 | return to_chars(__first, __last, static_cast<__float128>(__value),
__fmt);
  | ^~
include/c++/13.0.0/charconv: In function ‘std::to_chars_result
std::to_chars(char*, char*, _Float128, chars_format, int)’:
include/c++/13.0.0/charconv:904:5: error: expected primary-expression before
‘return’
  904 | return to_chars(__first, __last, static_cast<__float128>(__value),
__fmt,
  | ^~
```

Related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107562

It seems there are a few __extension__ where they should not be:

  inline to_chars_result
  to_chars(char* __first, char* __last, _Float128 __value) noexcept
  {
__extension__
return to_chars(__first, __last, static_cast<__float128>(__value));
  }