On Fri, Sep 27, 2013 at 1:17 PM, Eric Botcazou <ebotca...@adacore.com> wrote: > Hi, > > this fixes the ICE during the build of the Ada runtime on the SPARC, a fallout > of the recent inliner changes: > http://gcc.gnu.org/ml/gcc-patches/2013-09/msg01033.html > > The ICE is triggered because the ldd peephole merges an MEM with MEM_NOTRAP_P > and a contiguous MEM without MEM_NOTRAP_P, keeping the MEM_NOTRAP_P flag on > the result. As a consequence, an EH edge is eliminated and a BB is orphaned. > > I think this shows that my above inliner patch was too gross: when you have > successive inlining, you can quickly end up with a mess of trapping and non- > trapping memory accesses for the same object. So the attached seriously > refines it, restricting it to parameters with reference type and leaning > towards being less conservative. Again, this should only affect Ada. > > Tested on x86_64-suse-linux, OK for the mainline?
This is getting somewhat gross ... what about clearing all TREE_NO_TRAPs on inlining? Otherwise I think the "proper" way is to teach passes that moving loads/stores eventually has to clear TREE_NO_TRAP ... (a reason that for example VRP cannot set TREE_NO_TRAP on dereferences of pointers that have a non-NULL range...). Richard. > 2013-09-27 Eric Botcazou <ebotca...@adacore.com> > > PR bootstrap/58509 > * ipa-prop.h (get_ancestor_addr_info): Declare. > * ipa-prop.c (get_ancestor_addr_info): Make public. > * tree-inline.c (is_parm): Rename into... > (is_ref_parm): ...this. > (is_based_on_ref_parm): New predicate. > (remap_gimple_op_r): Do not propagate TREE_THIS_NOTRAP on MEM_REF if > a parameter with reference type has been remapped and the result is > not based on another parameter with reference type. > (copy_tree_body_r): Likewise on INDIRECT_REF and MEM_REF. > > > 2013-09-27 Eric Botcazou <ebotca...@adacore.com> > > * gnat.dg/specs/opt1.ads: New test. > > > -- > Eric Botcazou