This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFC: Clean up TREE_THIS_NOTRAP, copy it to MEM_REF
On Thu, Oct 14, 2010 at 12:54 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> The TREE_THIS_NOTRAP flag can get lost during inlining. ?We have the
>> attached hunks in our 4.5-based tree (to be adjusted to MEM_REF). ?The
>> sched-deps.c hunk is for the IA-64 because it abuses may_trap_p to detect
>> non-speculative instructions; when the TREE_THIS_NOTRAP is set, may_trap_p
>> returns false, although the instruction is still as speculative as without
>> it.
>
> Here is a formal submission (with the associated front-end changes).
>
> Bootstrapped/regtested on x86_64-suse-linux, OK for mainline?
Ok (for the middle-end parts).
Thanks,
Richard.
>
> 2010-10-13 ?Eric Botcazou ?<ebotcazou@adacore.com>
>
> ? ? ? ?* sched-deps.c (sched_insn_is_legitimate_for_speculation): Invoke
> ? ? ? ?may_trap_or_fault_p instead of may_trap_p predicate.
> ? ? ? ?* tree.c (substitute_in_expr): Propagate the TREE_THIS_NOTRAP flag.
> ? ? ? ?(substitute_placeholder_in_expr): Likewise.
> ? ? ? ?* tree-inline.c (remap_gimple_op_r): Propagate the TREE_THIS_NOTRAP
> ? ? ? ?flag on MEM_REF nodes.
> ? ? ? ?(copy_tree_body_r): Propagate the TREE_READONLY and TREE_THIS_NOTRAP
> ? ? ? ?flags on INDIRECT_REF nodes.
> ada/
> ? ? ? ?* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Set
> ? ? ? ?TREE_THIS_NOTRAP on the INDIRECT_REF node built for the template.
> ? ? ? ?* gcc-interface/trans.c (Identifier_to_gnu): Set TREE_THIS_NOTRAP on
> ? ? ? ?the INDIRECT_REF node built for objects used by reference.
> ? ? ? ?* gcc-interface/utils2.c (build_binary_op): Add short-circuit for
> ? ? ? ?constant result. Set TREE_THIS_NOTRAP on ARRAY_REF and ARRAY_RANGE_REF.
> ? ? ? ?(gnat_stabilize_reference_1): Propagate the TREE_THIS_NOTRAP flag.
>
> --
> Eric Botcazou
>