https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118574

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2025-02-10
     Ever confirmed|0                           |1

--- Comment #13 from Jason Merrill <jason at gcc dot gnu.org> ---
>From the gimple, it's clear that the problem is that with -frange-for-ext-temps
the reference temp for __for_range isn't getting a slot in the coro frame:

-                    frame_ptr->_D2_3_0 = getStringList (); [return slot
optimization]
-                    _13 = &frame_ptr->_D2_3_0;
-                    frame_ptr->__for_range_2_3 = _13;

+  struct vector D.139648;
+                        D.139648 = getStringList (); [return slot
optimization]
+                            frame_ptr->__for_range_2_3 = &D.139648;
+                            _13 = frame_ptr->__for_range_2_3;

This temporary should not be affected by the flag, it's already extended
because it's bound to the reference variable.

Reply via email to