This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Dead-code elimination can't remove string copy insns?
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Dale Johannesen <dalej at apple dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 12 May 2003 18:30:20 -0700
- Subject: Re: Dead-code elimination can't remove string copy insns?
- References: <731C93BE-84DC-11D7-BAEF-000393D76DAA@apple.com>
Dale Johannesen <dalej@apple.com> writes:
> On Monday, May 12, 2003, at 05:26 PM, Zack Weinberg wrote:
>> Why can't anything delete these insns? I'm guessing it has something
>> to do with the BLKmode memory access, but the alias information should
>> be sufficient to see that the memory region being written into is on
>> the stack, and unused past this insn, hence the store is dead and can
>> be deleted.
>
> Can it tell the region's address hasn't been taken and stored somewhere?
I don't know what it can or can't tell. In the initial RTL, the
region's address was taken and passed to a subroutine call, but CSE
deletes all of that, because it's unreachable. By the time we get to
life analysis, the insn I quoted is the last one in the function, so
even if someone had stored the address somewhere, using it would
provoke undefined behavior.
zw