This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/82365] stack locations are consolidated if noreturn function is on the path
- From: "matz at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 06 Oct 2017 12:53:45 +0000
- Subject: [Bug middle-end/82365] stack locations are consolidated if noreturn function is on the path
- Auto-submitted: auto-generated
- References: <bug-82365-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82365
--- Comment #7 from Michael Matz <matz at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #4)
> Richard/Micha, thoughts on that?
None better than what you came up with. It'd solve this specific instance
of the problem (and not the one with swapped call statements). I don't think
we should complicate and slow down the clobber algorithm for this partial
solution, though.
One problem with "not address taken up to here" is this situation:
char a[100];
char *p = &somethingelse;
for () {
*p = ...;
p = a;
}
So, you'd need to iterate address-takeness until fixpoint like normal liveness
as well. As the current algorithm does this already for a crude approximation
of liveness you might be able to implement the idea without seriously
complicating it or slowing it down. If so it'd make sense. Otherwise I
wouldn't worry.
IMHO the real problem is rather the phase ordering between joining the
four no-return calls into one (and thereby merging scopes) and scope-based
analyses. Possibly that joining should happen later (but it'd mean at RTL
level only, which is also meh), or the stack sharing should happen earlier
(which would possibly mean introducing type aliasing problems at GIMPLE level,
which is also meh).