diff options
author | eraman <eraman@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-05-21 22:36:29 +0000 |
---|---|---|
committer | eraman <eraman@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-05-21 22:36:29 +0000 |
commit | 64e4dbeac146a3aa3682b83d635fc08cd7371c1a (patch) | |
tree | fc587480adf7a3b1be4776a2f69bd71d81958cfb /gcc/tree-ssa-reassoc.c | |
parent | ed89150ab33bd05799b31d31424cb50c2dd0b481 (diff) | |
download | gcc-64e4dbeac146a3aa3682b83d635fc08cd7371c1a.tar.gz |
2013-05-21 Easwaran Raman <eraman@google.com>
PR tree-optimization/57322
* (build_and_add_sum): If a BB is empty, set the UID of the statement
added to the BB to be 1.
testsuite/ChangeLog:
2013-05-21 Easwaran Raman <eraman@google.com>
PR tree-optimization/57322
* gcc.dg/tree-ssa/reassoc-29.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199165 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-reassoc.c')
-rw-r--r-- | gcc/tree-ssa-reassoc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index 29c9dff2868..8e137630624 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -1165,8 +1165,12 @@ build_and_add_sum (tree type, tree op1, tree op2, enum tree_code opcode) if ((!op1def || gimple_nop_p (op1def)) && (!op2def || gimple_nop_p (op2def))) { + gimple first_stmt; + unsigned uid; gsi = gsi_after_labels (single_succ (ENTRY_BLOCK_PTR)); - gimple_set_uid (sum, gimple_uid (gsi_stmt (gsi))); + first_stmt = gsi_stmt (gsi); + uid = first_stmt ? gimple_uid (first_stmt) : 1; + gimple_set_uid (sum, uid); gsi_insert_before (&gsi, sum, GSI_NEW_STMT); } else if ((!op1def || gimple_nop_p (op1def)) |