integrate.c (expand_inline_function): Ensure non-const actuals don't end up const...
authorOlivier Hainque <hainque@act-europe.fr>
Fri, 18 Apr 2003 22:11:57 +0000 (00:11 +0200)
committerRichard Kenner <kenner@gcc.gnu.org>
Fri, 18 Apr 2003 22:11:57 +0000 (18:11 -0400)
        * integrate.c (expand_inline_function): Ensure non-const actuals
        don't end up const in the caller's flow after conversion to possibly
        const formal type.

From-SVN: r65794

gcc/ChangeLog
gcc/integrate.c

index b21d8125d3e8f554e67c738e61c228df79983454..0a9d5e23e1093f34ebbb527fc4fdf13df5a5afcc 100644 (file)
@@ -1,3 +1,9 @@
+2003-04-18  Olivier Hainque <hainque@act-europe.fr>
+
+        * integrate.c (expand_inline_function): Ensure non-const actuals
+        don't end up const in the caller's flow after conversion to possibly
+        const formal type.
+
 2003-04-18  Vincent Celier  <celier@gnat.com>
 
         * dwarf2out.c (loc_descriptor_from_tree): Treat all *_MOD_EXPR
index 7a1865881c66cb46220fbf8895252af09f001710..60fa2acd13a6609688be8bb9bf531a42099084ad 100644 (file)
@@ -810,6 +810,14 @@ expand_inline_function (fndecl, parms, target, ignore, type,
       else
        arg_vals[i] = 0;
 
+      /* If the formal type was const but the actual was not, we might
+        end up here with an rtx wrongly tagged unchanging in the caller's
+        context.  Fix that.  */
+      if (arg_vals[i] != 0 
+         && (GET_CODE (arg_vals[i]) == REG || GET_CODE (arg_vals[i]) == MEM)
+         && ! TREE_READONLY (TREE_VALUE (actual)))
+       RTX_UNCHANGING_P (arg_vals[i]) = 0;      
+
       if (arg_vals[i] != 0
          && (! TREE_READONLY (formal)
              /* If the parameter is not read-only, copy our argument through