https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30409
Thomas Koenig <tkoenig at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |21046 --- Comment #9 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- (In reply to anlauf from comment #8) > I wonder how much (or little) really needs to be done here, or if the task > can be split in a suitable way between FE and ME. > > The tree-dump shows a __builtin_malloc/__builtin_free for the temporary > *within* the i-loop. Would it be possible to move this *management* just > one loop level up, if the size of the temporary is known to be constant? > (Which is the case here). I mean attach it to the outer scope? > Maybe the middle end then better "sees" what can reasonably be done? A lot of it can probably be done in the middle end. For memory allocation, this would be PR21046 (first variant), which would be highly useful already. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=21046 [Bug 21046] move memory allocation out of a loop