https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78468
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|libgomp |middle-end Severity|normal |major --- Comment #21 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- > It does not break anything that wasn't broken before. The Sparc backend was > just _lucky_ that the allocation code in the middlend was _broken_. Yes, it does, it breaks tests that have been working for a decade! > The patch fixes the bug that causes dynamic stack allocation to overestimate > the needed space on the stack most of the time. To do this, it uses > information available from elsewhere in the middleend. > > It turns out that the backend (or middlend, depends on the point of view) > lies about the alignment of VIRTUAL_STACK_DYNAMIC_REGNUM. There may be > _other_ users users of that value that fail to do their job because they > think the stored alignment is correct. Such users may do worse things than > wasting some stack space - we may just have not noticed them yet. > > So, there is _another_ bug in the backends (or the middleend) that needs to > be fixed. It's not "one fix instead of another" - there are two bugs that > need two separate fixes. Then let's fix them, please. > It is also better to make the broken backends respect the STACK_BOUNDARY > alignment of VIRTUAL_STACK_DYNAMIC_REGNUM than make them tell the middleend > the real alignment: But these back-ends were not broken before your patch! It's your patch that broke the interface between the middle-end and the back-end without notice. > Making the middleend force STACK_BOUNDARY alignment of > VIRTUAL_STACK_DYNAMIC_REGNUM is also possible, but without any information > from the backend we'd have to generate run time code to do that alignment. > So, why not just use STACK_DYNAMIC_OFFSET et. al. to just guarantee that the > alignment is right? Because we have 50 architectures in the tree; are you going to audit them all and make the necessary adjustments? Just to save a couple of bytes?