diff options
author | Richard Guenther <rguenther@suse.de> | 2010-04-07 10:15:05 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-04-07 10:15:05 +0000 |
commit | 83a416b095d7bcd52ed95cfefc3ea51baddc5b87 (patch) | |
tree | f1d76dbdf1132745f7deb2e31b0d2c6149ec453b /gcc | |
parent | 6addabbbe815be8107207fcb6e2aa640e2e8c6ca (diff) | |
download | gcc-83a416b095d7bcd52ed95cfefc3ea51baddc5b87.zip gcc-83a416b095d7bcd52ed95cfefc3ea51baddc5b87.tar.gz gcc-83a416b095d7bcd52ed95cfefc3ea51baddc5b87.tar.bz2 |
re PR rtl-optimization/42617 (TARGET_MEM_REF and plain INDIRECT_REFs are not handled by the RTL oracle)
2010-04-07 Richard Guenther <rguenther@suse.de>
PR middle-end/42617
* expr.c (expand_expr_real_1): For TARGET_MEM_REFs with
pointer bases build simple mem attributes to retain
points-to information.
From-SVN: r158048
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/expr.c | 11 |
2 files changed, 18 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4c9b75a..b4aa73e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,13 @@ 2010-04-07 Richard Guenther <rguenther@suse.de> PR middle-end/42617 + * expr.c (expand_expr_real_1): For TARGET_MEM_REFs with + pointer bases build simple mem attributes to retain + points-to information. + +2010-04-07 Richard Guenther <rguenther@suse.de> + + PR middle-end/42617 * alias.c (ao_ref_from_mem): Without MEM_OFFSET or MEM_SIZE preserve points-to related information. @@ -8730,6 +8730,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, { addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (exp)); struct mem_address addr; + tree base; get_address_description (exp, &addr); op0 = addr_for_mem_ref (&addr, as, true); @@ -8737,6 +8738,16 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, temp = gen_rtx_MEM (mode, op0); set_mem_attributes (temp, TMR_ORIGINAL (exp), 0); set_mem_addr_space (temp, as); + base = get_base_address (TMR_ORIGINAL (exp)); + if (INDIRECT_REF_P (base) + && TMR_BASE (exp) + && TREE_CODE (TMR_BASE (exp)) == SSA_NAME + && POINTER_TYPE_P (TREE_TYPE (TMR_BASE (exp)))) + { + set_mem_expr (temp, build1 (INDIRECT_REF, + TREE_TYPE (exp), TMR_BASE (exp))); + set_mem_offset (temp, NULL_RTX); + } } return temp; |