+2015-08-18 Marek Polacek <polacek@redhat.com>
+
+ PR middle-end/67222
+ * gimple-low.c (lower_stmt): Don't lower BUILT_IN_POSIX_MEMALIGN
+ if the call isn't valid.
+ * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Check builtins using
+ gimple_call_builtin_p.
+ (call_may_clobber_ref_p_1): Likewise.
+ (stmt_kills_ref_p): Likewise.
+
2015-08-18 Robert Suchanek <robert.suchanek@imgtec.com>
* config/mips/mips-protos.h (mips_hard_regno_rename_ok): New prototype.
return;
}
else if (DECL_FUNCTION_CODE (decl) == BUILT_IN_POSIX_MEMALIGN
- && flag_tree_bit_ccp)
+ && flag_tree_bit_ccp
+ && gimple_builtin_call_types_compatible_p (stmt, decl))
{
lower_builtin_posix_memalign (gsi);
return;
+2015-08-18 Marek Polacek <polacek@redhat.com>
+
+ PR middle-end/67222
+ * gcc.dg/torture/pr67222.c: New test.
+
2015-08-18 Robert Suchanek <robert.suchanek@imgtec.com>
* gcc.target/mips/interrupt_handler-bug-1.c: New test.
--- /dev/null
+/* PR middle-end/67222 */
+/* { dg-do compile } */
+
+void
+foo (void **p)
+{
+ posix_memalign (); /* { dg-warning "implicit declaration" } */
+ posix_memalign (p);
+ posix_memalign (0);
+ posix_memalign (p, 1);
+ posix_memalign (p, "foo");
+ posix_memalign ("gnu", "gcc");
+ posix_memalign (1, p);
+ posix_memalign (1, 2);
+ posix_memalign (1, 2, 3);
+ posix_memalign (p, p, p);
+ posix_memalign (p, "qui", 3);
+ posix_memalign (p, 1, 2);
+}
escape points. See tree-ssa-structalias.c:find_func_aliases
for the list of builtins we might need to handle here. */
if (callee != NULL_TREE
- && DECL_BUILT_IN_CLASS (callee) == BUILT_IN_NORMAL)
+ && gimple_call_builtin_p (call, BUILT_IN_NORMAL))
switch (DECL_FUNCTION_CODE (callee))
{
/* All the following functions read memory pointed to by
escape points. See tree-ssa-structalias.c:find_func_aliases
for the list of builtins we might need to handle here. */
if (callee != NULL_TREE
- && DECL_BUILT_IN_CLASS (callee) == BUILT_IN_NORMAL)
+ && gimple_call_builtin_p (call, BUILT_IN_NORMAL))
switch (DECL_FUNCTION_CODE (callee))
{
/* All the following functions clobber memory pointed to by
{
tree callee = gimple_call_fndecl (stmt);
if (callee != NULL_TREE
- && DECL_BUILT_IN_CLASS (callee) == BUILT_IN_NORMAL)
+ && gimple_call_builtin_p (stmt, BUILT_IN_NORMAL))
switch (DECL_FUNCTION_CODE (callee))
{
case BUILT_IN_FREE: