aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-07-01 07:37:28 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-07-01 07:37:28 +0000
commit2f215d2176608467aeee73b245beedfc60836b71 (patch)
treeb1782cf53d19d89582c8e403c14561dc4e994943
parent8d1184f02585a39f1b4813c92e63bc697fc39adf (diff)
downloadgcc-2f215d2176608467aeee73b245beedfc60836b71.zip
gcc-2f215d2176608467aeee73b245beedfc60836b71.tar.gz
gcc-2f215d2176608467aeee73b245beedfc60836b71.tar.bz2
tree-ssa-sccvn.c (copy_reference_ops_from_ref): Adjust TARGET_MEM_REF handling to also handle address-taken ones.
2019-07-01 Richard Biener <rguenther@suse.de> * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Adjust TARGET_MEM_REF handling to also handle address-taken ones. From-SVN: r272842
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-ssa-sccvn.c47
2 files changed, 19 insertions, 33 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c559b3e..77d5845 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2019-07-01 Richard Biener <rguenther@suse.de>
+
+ * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Adjust
+ TARGET_MEM_REF handling to also handle address-taken ones.
+
2019-07-01 Hongtao Liu <hongtao.liu@intel.com>
* doc/sourcebuild.texi (Effective-Target Keywords, Other
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 9c74be0..dcfafef 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -791,39 +791,6 @@ vn_reference_eq (const_vn_reference_t const vr1, const_vn_reference_t const vr2)
static void
copy_reference_ops_from_ref (tree ref, vec<vn_reference_op_s> *result)
{
- if (TREE_CODE (ref) == TARGET_MEM_REF)
- {
- vn_reference_op_s temp;
-
- result->reserve (3);
-
- memset (&temp, 0, sizeof (temp));
- temp.type = TREE_TYPE (ref);
- temp.opcode = TREE_CODE (ref);
- temp.op0 = TMR_INDEX (ref);
- temp.op1 = TMR_STEP (ref);
- temp.op2 = TMR_OFFSET (ref);
- temp.off = -1;
- temp.clique = MR_DEPENDENCE_CLIQUE (ref);
- temp.base = MR_DEPENDENCE_BASE (ref);
- result->quick_push (temp);
-
- memset (&temp, 0, sizeof (temp));
- temp.type = NULL_TREE;
- temp.opcode = ERROR_MARK;
- temp.op0 = TMR_INDEX2 (ref);
- temp.off = -1;
- result->quick_push (temp);
-
- memset (&temp, 0, sizeof (temp));
- temp.type = NULL_TREE;
- temp.opcode = TREE_CODE (TMR_BASE (ref));
- temp.op0 = TMR_BASE (ref);
- temp.off = -1;
- result->quick_push (temp);
- return;
- }
-
/* For non-calls, store the information that makes up the address. */
tree orig = ref;
while (ref)
@@ -853,6 +820,20 @@ copy_reference_ops_from_ref (tree ref, vec<vn_reference_op_s> *result)
temp.base = MR_DEPENDENCE_BASE (ref);
temp.reverse = REF_REVERSE_STORAGE_ORDER (ref);
break;
+ case TARGET_MEM_REF:
+ /* The base address gets its own vn_reference_op_s structure. */
+ temp.op0 = TMR_INDEX (ref);
+ temp.op1 = TMR_STEP (ref);
+ temp.op2 = TMR_OFFSET (ref);
+ temp.clique = MR_DEPENDENCE_CLIQUE (ref);
+ temp.base = MR_DEPENDENCE_BASE (ref);
+ result->safe_push (temp);
+ memset (&temp, 0, sizeof (temp));
+ temp.type = NULL_TREE;
+ temp.opcode = ERROR_MARK;
+ temp.op0 = TMR_INDEX2 (ref);
+ temp.off = -1;
+ break;
case BIT_FIELD_REF:
/* Record bits, position and storage order. */
temp.op0 = TREE_OPERAND (ref, 1);