This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Do not produce empty try-finally statements


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]