[PATCH] Fix tree_could_trap_p so that weak var accesses are considered trapping (PR tree-optimization/49618)

Richard Guenther richard.guenther@gmail.com
Tue Jul 5 08:44:00 GMT 2011


On Mon, Jul 4, 2011 at 8:09 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> Before http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=168951
> set_mem_attributes_minus_bitpos would set MEM_NOTRAP_P for decls
> based on whether they are DECL_WEAK or not, but now it is set only
> from !tree_could_trap_p.
>
> These patches adjust tree_could_trap_p to say that references
> to weak vars/functions may trap (for calls it was doing that already).
>
> The first version of the patch is intended for 4.7 and only handles
> that way weak vars/functions that aren't known to be defined somewhere
> (either in current CU, or in the CUs included in -flto build).
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> The second version is simplified one which always treats DECL_WEAK
> vars as maybe trapping.  Ok for 4.6?

The trunk version is ok.  For the 4.6 version, don't you need a CALL_EXPR
case similar to the trunk version?

Thanks,
Richard.

>        Jakub
>



More information about the Gcc-patches mailing list