diff options
| -rw-r--r-- | gcc/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/function.c | 10 |
2 files changed, 14 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 841d6ad..b3cf656 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-04-07 Richard Henderson <rth@redhat.com> + + PR opt/8634 + * function.c (purge_addressof_1): Don't try arithmetics for + unchanging memories. + 2003-04-07 Janis Johnson <janis187@us.ibm.com> * doc/sourcebuild.texi (Test Suites): Document testing support for 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. */ |
