summaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-11-04 20:14:07 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2016-11-04 20:14:07 +0100
commit5f4cebba260db0f1b1edf45152be3bad2ed779a8 (patch)
tree44171163f2384ac617137b2fbe9257ebe8efbebc /gcc/alias.c
parent6e3ae7e6f5699430cdedd1ca2a7b5cfa020171aa (diff)
re PR target/77834 (ICE: in make_decl_rtl, at varasm.c:1311 with -O -ftree-pre -mstringop-strategy=libcall)
PR target/77834 * alias.c (nonoverlapping_memrefs_p): Return 0 if exprx or expry doesn't have rtl set. * gcc.dg/pr77834.c: New test. From-SVN: r241859
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index ca475ff92af..fd3dec4d0e3 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -2755,6 +2755,13 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y, bool loop_invariant)
|| TREE_CODE (expry) == CONST_DECL)
return 1;
+ /* If either of the decls doesn't have DECL_RTL set (e.g. marked as
+ living in multiple places), we can't tell anything. Exception
+ are FUNCTION_DECLs for which we can create DECL_RTL on demand. */
+ if ((!DECL_RTL_SET_P (exprx) && TREE_CODE (exprx) != FUNCTION_DECL)
+ || (!DECL_RTL_SET_P (expry) && TREE_CODE (expry) != FUNCTION_DECL))
+ return 0;
+
rtlx = DECL_RTL (exprx);
rtly = DECL_RTL (expry);