* [PATCH][mem-ref2] Fold V_C_E of MEM_REF
@ 2010-06-10 11:16 Richard Guenther
0 siblings, 0 replies; only message in thread
From: Richard Guenther @ 2010-06-10 11:16 UTC (permalink / raw)
To: gcc-patches
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to the
branch.
2010-06-10 Richard Guenther <rguenther@suse.de>
* fold-const.c (fold_unary_loc): Fold
VIEW_CONVERT_EXPR <T1, MEM_REF <T2, ...>> to MEM_REF <T1, ...>.
Index: gcc/fold-const.c
===================================================================
*** gcc/fold-const.c (revision 160434)
--- gcc/fold-const.c (working copy)
*************** fold_unary_loc (location_t loc, enum tre
*** 8048,8053 ****
--- 8048,8056 ----
if (TREE_CODE (op0) == VIEW_CONVERT_EXPR)
return fold_build1_loc (loc, VIEW_CONVERT_EXPR,
type, TREE_OPERAND (op0, 0));
+ if (TREE_CODE (op0) == MEM_REF)
+ return fold_build2_loc (loc, MEM_REF, type,
+ TREE_OPERAND (op0, 0), TREE_OPERAND (op0, 1));
/* For integral conversions with the same precision or pointer
conversions use a NOP_EXPR instead. */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-06-10 10:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-10 11:16 [PATCH][mem-ref2] Fold V_C_E of MEM_REF Richard Guenther
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).