[Bug c++/97587] New: [coroutines] promise_type constructor is called with original parameters, not parameter copies

2020-10-26 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97587

Bug ID: 97587
   Summary: [coroutines] promise_type constructor is called with
original parameters, not parameter copies
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jehelset at gmail dot com
  Target Milestone: ---

Created attachment 49443
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49443&action=edit
Program that results in assertion-failure due to wrong arguments to promise.

The promise-type constructor should be called with the parameter copies from
the coroutine-frame. I couldn't quite understand that this is supposed to be
the case from the current draft of the standard, but I got some help from Lewis
Baker who also referred me to this rewording, where in the previous version it
is clear: 

https://github.com/cplusplus/draft/commit/0b4ab68a54e197eba9d894a8f91270bb0dcdb546

The attached code triggers an assertion that show that this is not the case on
gcc. I initially had the problem on gcc-10.2.0, but reproduced it on gcc-trunk
on godbolt. Compile either version with -fcoroutines, or see
https://gcc.godbolt.org/z/j16Wqx.

I speculated that the logic here,
https://github.com/gcc-mirror/gcc/blob/master/gcc/cp/coroutines.cc#L4491-L4494,
was inverted. It seemed to pass the copied version of a by-reference parameter,
but the original version of a by-value parameter. The opposite would not
trigger the assertion. But I am not that familiar.

[Bug c++/100673] New: [coroutines] Non-template, UDT await_suspend return-type results in ICE.

2021-05-19 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100673

Bug ID: 100673
   Summary: [coroutines] Non-template, UDT await_suspend
return-type results in ICE.
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jehelset at gmail dot com
  Target Milestone: ---

Created attachment 50844
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50844&action=edit
ICE on non-template UDT  await_suspend return-type.

A non-template udt return-type from await_suspend will ICE on trunk:

https://godbolt.org/z/Gn7djfrac

#0  build_co_await (loc=674010823, a=0x7163f1c0, suspend_kind=) at ../../gcc/cp/coroutines.cc:993
993   tree tt = CLASSTYPE_TI_TEMPLATE (susp_return_type);

Relevant code:
  else if (TREE_CODE (susp_return_type) == RECORD_TYPE
   && CLASS_TYPE_P (susp_return_type))
{
  tree tt = CLASSTYPE_TI_TEMPLATE (susp_return_type);
  if (tt == coro_handle_templ)
ok = true;
}

Seems to be checking the validity of the await_suspend call, to produce a
helpful diagnostic. Perhaps the conditional also needs to verify that
CLASSTYPE_TEMPLATE_INFO (coro_handle_templ) is non-NULL, before using
CLASSTYPE_TI_TEMPLATE.

Seemed to be the case on 10.3, 11.1 and on 12.0. 10.2 failed to compile it
without crashing.

[Bug c++/100673] [coroutines] Non-template, UDT await_suspend return-type results in ICE.

2021-05-21 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100673

--- Comment #1 from John Eivind Helset  ---
Created attachment 50854
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50854&action=edit
Add CLASSTYPE_TEMPLATE_INFO guard and test-case.

Tried to guard the the conditional with CLASSTYPE_TEMPLATE_INFO as it seemed
like the common approach in the codebase, to verify that the return-type was a
template. And a testcase.

Remove the guard to observe ICE in the test-case.

[Bug c++/100611] coroutines: destructor called too many times for coroutine lambda stored object

2021-05-23 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100611

John Eivind Helset  changed:

   What|Removed |Added

 CC||jehelset at gmail dot com

--- Comment #2 from John Eivind Helset  ---
Maybe related: https://godbolt.org/z/vsc8MYTcn

In my case it seemed like co_awaiting expressions that involved
compiler-generator constructors binding references to pr-values was
problematic, or something along these lines. 

Was a problem on 11.1. Couldn't reproduce on 10.2.

[Bug c++/105104] New: [coroutines] ICE during GIMPLE pass: coro-early-expand-ifns

2022-03-29 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105104

Bug ID: 105104
   Summary: [coroutines] ICE during GIMPLE pass:
coro-early-expand-ifns
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jehelset at gmail dot com
  Target Milestone: ---

Created attachment 52716
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52716&action=edit
Output from "-fdump-tree-coro-early-expand-ifns=stdout"

Compiler segfaults on `if (EDGE_COUNT (pred->succs) <= EDGE_COUNT
(succ->preds))`, as `succ` is null. 

Backtrace:
#0  0x0107a2ae in find_edge (pred=0x7fffc626f068, succ=0x0) at
../../gcc/cfganal.cc:523
#1  0x01864cc7 in convert_single_case_switch (swtch=0x7fffc625d2d0,
gsi=...) at ../../gcc/tree-cfgcleanup.cc:118
#2  0x01864d9e in cleanup_control_expr_graph (bb=0x7fffc626f068,
gsi=...) at ../../gcc/tree-cfgcleanup.cc:145
#3  0x018652be in cleanup_control_flow_bb (bb=0x7fffc626f068) at
../../gcc/tree-cfgcleanup.cc:274
#4  0x0186712f in cleanup_control_flow_pre () at
../../gcc/tree-cfgcleanup.cc:908
#5  0x018678f2 in cleanup_tree_cfg_noloop (ssa_update_flags=0) at
../../gcc/tree-cfgcleanup.cc:1073
#6  0x01867bbb in cleanup_tree_cfg (ssa_update_flags=0) at
../../gcc/tree-cfgcleanup.cc:1183
#7  0x016893c6 in execute_function_todo (fn=0x7fffcf0580b8, data=0x60)
at ../../gcc/passes.cc:2051
#8  0x016881d9 in do_per_function (callback=0x1689361
, data=0x60) at
../../gcc/passes.cc:1688
#9  0x0168972e in execute_todo (flags=96) at ../../gcc/passes.cc:2139
#10 0x0168a838 in execute_one_pass (pass=0x408fb20) at
../../gcc/passes.cc:2675
#11 0x0168aa9b in execute_pass_list_1 (pass=0x408fb20) at
../../gcc/passes.cc:2738
#12 0x0168ab25 in execute_pass_list (fn=0x7fffcf0580b8, pass=0x408f6a0)
at ../../gcc/passes.cc:2749
#13 0x010f6cbf in cgraph_node::analyze (this=0x7fffcf07d880) at
../../gcc/cgraphunit.cc:685
#14 0x010f8daa in analyze_functions (first_time=true) at
../../gcc/cgraphunit.cc:1240
#15 0x010fc094 in symbol_table::finalize_compilation_unit
(this=0x770c6000) at ../../gcc/cgraphunit.cc:2500
#16 0x017eb979 in compile_file () at ../../gcc/toplev.cc:479
#17 0x017eea61 in do_compile (no_backend=false) at
../../gcc/toplev.cc:2168
#18 0x017eee49 in toplev::main (this=0x7fffdf62, argc=33,
argv=0x7fffe098) at ../../gcc/toplev.cc:2320
#19 0x02fd18b1 in main (argc=33, argv=0x7fffe098) at
../../gcc/main.cc:39

Dump from tree-coro-early-expand-ifns put in attachment, because of
template-spew.

Compiled with e3d2b0d040e9baf6c0548b865ed5244dec464cc1.

[Bug c++/105104] [coroutines] ICE during GIMPLE pass: coro-early-expand-ifns

2022-03-29 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105104

--- Comment #1 from John Eivind Helset  ---
Indices of `bb` and `case_bb` in `convert_single_case_switch` are: 
(gdb) p bb->index
$18 = 154
(gdb) p case_bb->index
$19 = 157

If that helps.

[Bug c++/105104] [coroutines] ICE during GIMPLE pass: coro-early-expand-ifns

2022-03-29 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105104

--- Comment #2 from John Eivind Helset  ---
I'll try to create an MRE eventually...

[Bug c++/105104] [coroutines] ICE during GIMPLE pass: coro-early-expand-ifns

2022-03-31 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105104

--- Comment #4 from John Eivind Helset  ---
It seems a non-void return-type from await-resume of a final awaitable,
combined with at least -O1 causes a segfault: https://godbolt.org/z/rzq8dM7Pr

Not sure if it's the same as the one I initially encountered yet.

[Bug c++/105104] [coroutines] ICE during GIMPLE pass: coro-early-expand-ifns

2022-03-31 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105104

--- Comment #5 from John Eivind Helset  ---
Created attachment 52729
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52729&action=edit
Patch with testcase.

Tried adding a testcase to the g++.dg/coroutines testsuite. Used dg-ice, but it
seems to complain about excess errors anyways:

FAIL: g++.dg/coroutines/pr105104.C (test for excess errors)
Excess errors:
during GIMPLE pass: coro-early-expand-ifns

[Bug c++/104548] parser rejects alias template id of lambda in unevaluated-context and accepts when no alias is used

2022-08-17 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104548

John Eivind Helset  changed:

   What|Removed |Added

 CC||jehelset at gmail dot com

--- Comment #2 from John Eivind Helset  ---
here is another variant of this i think: https://godbolt.org/z/nfsWPn6x8

[Bug c++/102493] non-type template specialization for member pointer to field and function reports leads to unexpected conflict

2023-07-25 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102493

--- Comment #1 from John Eivind Helset  ---
ran into this today as well with:
```cpp
struct X{
  void f(char){}
};

template
struct Y{};
template
struct Y{};
template
struct Y{};

Y<&X::f> y;
```
using gcc 13.1.1, clang trunk accepted same code.

[Bug c++/116327] New: ICE in coroutine with parameter preview on lambda with captures.

2024-08-10 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116327

Bug ID: 116327
   Summary: ICE in coroutine with parameter preview on lambda with
captures.
   Product: gcc
   Version: 14.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jehelset at gmail dot com
  Target Milestone: ---

ICE from `expand_expr_real_1` in `expr.cc:11376` 

Seems to happen after 066c7893eae, in particular:

@@ -4618,13 +4618,8 @@ morph_fn_to_coro (tree orig, tree *resumer, tree
*destroyer)
  if (parm_i->this_ptr || parm_i->lambda_cobj)
{
  /* We pass a reference to *this to the allocator lookup.  */
- tree tt = TREE_TYPE (TREE_TYPE (arg));
- tree this_ref = build1 (INDIRECT_REF, tt, arg);
- tt = cp_build_reference_type (tt, false);
- this_ref = convert_to_reference (tt, this_ref, CONV_STATIC,
-  LOOKUP_NORMAL , NULL_TREE,
-  tf_warning_or_error);
- vec_safe_push (args, convert_from_reference (this_ref));
+ tree this_ref = cp_build_fold_indirect_ref (arg);
+ vec_safe_push (args, this_ref);
}
  else
vec_safe_push (args, convert_from_reference (arg));

[Bug c++/116327] ICE in coroutine with parameter preview on lambda with captures.

2024-08-10 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116327

--- Comment #1 from John Eivind Helset  ---
Created attachment 58899
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58899&action=edit
Reproducer, compile with --std=c++20

[Bug c++/116327] ICE in coroutine with parameter preview on lambda with captures.

2024-08-10 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116327

--- Comment #2 from John Eivind Helset  ---
had to revert both changes in 066c7893eae to compile my hobby project without
ICE.

[Bug c++/102217] co_awaiting a temporary produced by ternary operator crashes (double-free)

2024-08-10 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102217

John Eivind Helset  changed:

   What|Removed |Added

 CC||jehelset at gmail dot com

--- Comment #9 from John Eivind Helset  ---
Hit this as well on master (9d5c500c4fa) in something like `co_return co_await
f(a, b ? c : d);`, if I lift the conditional out of await it seems ok.

0x2af0211 internal_error(char const*, ...)
../../gcc/diagnostic-global-context.cc:491
0xb4e45d fancy_abort(char const*, int, char const*)
../../gcc/diagnostic.cc:1772
0x79bd3b flatten_await_stmt
../../gcc/cp/coroutines.cc:3097
0xbdcc14 flatten_await_stmt
../../gcc/cp/coroutines.cc:3126
0xbdcc14 flatten_await_stmt
../../gcc/cp/coroutines.cc:3126
0xbdcc14 flatten_await_stmt
../../gcc/cp/coroutines.cc:3126
0xbde478 maybe_promote_temps
../../gcc/cp/coroutines.cc:3309
0xbde478 await_statement_walker
../../gcc/cp/coroutines.cc:3948
0x19c6754 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*))
../../gcc/tree.cc:11479
0xbde138 await_statement_walker
../../gcc/cp/coroutines.cc:3619
0x19c6754 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*))
../../gcc/tree.cc:11479
0xbde984 await_statement_walker
../../gcc/cp/coroutines.cc:3896
0x19c6754 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*))
../../gcc/tree.cc:11479
0xbde138 await_statement_walker
../../gcc/cp/coroutines.cc:3619
0x19c6754 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*))
../../gcc/tree.cc:11479
0xbde642 await_statement_walker
../../gcc/cp/coroutines.cc:3608
0x19c6754 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*))
../../gcc/tree.cc:11479
0x19c68ac walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*))
../../gcc/tree.cc:11713
0xbde642 await_statement_walker
../../gcc/cp/coroutines.cc:3608
0x19c6754 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*))
../../gcc/tree.cc:11479

[Bug c++/116327] [14/15 Regression] ICE in coroutine with parameter preview on lambda with captures since r15-2210

2024-08-12 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116327

--- Comment #4 from John Eivind Helset  ---
if compiling my project with 14.2.1 in release mode (cmake / -O3) i got another
ICE from `internal compiler error: in set_parm_rtl, at cfgexpand.cc:1436`.

0x21a7bea internal_error(char const*, ...)
???:0
0x703e99 fancy_abort(char const*, int, char const*)
???:0
0xbd4dfd expand_function_start(tree_node*)
???:0

i didn't try to debug gcc 14.2.1 when compiling in release, but i checked that
i could compile in release without 066c7893eae on master (2b23a444bcf).

[Bug c++/116327] [14/15 Regression] ICE in coroutine with parameter preview on lambda with captures since r15-2210

2024-08-13 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116327

--- Comment #6 from John Eivind Helset  ---
Works, thanks.

[Bug c++/112842] New: Constrained parameter pack with trailing param gives no matching function.

2023-12-04 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112842

Bug ID: 112842
   Summary: Constrained parameter pack with trailing param gives
no matching function.
   Product: gcc
   Version: 13.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jehelset at gmail dot com
  Target Milestone: ---

Created attachment 56785
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56785&action=edit
Minimal reproducer, compile with --std=c++20

Program below doesn't compile:

template
concept U = true;

template
struct V{
  static constexpr void f(U auto ...,int){

  }
};

int main(){
  V::f(0,1); //no matching function for call to ‘V::f(int, int)’
  //template argument deduction/substitution failed:
  //candidate expects 1 argument, 2 provided
}

If there's no trailing parameter it works ok. clang-trunk seemed to handle it
fine. gcc-trunk also failed this.

[Bug c++/112842] Constrained parameter pack with trailing param gives no matching function.

2023-12-04 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112842

--- Comment #1 from John Eivind Helset  ---
hopefully not a duplicate, couldn't find any matching ones,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69623 was the closest i could
find.

[Bug c++/100673] [coroutines] Non-template, UDT await_suspend return-type results in ICE.

2023-05-29 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100673

John Eivind Helset  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from John Eivind Helset  ---
Looks good now!

[Bug c++/110025] New: ICE with default-argument for template-param with decltype and auto.

2023-05-29 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110025

Bug ID: 110025
   Summary: ICE with default-argument for template-param with
decltype and auto.
   Product: gcc
   Version: 13.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jehelset at gmail dot com
  Target Milestone: ---

Compiler ICE when using
decltype(auto(variable-template)) as default-argument
of a template-param:

https://godbolt.org/z/M9qrvTj8P

[Bug c++/110025] ICE with default-argument for template-param with decltype and auto.

2023-05-29 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110025

--- Comment #1 from John Eivind Helset  ---
Some other weirdness related to use of `auto(expr)` in template-arguments:

https://godbolt.org/z/jf64xExTW

Might be a separate bug.

[Bug c++/110025] [C++23] ICE with default-argument for template-param with decltype and auto.

2023-05-30 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110025

--- Comment #7 from John Eivind Helset  ---
(In reply to Andrew Pinski from comment #2)
> Created attachment 55200 [details]
> testcase 1
> 
> Please next time attach the testcases rather than just links to godbolt.

Will do! Thanks.

[Bug c++/97452] [coroutines] incorrect sequencing of await_resume() when multiple co_await expressions occur in a single statement

2024-09-20 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97452

--- Comment #13 from John Eivind Helset  ---
Created attachment 59162
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59162&action=edit
pr97452.cc

Reduced reproducer.

[Bug c++/97452] [coroutines] incorrect sequencing of await_resume() when multiple co_await expressions occur in a single statement

2024-09-20 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97452

--- Comment #14 from John Eivind Helset  ---
Added what I think is an even more minimal reproducer in attachment 
pr97452.cc.

In the gimple I see:

:
resume.6:
_16 = Z::await_resume (&z);
_17 = Z::await_resume (&z);
_18 = _16 + _17;
frame_ptr->b_1_2 = _18;

Which seems to violate:

http://eel.is/c++draft/expr.await#5

So I think here:

https://github.com/gcc-mirror/gcc/blob/master/gcc/cp/coroutines.cc#L2023

One might need to make sure that also await-resume results are promoted if
evaluating the the expression might involve two `co_awaits`, instead of
substituting the call to `await_resume` directly into the expression.

[Bug c++/119119] New: ICE in create_tmp_var

2025-03-04 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119119

Bug ID: 119119
   Summary: ICE in create_tmp_var
   Product: gcc
   Version: 14.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jehelset at gmail dot com
  Target Milestone: ---

Reproduced on both gcc-14.2.1 and trunk (8d7762945bb).

Was compiling https://github.com/maikel/senders-io (main) with
https://github.com/NVIDIA/stdexec (nvhpc-25.03.rc1).
Works with -O0 fails with -O{1,2,3}.

Stacktrace:

during GIMPLE pass: einline
In file included from
/home/jeh/code/github/maikel/senders-io/source/sio/sequence/ignore_all.hpp:18,
 from
/home/jeh/code/github/maikel/senders-io/tests/sequence/test_scan.cpp:17:
/usr/include/exec/sequence/ignore_all_values.hpp: In constructor
‘exec::__ignore_all_values::__operation<_Sender,
_ReceiverId>::__t::__t(_Sender&&,
exec::__ignore_all_values::__operation<_Sender, _ReceiverId>::_Receiver) [with
_Sender = exec::__seqexpr&;
_ReceiverId = stdexec::__sync_wait::__receiver<>]’:
/usr/include/exec/sequence/ignore_all_values.hpp:246:34: internal compiler
error: in create_tmp_var, at gimple-expr.cc:484
  246 |   , __op_{exec::subscribe(static_cast<_Sender&&>(__sndr),
__receiver_t{this})} {

#0  internal_error (gmsgid=0x4864337 "in %s, at %s:%d") at
../../gcc/diagnostic-global-context.cc:512
#1  0x03bf1031 in fancy_abort (file=0x3f7bf8a
"../../gcc/gimple-expr.cc", line=484, function=0x3f7c016 "create_tmp_var") at
../../gcc/diagnostic.cc:1722
#2  0x017b10c7 in create_tmp_var (type=0x7fffeee82000, prefix=0x0) at
../../gcc/gimple-expr.cc:484
#3  0x01816ac3 in create_tmp_from_val (val=0x7fffe240e138) at
../../gcc/gimplify.cc:622
#4  0x01816c5f in lookup_tmp_var (val=0x7fffe240e138, is_formal=true,
not_gimple_reg=false) at ../../gcc/gimplify.cc:660
#5  0x01816eb6 in internal_get_tmp_var (val=0x7fffe240e138,
pre_p=0x7fffd0e0, post_p=0x0, is_formal=true, allow_ssa=true,
not_gimple_reg=false) at ../../gcc/gimplify.cc:699
#6  0x018170f1 in get_formal_tmp_var (val=0x7fffe240e138,
pre_p=0x7fffd0e0) at ../../gcc/gimplify.cc:732
#7  0x0186d2a5 in gimplify_expr (expr_p=0x7fffd0e8,
pre_p=0x7fffd0e0, post_p=0x7fffced0, gimple_test_f=0x18169ac
, fallback=1)
at ../../gcc/gimplify.cc:20387
#8  0x01876fc0 in gimple_regimplify_operands (stmt=0x7fffe240b8f0,
gsi_p=0x7fffd330) at ../../gcc/gimplify-me.cc:235
#9  0x01d9ef24 in copy_bb (id=0x7fffda50, bb=0x7219c420,
num=..., den=...) at ../../gcc/tree-inline.cc:2122
#10 0x01da25c5 in copy_cfg_body (id=0x7fffda50,
entry_block_map=0x7217fae0, exit_block_map=0x72186180, new_entry=0x0)
at ../../gcc/tree-inline.cc:3114
#11 0x01da3294 in copy_body (id=0x7fffda50,
entry_block_map=0x7217fae0, exit_block_map=0x72186180, new_entry=0x0)
at ../../gcc/tree-inline.cc:3367
#12 0x01da8b3e in expand_call_inline (bb=0x7217fae0,
stmt=0x721666e0, id=0x7fffda50, to_purge=0x7fffda10) at
../../gcc/tree-inline.cc:5208
#13 0x01da9a7c in gimple_expand_calls_inline (bb=0x7217fae0,
id=0x7fffda50, to_purge=0x7fffda10) at ../../gcc/tree-inline.cc:5419
#14 0x01daa539 in optimize_inline_calls (fn=0x7fffe609ac00) at
../../gcc/tree-inline.cc:5609
#15 0x039c9e1d in early_inliner (fun=0x7fffe677c9c0) at
../../gcc/ipa-inline.cc:3161
#16 0x039c9fee in (anonymous namespace)::pass_early_inline::execute
(this=0x503b830, fun=0x7fffe677c9c0) at ../../gcc/ipa-inline.cc:3233
#17 0x01b50bdf in execute_one_pass (pass=0x503b830) at
../../gcc/passes.cc:2659
#18 0x01b50fbe in execute_pass_list_1 (pass=0x503b830) at
../../gcc/passes.cc:2768
#19 0x01b51048 in execute_pass_list (fn=0x7fffe677c9c0, pass=0x503b710)
at ../../gcc/passes.cc:2779
#20 0x01b4ea0f in do_per_function_toporder (callback=0x1b5100b
, data=0x503b710) at
../../gcc/passes.cc:1786
#21 0x01b51c92 in execute_ipa_pass_list (pass=0x503b6b0) at
../../gcc/passes.cc:3117
#22 0x0158b1b4 in ipa_passes () at ../../gcc/cgraphunit.cc:2228
#23 0x0158b53c in symbol_table::compile (this=0x77206000) at
../../gcc/cgraphunit.cc:2351
#24 0x0158bb30 in symbol_table::finalize_compilation_unit
(this=0x77206000) at ../../gcc/cgraphunit.cc:2603
#25 0x01cdd98e in compile_file () at ../../gcc/toplev.cc:479
#26 0x01ce0fad in do_compile () at ../../gcc/toplev.cc:2208
#27 0x01ce1444 in toplev::main (this=0x7fffdf12, argc=44,
argv=0x7fffe058) at ../../gcc/toplev.cc:2371
#28 0x03bb4dd5 in main (argc=44, argv=0x7fffe058) at
../../gcc/main.cc:39

`val` seems to be a mutex:

#3  0x01816ac3 in create_tmp_from_val (val=0x7fffe240e138) at
../../gcc/gimp

[Bug c++/119119] ICE in create_tmp_var

2025-03-04 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119119

--- Comment #1 from John Eivind Helset  ---
Created attachment 60655
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60655&action=edit
Preprocessed source

File was too big so had to compress. Decompress with `tar -xf source.tar.gz`,
compile with:

g++ -std=gnu++2b -O1 -o object.o -c source.cpp

[Bug ipa/119119] [12/13/14 Regression] ICE in create_tmp_var

2025-03-06 Thread jehelset at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119119

--- Comment #11 from John Eivind Helset  ---
Tested on e836d80374a, works now! Thanks!