https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118574
--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Looking at gimple with co_await B{200000}; line commented out, the difference
-fno-range-for-ext-temps vs -frange-for-ext-temps is
@@ -77,7 +77,6 @@ void A::~A (struct A * const this)
void bar ()
{
+ struct A D.2934;
struct A ret;
try
@@ -89,15 +88,14 @@ void bar ()
{
const char * const & item;
struct A & __for_range;
- struct A D.2634;
const char * * __for_begin;
const char * * __for_end;
try
{
D.2934 = foo (); [return slot optimization]
- __for_range = &D.2634;
try
{
+ __for_range = &D.2934;
__for_begin = A::begin (__for_range);
__for_end = A::end (__for_range);
(changed D.2657 to D.2634 in one case because it is the same thing). So the
temporary is declared in a different scope and __for_range initialized once
inside of the try/finally and once outside of it. Everything else is the same.