aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2000-04-30 18:02:10 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2000-04-30 18:02:10 +0000
commit04dfcc8fbe278ed19ad1aea74edb7c651417cbe3 (patch)
tree46d81d2822e193f4d68a1d7a68fc8d3e9220eb56 /gcc
parent6d2c2047b5760b68cc9eb98fba1ad00a2539fc12 (diff)
downloadgcc-04dfcc8fbe278ed19ad1aea74edb7c651417cbe3.zip
gcc-04dfcc8fbe278ed19ad1aea74edb7c651417cbe3.tar.gz
gcc-04dfcc8fbe278ed19ad1aea74edb7c651417cbe3.tar.bz2
optimize.c (initialize_inlined_parameters): If the parameter is addressable...
* optimize.c (initialize_inlined_parameters): If the parameter is addressable, we need to make a new VAR_DECL, even if the initializer is constant. From-SVN: r33553
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/optimize.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 87a279d..3c75429 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2000-04-30 Mark Mitchell <mark@codesourcery.com>
+
+ * optimize.c (initialize_inlined_parameters): If the parameter is
+ addressable, we need to make a new VAR_DECL, even if the
+ initializer is constant.
+
2000-04-28 Cosmin Truta <cosmint@cs.ubbcluj.ro>
* decl.c (grok_op_properties): Add an extra check of argtypes.
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index 9863d4a..e683f7e 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -392,7 +392,9 @@ initialize_inlined_parameters (id, args, fn)
/* If the parameter is never assigned to, we may not need to
create a new variable here at all. Instead, we may be able
to just use the argument value. */
- if (TREE_READONLY (p) && !TREE_SIDE_EFFECTS (value))
+ if (TREE_READONLY (p)
+ && !TREE_ADDRESSABLE (p)
+ && !TREE_SIDE_EFFECTS (value))
{
/* Simplify the value, if possible. */
value = fold (decl_constant_value (value));