- /* Although static-storage variables start off initialized, according to
- ANSI C, a memcpy could overwrite them with uninitialized values. So
- we check them too. This also lets us check for read-only variables
- accessed via a non-const declaration, in case it won't be detected
- any other way (e.g., in an embedded system or OS kernel without
- memory protection).
-
- Aggregates are not checked here; they're handled elsewhere. */
- if (cfun && current_function_check_memory_usage
- && code == VAR_DECL
- && GET_CODE (DECL_RTL (exp)) == MEM
- && ! AGGREGATE_TYPE_P (TREE_TYPE (exp)))
- {
- enum memory_use_mode memory_usage;
- memory_usage = get_memory_usage_from_modifier (modifier);
-
- in_check_memory_usage = 1;
- if (memory_usage != MEMORY_USE_DONT)
- emit_library_call (chkr_check_addr_libfunc,
- LCT_CONST_MAKE_BLOCK, VOIDmode, 3,
- XEXP (DECL_RTL (exp), 0), Pmode,
- GEN_INT (int_size_in_bytes (type)),
- TYPE_MODE (sizetype),
- GEN_INT (memory_usage),
- TYPE_MODE (integer_type_node));
- in_check_memory_usage = 0;
- }
-