diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-11-04 19:14:07 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-11-04 19:14:07 +0000 |
commit | cdf566879db5e9702100269a9c49226b40af65e6 (patch) | |
tree | 44171163f2384ac617137b2fbe9257ebe8efbebc /gcc/alias.c | |
parent | 8be5cb788480484c82753359c878a8d4e984a798 (diff) | |
download | gcc-cdf566879db5e9702100269a9c49226b40af65e6.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241859 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/alias.c')
-rw-r--r-- | gcc/alias.c | 7 |
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); |