This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Minor calls.c bug
- To: gcc-patches at gcc dot gnu dot org
- Subject: Minor calls.c bug
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Thu, 23 Mar 00 17:25:23 EST
This fixes a bug that occurs when the initialization of a "constant"
BLKmode object occurs within a loop via a call to a function. Without
adding an explicit CLOBBER, we can hoist a reference to that variable
outside the loop.
Thu Mar 23 17:10:48 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* calls.c (expand_call): If TARGET is passed by reference and
is readonly, write a CLOBBER.
*** calls.c 2000/03/23 00:40:56 1.101
--- calls.c 2000/03/23 22:09:52
*************** expand_call (exp, target, ignore)
*** 2777,2780 ****
--- 2777,2788 ----
current_function_calls_longjmp = 1, sibcall_failure = 1;
+ /* If this function is returning into a memory location marked as
+ readonly, it means it is initializing that location. But we normally
+ treat functions as not clobbering such locations, so we need to
+ specify that this one does. */
+ if (target != 0 && GET_CODE (target) == MEM
+ && structure_value_addr != 0 && RTX_UNCHANGING_P (target))
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
+
/* If value type not void, return an rtx for the value. */