aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-complex.c
diff options
context:
space:
mode:
authorThomas Preud'homme <thomas.preudhomme@arm.com>2014-05-08 01:20:17 +0000
committerJoey Ye <jye2@gcc.gnu.org>2014-05-08 01:20:17 +0000
commite1ec47c453e0d7cb4e62d1d1f6c0efb43cc0bfb5 (patch)
tree9c87b46e418e3508e38a27583c76e3829a43b781 /gcc/tree-complex.c
parent10e08855d74dc3f35bb295ac2747f48dd037bee6 (diff)
downloadgcc-e1ec47c453e0d7cb4e62d1d1f6c0efb43cc0bfb5.zip
gcc-e1ec47c453e0d7cb4e62d1d1f6c0efb43cc0bfb5.tar.gz
gcc-e1ec47c453e0d7cb4e62d1d1f6c0efb43cc0bfb5.tar.bz2
re PR middle-end/39246 (FAIL: gcc.dg/uninit-13.c)
2014-05-07 Thomas Preud'homme <thomas.preudhomme@arm.com> PR middle-end/39246 * tree-complex.c (expand_complex_move): Keep line info when expanding complex move. * tree-ssa-uninit.c (warn_uninit): New argument. Ignore assignment of complex expression. Use new argument to display correct location for values coming from phi statement. (warn_uninitialized_vars): Adapt to new signature of warn_uninit. (warn_uninitialized_phi): Pass location of phi argument to warn_uninit. * tree-ssa.c (ssa_undefined_value_p): For SSA_NAME initialized by a COMPLEX_EXPR, recurse on each part of the COMPLEX_EXPR. testsuite: * gcc.dg/uninit-13.c: Move warning on the actual source line where the uninitialized complex is used. * gcc.dg/uninit-17.c: New test to check partial initialization of complex with branches. * gcc.dg/uninit-17-O0.c: Likewise. From-SVN: r210199
Diffstat (limited to 'gcc/tree-complex.c')
-rw-r--r--gcc/tree-complex.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index 7e12c30..cf542fd 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -831,12 +831,15 @@ expand_complex_move (gimple_stmt_iterator *gsi, tree type)
{
tree x;
gimple t;
+ location_t loc;
+ loc = gimple_location (stmt);
r = extract_component (gsi, rhs, 0, false);
i = extract_component (gsi, rhs, 1, false);
x = build1 (REALPART_EXPR, inner_type, unshare_expr (lhs));
t = gimple_build_assign (x, r);
+ gimple_set_location (t, loc);
gsi_insert_before (gsi, t, GSI_SAME_STMT);
if (stmt == gsi_stmt (*gsi))
@@ -849,6 +852,7 @@ expand_complex_move (gimple_stmt_iterator *gsi, tree type)
{
x = build1 (IMAGPART_EXPR, inner_type, unshare_expr (lhs));
t = gimple_build_assign (x, i);
+ gimple_set_location (t, loc);
gsi_insert_before (gsi, t, GSI_SAME_STMT);
stmt = gsi_stmt (*gsi);