aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-04-07 15:05:49 -0700
committerRichard Henderson <rth@gcc.gnu.org>2003-04-07 15:05:49 -0700
commitc5a1e3d69af23fefe755f18ece4d76542766aa46 (patch)
tree4ec74d162d70908bbc98df381fe98e72aa2b53db /gcc/function.c
parent7760d7f9b7b6d6afbe475bbe812592cc05d9b735 (diff)
downloadgcc-c5a1e3d69af23fefe755f18ece4d76542766aa46.zip
gcc-c5a1e3d69af23fefe755f18ece4d76542766aa46.tar.gz
gcc-c5a1e3d69af23fefe755f18ece4d76542766aa46.tar.bz2
re PR rtl-optimization/8634 (incorrect code for inlining of memcpy under -O2)
PR opt/8634 * function.c (purge_addressof_1): Don't try arithmetics for unchanging memories. From-SVN: r65351
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 40186b0..0b4f93f 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -3140,10 +3140,16 @@ purge_addressof_1 (loc, insn, force, store, ht)
size_x = GET_MODE_BITSIZE (GET_MODE (x));
size_sub = GET_MODE_BITSIZE (GET_MODE (sub));
+ /* Do not frob unchanging MEMs. If a later reference forces the
+ pseudo to the stack, we can wind up with multiple writes to
+ an unchanging memory, which is invalid. */
+ if (RTX_UNCHANGING_P (x) && size_x != size_sub)
+ ;
+
/* Don't even consider working with paradoxical subregs,
or the moral equivalent seen here. */
- if (size_x <= size_sub
- && int_mode_for_mode (GET_MODE (sub)) != BLKmode)
+ else if (size_x <= size_sub
+ && int_mode_for_mode (GET_MODE (sub)) != BLKmode)
{
/* Do a bitfield insertion to mirror what would happen
in memory. */