[Bug c++/109283] Destructor of co_yield conditional argument called twice

2023-05-08 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109283

--- Comment #3 from ncm at cantrip dot org ---
Appears fixed in 13.1

Still ICEs in trunk,
Compiler-Explorer-Build-gcc-70d038235cc91ef1ea4fce519e628cfb2d297bff-binutils-2.40)
14.0.0 20230508 (experimental):
: In function 'std::generator >
source(int&, std::string)':
:513:1: internal compiler error: in flatten_await_stmt, at
cp/coroutines.cc:2899
  513 | }

[Bug c++/59498] [DR 1430][10/11/12/13 Regression] Pack expansion error in template alias

2023-03-29 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59498

--- Comment #22 from ncm at cantrip dot org ---
CWG 1430 seems to be about disallowing a construct that requires capturing an
alias declaration into a name mangling. This bug and at least some of those
referred to it do not ask for any such action.

[Bug c++/109283] Destructor of co_yield conditional argument called twice

2023-03-29 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109283

--- Comment #2 from ncm at cantrip dot org ---
Betting this one is fixed by deleting code.

[Bug c++/109291] type alias template rejects pack

2023-03-27 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109291

--- Comment #2 from ncm at cantrip dot org ---
CWG 1430 is still marked Open, and is anyway only superficially
analogous. Here, there is no need for an alias to be encoded
into a type signature.

[Bug c++/109291] New: type alias template rejects pack

2023-03-27 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109291

Bug ID: 109291
   Summary: type alias template rejects pack
   Product: gcc
   Version: 12.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ncm at cantrip dot org
  Target Milestone: ---

template 
struct type_identity { using type = T; };

template 
using type_identity_t = typename type_identity::type;

template 
struct S1 { using alias1 = typename type_identity::type; };

template 
struct S2 { using alias2 = typename type_identity_t; };

int main() {
  S1::alias1 a; // OK
  S2::alias2 b; // Fails
}

// Here, alias1 is fine, but alias2, the same type, is not.
// MSVC accepts both declarations. Clang matches Gcc.

// error: pack expansion argument for non-pack parameter ‘T’ of alias template
// error: expected nested-name-specifier

[Bug c++/109283] New: Destructor of co_yield conditional argument called twice

2023-03-25 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109283

Bug ID: 109283
   Summary: Destructor of co_yield conditional argument called
twice
   Product: gcc
   Version: 12.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ncm at cantrip dot org
  Target Milestone: ---

Created attachment 54754
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54754&action=edit
Reproducer

Basically:

  co_yield a ? s : t;

segfaults,

  if (a) co_yield s; else co_yield t;

does not. The segfault traces to s/t's destructor being called 
twice. Full reproducer attached, relying on Casey Carter's 
generator implementation, pasted in.

This may be related to 101367.

Compiled with gcc-12.2, this program segfaults.
Compiled with gcc-trunk or gcc-coroutines on Godbolt, identified as:

  g++
(Compiler-Explorer-Build-gcc-13ec81eb4c3b484ad636000fa8f6d925e15fb983-binutils-2.38)
13.0.1 20230325 (experimental)

the compiler ICEs:

  :513:1: internal compiler error: in flatten_await_stmt, at
cp/coroutines.cc:2899
  513 | }

[Bug c++/68703] __attribute__((vector_size(N))) template member confusion

2021-05-04 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68703

--- Comment #10 from ncm at cantrip dot org ---
(In reply to ncm from comment #9)
> This bug appears not to manifest in g++-8, 9, and 10.
Of the three code samples in comment 4, the first and 
third fail to compile because N is undefined. What 
code was intended there? It seems like we should check
the corrected versions of those before declaring this 
fixed.

The code sample in example 3 still reports failings in
g++-10.2.

[Bug target/87085] with -march=i386, gcc should not generate code including endbr instruction

2020-11-20 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87085

ncm at cantrip dot org changed:

   What|Removed |Added

 CC||ncm at cantrip dot org

--- Comment #8 from ncm at cantrip dot org ---
(In reply to H.J. Lu from comment #7)
> (In reply to chengming from comment #4)
> > Created attachment 44602 [details]
> > ELF file
> > 
> > compiled with command
> > gcc -v -save-temps -m32 -march=i386 -fcf-protection=none -o onlyReturn
> > onlyReturn.c > output.txt 2>&1
> 
> Fedora 28 run-time only supports i686 or above.  You can't use any libraries
> on Fedora 28.

Not relevant: Reporter is not trying to run i386 code on fedora 28, but only
generate i386 code to run on a cross target.

[Bug tree-optimization/97736] [9/10/11 Regression] switch codegen

2020-11-16 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97736

--- Comment #12 from ncm at cantrip dot org ---
As it is, your probability of failure in 9 and 10 is exactly 1.0.

[Bug tree-optimization/97736] [9/10/11 Regression] switch codegen

2020-11-16 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97736

--- Comment #10 from ncm at cantrip dot org ---
Don't understand, the compiler we are using (9) has the 
regression. It looks like a trivial backport.

[Bug libstdc++/42857] std::istream::ignore(std::streamsize n) calls unnecessary underflow

2020-11-10 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42857

--- Comment #9 from ncm at cantrip dot org ---
(In reply to Jonathan Wakely from comment #8)
> Probably changed by one of the patches for PR 94749 or PR 96161, although I
> still see two reads for the first example.

Thank you, I was mistaken. This bug is still present in g++-10.

[Bug c++/68703] __attribute__((vector_size(N))) template member confusion

2020-11-10 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68703

--- Comment #9 from ncm at cantrip dot org ---
This bug appears not to manifest in g++-8, 9, and 10.

[Bug c++/66028] false positive, unused loop variable

2020-11-10 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66028

--- Comment #2 from ncm at cantrip dot org ---
This bug appears not to manifest in g++-10.2.

[Bug libstdc++/42857] std::istream::ignore(std::streamsize n) calls unnecessary underflow

2020-11-10 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42857

--- Comment #7 from ncm at cantrip dot org ---
This bug appears not to manifest in g++-10.

[Bug c++/58855] Attributes ignored on type alias in template

2020-11-10 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58855

--- Comment #2 from ncm at cantrip dot org ---
This bug is still present in g++-10.2

[Bug tree-optimization/97736] [9/10/11 Regression] switch codegen

2020-11-09 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97736

--- Comment #6 from ncm at cantrip dot org ---
The referenced patch seems to have also deleted a fair bit of explanatory
comment text, including a list of possible refinements for selected targets.

[Bug target/97736] New: [9/10 Regression] switch codegen

2020-11-05 Thread ncm at cantrip dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97736

Bug ID: 97736
   Summary: [9/10 Regression] switch codegen
   Product: gcc
   Version: 9.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ncm at cantrip dot org
  Target Milestone: ---

In Gcc 8 and previous, the following code 

  bool is_vowel(char c) {
switch (c)
case'a':case'e':case'i':case'o':case'u':
  return true;
return false;
  }

compiled with -O2 or better, for numerous x86-64 targets,
resolves to a bitwise flag check, e.g.

lea ecx, [rdi-97]
xor eax, eax
cmp cl, 20
ja  .L1
mov eax, 1
sal rax, cl
testeax, 1065233
setne   al
  .L1:
ret

Starting in gcc-9, this optimization is not performed 
anymore at -O2 for many common targets (e.g. -march=skylake),
and we get

sub edi, 97
cmp dil, 20
ja  .L2
movzx   edi, dil
jmp [QWORD PTR .L4[0+rdi*8]]
  .L4:
.quad   .L5
.quad   .L2
.quad   .L2
.quad   .L2
.quad   .L5
.quad   .L2
.quad   .L2
.quad   .L2
.quad   .L5
.quad   .L2
.quad   .L2
.quad   .L2
.quad   .L2
.quad   .L2
.quad   .L5
.quad   .L2
.quad   .L2
.quad   .L2
.quad   .L2
.quad   .L2
.quad   .L5
  .L2:
mov eax, 0
ret
  .L5:
mov eax, 1
ret

same as with -O0 or -O1.