OSDN Git Service

2002-09-26 David S. Miller <davem@redhat.com>
authordavem <davem@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Sep 2002 04:12:51 +0000 (04:12 +0000)
committerdavem <davem@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Sep 2002 04:12:51 +0000 (04:12 +0000)
PR optimization/7335
* calls.c (emit_library_call_value_1): Passing args by reference
converts a CONST function into a PURE one.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57576 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/calls.c

index 2212bac..3fb28e5 100644 (file)
@@ -1,3 +1,9 @@
+2002-09-26  David S. Miller  <davem@redhat.com>
+
+       PR optimization/7335
+       * calls.c (emit_library_call_value_1): Passing args by reference
+       converts a CONST function into a PURE one.
+
 2002-09-26  David Edelsohn  <edelsohn@gnu.org>
 
        * dbxout.c (FORCE_TEXT): Switch to current_function_decl, not
index d4e3f00..ffedaca 100644 (file)
@@ -3684,6 +3684,14 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
            }
          flags &= ~(ECF_CONST | ECF_PURE | ECF_LIBCALL_BLOCK);
 
+         /* If this was a CONST function, it is now PURE since
+            it now reads memory.  */
+         if (flags & ECF_CONST)
+           {
+             flags &= ~ECF_CONST;
+             flags |= ECF_PURE;
+           }
+
          if (GET_MODE (val) == MEM && ! must_copy)
            slot = val;
          else if (must_copy)