mirror of git://gcc.gnu.org/git/gcc.git
re PR tree-optimization/49618 (When building uClibc with GCC 4.6.1 old_atexit is miscompiled)
PR tree-optimization/49618 * tree-eh.c (tree_could_trap_p) <case CALL_EXPR>: For DECL_WEAK t recurse on the decl. <case FUNCTION_DECL, case VAR_DECL>: For DECL_WEAK decls return true if expr isn't known to be defined in current TU or some other LTO partition. From-SVN: r175884
This commit is contained in:
parent
49bf9170eb
commit
f2c3a8ce9c
|
|
@ -1,3 +1,12 @@
|
||||||
|
2011-07-05 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR tree-optimization/49618
|
||||||
|
* tree-eh.c (tree_could_trap_p) <case CALL_EXPR>: For DECL_WEAK
|
||||||
|
t recurse on the decl.
|
||||||
|
<case FUNCTION_DECL, case VAR_DECL>: For DECL_WEAK decls
|
||||||
|
return true if expr isn't known to be defined in current
|
||||||
|
TU or some other LTO partition.
|
||||||
|
|
||||||
2011-07-05 Michael Meissner <meissner@linux.vnet.ibm.com>
|
2011-07-05 Michael Meissner <meissner@linux.vnet.ibm.com>
|
||||||
|
|
||||||
* params.def (PARAM_CASE_VALUES_THRESHOLD): New parameter to
|
* params.def (PARAM_CASE_VALUES_THRESHOLD): New parameter to
|
||||||
|
|
|
||||||
|
|
@ -2449,8 +2449,42 @@ tree_could_trap_p (tree expr)
|
||||||
case CALL_EXPR:
|
case CALL_EXPR:
|
||||||
t = get_callee_fndecl (expr);
|
t = get_callee_fndecl (expr);
|
||||||
/* Assume that calls to weak functions may trap. */
|
/* Assume that calls to weak functions may trap. */
|
||||||
if (!t || !DECL_P (t) || DECL_WEAK (t))
|
if (!t || !DECL_P (t))
|
||||||
return true;
|
return true;
|
||||||
|
if (DECL_WEAK (t))
|
||||||
|
return tree_could_trap_p (t);
|
||||||
|
return false;
|
||||||
|
|
||||||
|
case FUNCTION_DECL:
|
||||||
|
/* Assume that accesses to weak functions may trap, unless we know
|
||||||
|
they are certainly defined in current TU or in some other
|
||||||
|
LTO partition. */
|
||||||
|
if (DECL_WEAK (expr))
|
||||||
|
{
|
||||||
|
struct cgraph_node *node;
|
||||||
|
if (!DECL_EXTERNAL (expr))
|
||||||
|
return false;
|
||||||
|
node = cgraph_function_node (cgraph_get_node (expr), NULL);
|
||||||
|
if (node && node->in_other_partition)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
|
case VAR_DECL:
|
||||||
|
/* Assume that accesses to weak vars may trap, unless we know
|
||||||
|
they are certainly defined in current TU or in some other
|
||||||
|
LTO partition. */
|
||||||
|
if (DECL_WEAK (expr))
|
||||||
|
{
|
||||||
|
struct varpool_node *node;
|
||||||
|
if (!DECL_EXTERNAL (expr))
|
||||||
|
return false;
|
||||||
|
node = varpool_variable_node (varpool_get_node (expr), NULL);
|
||||||
|
if (node && node->in_other_partition)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue