[patch 1/2] PR27313 Discover non-trapping memory accesses

Ayal Zaks ZAKS@il.ibm.com
Sat Apr 14 22:22:00 GMT 2007


> in order to fix PR27313 we first need a way to discover if memory
accesses
> don't trap.  This patch implements the trivial solution by walking the
> blocks in dominator order and remembering INDIRECT_REFS.  If it sees
> another INDIRECT_REF through the same SSA name, we know that the second
> access can't trap (as it would have trapped already on the dominating
> access), so we can set TREE_THIS_NOTRAP.

You may want to compare with sched-rgn.c's old is_exception_free() logic,
fwiw.

Ayal.

>
> This discovers quite some accesses as non-trapping, so probably is
usefull
> in it's own right, hence the separate patch.
>
> As for placing this pass: the earlier the better, but it must come after
> copy-prop, as we rely on seeing the syntactically same SSA_NAME for
> discovery.
>
> I've tested this on x86_64-linux together with the next patch (all langs
> except Ada), and flag_tree_nontrap forced to true (otherwise it's a
noop).
>
>
> Ciao,
> Michael.



More information about the Gcc-patches mailing list