From 5096b8b0737835fa660203a0b092e0feb0d5e850 Mon Sep 17 00:00:00 2001 From: davem Date: Fri, 27 Sep 2002 04:12:51 +0000 Subject: [PATCH] 2002-09-26 David S. Miller 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 | 6 ++++++ gcc/calls.c | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2212bac341c5..3fb28e50bbdc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-09-26 David S. Miller + + 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 * dbxout.c (FORCE_TEXT): Switch to current_function_decl, not diff --git a/gcc/calls.c b/gcc/calls.c index d4e3f0095893..ffedacabbb05 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -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) -- 2.39.2