This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bad hoist


   From: Richard Henderson <rth@redhat.com>
   Date: Thu, 26 Sep 2002 17:19:44 -0700

   On Thu, Sep 26, 2002 at 04:55:52PM -0700, David S. Miller wrote:
   > Maybe it should walk the CALL_INSN_FUNCTION_USAGE and for
   > each USE/CLOBBER, and mark any matching loop_mems as not to be
   > optimized.  How does that sound?
   
   Sounds right.
   
Actually, LCT_CONST means no memory referenced, so the hoisting code
is fine.  It also invalidates hoists properly when LCT_PURE is
used.

Something else is going wrong.

It appears convert_move() does not handle "from" being a MEM
properly, hmmm...

The following appears to fix the problem, comments?

Actually, maybe this is not where the fix belongs.  It probably
belongs in the place which converts the operands to proper
function call arguments.  (ie. if an argument ends up being passed
by reference in memory, convert LCT_CONST to LCT_PURE)

2002-09-26  David S. Miller  <davem@redhat.com>

	* expr.c (convert_move): Use LCT_PURE if 'from' is a MEM.

--- expr.c.~1~	Thu Sep  5 21:01:05 2002
+++ expr.c	Thu Sep 26 17:16:53 2002
@@ -781,7 +781,10 @@
 	abort ();
 
       start_sequence ();
-      value = emit_library_call_value (libcall, NULL_RTX, LCT_CONST, to_mode,
+      value = emit_library_call_value (libcall, NULL_RTX,
+				       (GET_CODE (from) == MEM
+					? LCT_PURE : LCT_CONST),
+				       to_mode,
 				       1, from, from_mode);
       insns = get_insns ();
       end_sequence ();


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]