This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Do not produce empty try-finally statements
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>,Jakub Jelinek <jakub at redhat dot com>,Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org,jason at redhat dot com
- Date: Mon, 20 Jan 2014 09:16:52 +0100
- Subject: Re: Do not produce empty try-finally statements
- Authentication-results: sourceware.org; auth=none
- References: <20140119224609 dot GB22057 at kam dot mff dot cuni dot cz> <20140120070735 dot GT892 at tucnak dot redhat dot com>
Jakub Jelinek <jakub@redhat.com> wrote:
>On Sun, Jan 19, 2014 at 11:46:09PM +0100, Jan Hubicka wrote:
>> Bootstrapped/regtested x86_64-linux, OK?
>
>This looks very wrong. By ignoring the clobbers in the cleanups you
>ensure clobbers are hardly ever emitted, but the TRY/FINALLY is the way
>how
>to make sure the clobbers appear in all the places where they are
>supposed
>to be, so that DSE, expansion etc. can take advantage of them.
>Just look at say:
>struct A { char buf[64]; };
>void foo (char *);
>void test ()
>{
> { A a; foo (a.buf); a.buf[6] = 1; a.buf[7] = 8; }
> { A a; foo (a.buf); a.buf[6] = 1; a.buf[7] = 8; }
> { A a; foo (a.buf); a.buf[6] = 1; a.buf[7] = 8; }
> { A a; foo (a.buf); a.buf[6] = 1; a.buf[7] = 8; }
> { A a; foo (a.buf); a.buf[6] = 1; a.buf[7] = 8; }
> { A a; foo (a.buf); a.buf[6] = 1; a.buf[7] = 8; }
> { A a; foo (a.buf); a.buf[6] = 1; a.buf[7] = 8; }
>}
>where with your patch we don't DSE the a.buf[6] and a.buf[7] stores
>anymore.
>
>If optimize_clobbers isn't performed at -O0, perhaps we should consider
>performing at at -O0 (just that and not the other EH optimizations)?
Or, as clobbers are removed during rtl expansion make sure we remove empty eh stuff there?
Richard.
> Jakub