On Mon, Feb 10, 2014 at 02:22:44PM +0100, Richard Biener wrote: > > This fixes PR60115 where the issue is that tree_could_trap_p does > not evaluate MEM_REFs for possibly out-of-bound accesses (in case > the access is lowered from an ARRAY_REF where the code does that). > > I've unified TARGET_MEM_REF and MEM_REF handling and made the > order of checking for trapping base and !TREE_THIS_NOTRAP match > the (non-obvious?) way ARRAY_REF handling works. > > Testing for an overlap of at least on byte (thus not considering > the size of the access) should be ok IMHO as alignment constraints > or outer component refs should impose enough constraints that > the source should be invalid if that's not enough. > > Bootstrapped and tested on x86_64-unknown-linux-gnu. > > Does this look sane?
LGTM. > 2014-02-10 Richard Biener <rguent...@suse.de> > > PR tree-optimization/60115 > * tree-eh.c (tree_could_trap_p): Unify TARGET_MEM_REF and > MEM_REF handling. Properly verify that the accesses are not > out of the objects bound. > > * gcc.dg/torture/pr60115.c: New testcase. Jakub