tree rhs = gimple_return_retval (return_stmt);
if (lhs && rhs)
- copy_region (get_lvalue (lhs, ctxt), get_lvalue (rhs, ctxt), ctxt);
+ {
+ const svalue *sval = get_rvalue (rhs, ctxt);
+ const region *ret_reg = get_lvalue (lhs, ctxt);
+ set_value (ret_reg, sval, ctxt);
+ }
}
/* Update this model for a call and return of setjmp/sigsetjmp at CALL within
tree result = DECL_RESULT (fndecl);
if (result && TREE_TYPE (result) != void_type_node)
{
+ const svalue *retval = get_rvalue (result, ctxt);
if (result_dst_reg)
- {
- /* Copy the result to RESULT_DST_REG. */
- copy_region (result_dst_reg,
- get_lvalue (result, ctxt),
- ctxt);
- }
+ set_value (result_dst_reg, retval, ctxt);
if (out_result)
- *out_result = get_rvalue (result, ctxt);
+ *out_result = retval;
}
/* Pop the frame. */
model.set_value (c_y, int_m3, NULL);
/* Copy c to d. */
- model.copy_region (model.get_lvalue (d, NULL), model.get_lvalue (c, NULL),
- NULL);
+ const svalue *sval = model.get_rvalue (c, NULL);
+ model.set_value (model.get_lvalue (d, NULL), sval, NULL);
+
/* Check that the fields have the same svalues. */
ASSERT_EQ (model.get_rvalue (c_x, NULL), model.get_rvalue (d_x, NULL));
ASSERT_EQ (model.get_rvalue (c_y, NULL), model.get_rvalue (d_y, NULL));
void zero_fill_region (const region *reg);
void mark_region_as_unknown (const region *reg, uncertainty_t *uncertainty);
- void copy_region (const region *dst_reg, const region *src_reg,
- region_model_context *ctxt);
tristate eval_condition (const svalue *lhs,
enum tree_code op,
const svalue *rhs) const;
return false;
}
-/* Copy from SRC_REG to DST_REG, using CTXT for any issues that occur. */
-
-void
-region_model::copy_region (const region *dst_reg, const region *src_reg,
- region_model_context *ctxt)
-{
- gcc_assert (dst_reg);
- gcc_assert (src_reg);
- if (dst_reg == src_reg)
- return;
-
- const svalue *sval = get_store_value (src_reg, ctxt);
- set_value (dst_reg, sval, ctxt);
-}
-
/* Dump a description of this region to stderr. */
DEBUG_FUNCTION void
__analyzer_eval (arr[i]); /* { dg-warning "TRUE" } */
else
__analyzer_eval (arr[i]); /* { dg-warning "FALSE" } */
+ return 1;
}
int test_3 (int arr[], int i, int n)
__analyzer_eval (arr[i]); /* { dg-warning "TRUE" } */
else
__analyzer_eval (arr[i]); /* { dg-warning "FALSE" } */
+ return 1;
}
void test_4 (int i, int n)
--- /dev/null
+/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
+/* { dg-additional-options "-ftrivial-auto-var-init=pattern" } */
+
+int test_1 (void)
+{
+ int i; /* { dg-message "region created on stack here" } */
+ return i; /* { dg-warning "use of uninitialized value 'i.*'" } */
+ /* FIXME: the LTO build sometimes shows SSA names here
+ (PR analyzer/94976). */
+}
--- /dev/null
+/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
+/* { dg-additional-options "-ftrivial-auto-var-init=uninitialized" } */
+
+int test_1 (void)
+{
+ int i; /* { dg-message "region created on stack here" } */
+ return i; /* { dg-warning "use of uninitialized value 'i.*'" } */
+ /* FIXME: the LTO build sometimes shows SSA names here
+ (PR analyzer/94976). */
+}
--- /dev/null
+/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
+/* { dg-additional-options "-ftrivial-auto-var-init=zero" } */
+
+int test_1 (void)
+{
+ int i; /* { dg-message "region created on stack here" } */
+ return i; /* { dg-warning "use of uninitialized value 'i.*'" } */
+ /* FIXME: the LTO build sometimes shows SSA names here
+ (PR analyzer/94976). */
+}
+++ /dev/null
-/* { dg-additional-options "-ftrivial-auto-var-init=pattern" } */
-
-int test_1 (void)
-{
- int i; /* { dg-message "region created on stack here" } */
- return i; /* { dg-warning "use of uninitialized value 'i'" } */
-}
+++ /dev/null
-/* { dg-additional-options "-ftrivial-auto-var-init=uninitialized" } */
-
-int test_1 (void)
-{
- int i; /* { dg-message "region created on stack here" } */
- return i; /* { dg-warning "use of uninitialized value 'i'" } */
-}
+++ /dev/null
-/* { dg-additional-options "-ftrivial-auto-var-init=zero" } */
-
-int test_1 (void)
-{
- int i; /* { dg-message "region created on stack here" } */
- return i; /* { dg-warning "use of uninitialized value 'i'" } */
-}