* dwarf2out.c (resolve_args_picking_1): Consider DW_OP_neg as an
unary operation, not a binary one.
+2016-05-10 Ilya Enkovich <ilya.enkovich@intel.com>
+
+ PR middle-end/70877
+ * tree-chkp.c (chkp_add_bounds_to_call_stmt): Handle
+ calls with type casted fndecl.
+
2016-05-10 Ilya Enkovich <ilya.enkovich@intel.com>
PR tree-optimization/70786
* gnat.dg/debug6.adb, gnat.dg/debug6_pkg.ads: New testcase.
+2016-05-10 Ilya Enkovich <ilya.enkovich@intel.com>
+
+ PR middle-end/70877
+ * gcc.target/i386/pr70877.c: New test.
+
2016-05-10 Ilya Enkovich <ilya.enkovich@intel.com>
PR tree-optimization/70786
--- /dev/null
+/* { dg-do compile { target { ! x32 } } } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
+
+int foo(int);
+
+typedef struct {
+ double d;
+ int a;
+} str_t;
+
+void bar(double d, int i, str_t s)
+{
+ d = ((double (*) (int)) foo) (i); /* { dg-warning "function called through a non-compatible type" } */
+}
/* If function decl is available then use it for
formal arguments list. Otherwise use function type. */
- if (fndecl && DECL_ARGUMENTS (fndecl))
+ if (fndecl
+ && DECL_ARGUMENTS (fndecl)
+ && gimple_call_fntype (call) == TREE_TYPE (fndecl))
first_formal_arg = DECL_ARGUMENTS (fndecl);
else
{
{
tree new_decl = chkp_maybe_create_clone (fndecl)->decl;
gimple_call_set_fndecl (new_call, new_decl);
- gimple_call_set_fntype (new_call, TREE_TYPE (new_decl));
+ /* In case of a type cast we should modify used function
+ type instead of using type of new fndecl. */
+ if (gimple_call_fntype (call) != TREE_TYPE (fndecl))
+ {
+ tree type = gimple_call_fntype (call);
+ type = chkp_copy_function_type_adding_bounds (type);
+ gimple_call_set_fntype (new_call, type);
+ }
+ else
+ gimple_call_set_fntype (new_call, TREE_TYPE (new_decl));
}
/* For indirect call we should fix function pointer type if
pass some bounds. */