+2019-10-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/92231
+ * tree.h (fndecl_built_in_p): Use fndecl_built_in_p instead of
+ DECL_BUILT_IN in comment. Remove redundant ()s around return
+ argument.
+ * tree.c (free_lang_data_in_decl): Check if var is FUNCTION_DECL
+ before calling fndecl_built_in_p.
+ * gimple-fold.c (gimple_fold_stmt_to_constant_1): Check if
+ TREE_OPERAND (fn, 0) is a FUNCTION_DECL before calling
+ fndecl_built_in_p on it.
+
2019-10-31 Andre Vieira <andre.simoesdiasvieira@arm.com>
* params.def (PARAM_VECT_EPILOGUES_NOMASK): Enable by default.
fn = (*valueize) (gimple_call_fn (stmt));
if (TREE_CODE (fn) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (fn, 0)) == FUNCTION_DECL
&& fndecl_built_in_p (TREE_OPERAND (fn, 0))
&& gimple_builtin_call_types_compatible_p (stmt,
TREE_OPERAND (fn, 0)))
+2019-10-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/92231
+ * lto-lang.c (handle_const_attribute): Don't call fndecl_built_in_p
+ on *node that is not FUNCTION_DECL.
+
2019-10-30 Martin Liska <mliska@suse.cz>
PR lto/91393
tree ARG_UNUSED (args), int ARG_UNUSED (flags),
bool * ARG_UNUSED (no_add_attrs))
{
- if (!fndecl_built_in_p (*node))
+ if (TREE_CODE (*node) != FUNCTION_DECL
+ || !fndecl_built_in_p (*node))
inform (UNKNOWN_LOCATION, "%s:%s: %E: %E", __FILE__, __func__, *node, name);
tree type = TREE_TYPE (*node);
+2019-10-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/92231
+ * gcc.c-torture/compile/pr92231.c: New test.
+
2019-10-31 Andre Vieira <andre.simoesdiasvieira@arm.com>
* gcc.dg/vect/vect-epilogues.c: New test.
--- /dev/null
+/* PR middle-end/92231 */
+
+extern int bar (void);
+
+int
+foo (void)
+{
+ return (&bar + 4096) ();
+}
while (*nextp)
{
tree var = *nextp;
- if (fndecl_built_in_p (var))
+ if (TREE_CODE (var) == FUNCTION_DECL
+ && fndecl_built_in_p (var))
*nextp = TREE_CHAIN (var);
else
nextp = &TREE_CHAIN (var);
Note that it is different from the DECL_IS_BUILTIN accessor. For
instance, user declared prototypes of C library functions are not
- DECL_IS_BUILTIN but may be DECL_BUILT_IN. */
+ DECL_IS_BUILTIN but may be fndecl_built_in_p. */
inline bool
fndecl_built_in_p (const_tree node)
{
- return (DECL_BUILT_IN_CLASS (node) != NOT_BUILT_IN);
+ return DECL_BUILT_IN_CLASS (node) != NOT_BUILT_IN;
}
/* Return true if a FUNCTION_DECL NODE is a GCC built-in function
inline bool
fndecl_built_in_p (const_tree node, built_in_class klass)
{
- return (fndecl_built_in_p (node) && DECL_BUILT_IN_CLASS (node) == klass);
+ return fndecl_built_in_p (node) && DECL_BUILT_IN_CLASS (node) == klass;
}
/* Return true if a FUNCTION_DECL NODE is a GCC built-in function