aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2014-09-03 15:54:25 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-09-03 15:54:26 +0000
commit8a89bc750653a94826cbc238e749acfcda8625a1 (patch)
tree327bab66f1917e26c85bc779b77e732a0ffa72dc /gcc-4.9
parent54737a0f41ce0bf1e8f7f8d6d8e3170ef51e07c2 (diff)
parent548c7fb638fe0054f6c540639607b3c713d5d4b7 (diff)
downloadtoolchain_gcc-8a89bc750653a94826cbc238e749acfcda8625a1.tar.gz
toolchain_gcc-8a89bc750653a94826cbc238e749acfcda8625a1.tar.bz2
toolchain_gcc-8a89bc750653a94826cbc238e749acfcda8625a1.zip
Merge "[4.9] Backport of patch fixing PR61672."
Diffstat (limited to 'gcc-4.9')
-rw-r--r--gcc-4.9/gcc/cfgcleanup.c3
-rw-r--r--gcc-4.9/gcc/cse.c2
-rw-r--r--gcc-4.9/gcc/emit-rtl.c6
-rw-r--r--gcc-4.9/gcc/emit-rtl.h3
4 files changed, 11 insertions, 3 deletions
diff --git a/gcc-4.9/gcc/cfgcleanup.c b/gcc-4.9/gcc/cfgcleanup.c
index 77196ee6b..de307da54 100644
--- a/gcc-4.9/gcc/cfgcleanup.c
+++ b/gcc-4.9/gcc/cfgcleanup.c
@@ -53,6 +53,7 @@ along with GCC; see the file COPYING3. If not see
#include "df.h"
#include "dce.h"
#include "dbgcnt.h"
+#include "emit-rtl.h"
#define FORWARDER_BLOCK_P(BB) ((BB)->flags & BB_FORWARDER_BLOCK)
@@ -882,7 +883,7 @@ merge_memattrs (rtx x, rtx y)
if (GET_MODE (x) != GET_MODE (y))
return;
- if (code == MEM && MEM_ATTRS (x) != MEM_ATTRS (y))
+ if (code == MEM && !mem_attrs_eq_p (MEM_ATTRS (x), MEM_ATTRS (y)))
{
if (! MEM_ATTRS (x))
MEM_ATTRS (y) = 0;
diff --git a/gcc-4.9/gcc/cse.c b/gcc-4.9/gcc/cse.c
index b8223f7a3..ec9aff419 100644
--- a/gcc-4.9/gcc/cse.c
+++ b/gcc-4.9/gcc/cse.c
@@ -2680,7 +2680,7 @@ exp_equiv_p (const_rtx x, const_rtx y, int validate, bool for_gcse)
But because really all MEM attributes should be the same for
equivalent MEMs, we just use the invariant that MEMs that have
the same attributes share the same mem_attrs data structure. */
- if (MEM_ATTRS (x) != MEM_ATTRS (y))
+ if (!mem_attrs_eq_p (MEM_ATTRS (x), MEM_ATTRS (y)))
return 0;
}
break;
diff --git a/gcc-4.9/gcc/emit-rtl.c b/gcc-4.9/gcc/emit-rtl.c
index 4736f8d0d..3041b9e7a 100644
--- a/gcc-4.9/gcc/emit-rtl.c
+++ b/gcc-4.9/gcc/emit-rtl.c
@@ -245,9 +245,13 @@ const_fixed_htab_eq (const void *x, const void *y)
/* Return true if the given memory attributes are equal. */
-static bool
+bool
mem_attrs_eq_p (const struct mem_attrs *p, const struct mem_attrs *q)
{
+ if (p == q)
+ return true;
+ if (!p || !q)
+ return false;
return (p->alias == q->alias
&& p->offset_known_p == q->offset_known_p
&& (!p->offset_known_p || p->offset == q->offset)
diff --git a/gcc-4.9/gcc/emit-rtl.h b/gcc-4.9/gcc/emit-rtl.h
index fe68de947..36eb0c8b1 100644
--- a/gcc-4.9/gcc/emit-rtl.h
+++ b/gcc-4.9/gcc/emit-rtl.h
@@ -20,6 +20,9 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_EMIT_RTL_H
#define GCC_EMIT_RTL_H
+/* Return whether two MEM_ATTRs are equal. */
+bool mem_attrs_eq_p (const struct mem_attrs *, const struct mem_attrs *);
+
/* Set the alias set of MEM to SET. */
extern void set_mem_alias_set (rtx, alias_set_type);