in search of clue regarding -fcheck-memory-usage

Zack Weinberg zackw@stanford.edu
Sat Jan 20 22:08:00 GMT 2001


So I'm trying to fix the fixup_var_refs bottleneck, which looks like
it will take some pretty drastic changes to function.c and related,
and I can't figure out what to do with the -fcheck-memory-usage hooks.

Here's a sample:

  if (current_function_check_memory_usage)
    emit_library_call (chkr_set_right_libfunc, LCT_CONST_MAKE_BLOCK, VOIDmode,
		       3, XEXP (reg, 0), Pmode,
		       GEN_INT (GET_MODE_SIZE (GET_MODE (reg))),
		       TYPE_MODE (sizetype),
		       GEN_INT (MEMORY_USE_RW),
		       TYPE_MODE (integer_type_node));

So this generates a call to a runtime library routine.  It's being
handed a bunch of data regarding a variable that we just decided had
to live in a stack slot.  Beyond that I don't know what it does.

My major concern is that up till now 'reg' had been destructively
replaced by a MEM rtx before we got here.  My changes are going to
postpone that until after we're done generating RTL.  So XEXP (reg, 0)
is now an invalid operation.  What should I be replacing it with?

zw



More information about the Gcc mailing list