GCC Middle and Back End API Reference
gimple-ssa-warn-restrict.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "tree.h"
#include "gimple.h"
#include "tree-pass.h"
#include "pointer-query.h"
#include "ssa.h"
#include "gimple-pretty-print.h"
#include "gimple-ssa-warn-access.h"
#include "gimple-ssa-warn-restrict.h"
#include "diagnostic-core.h"
#include "fold-const.h"
#include "gimple-iterator.h"
#include "tree-dfa.h"
#include "tree-ssa.h"
#include "tree-cfg.h"
#include "tree-object-size.h"
#include "calls.h"
#include "cfgloop.h"
#include "intl.h"
#include "gimple-range.h"
Include dependency graph for gimple-ssa-warn-restrict.cc:

Functions

opt_code check_bounds_or_overlap (gimple *call, tree dst, tree src, tree dstsize, tree srcsize, bool bounds_only, bool do_warn)
 
opt_code check_bounds_or_overlap (pointer_query &ptrqry, gimple *call, tree dst, tree src, tree dstsize, tree srcsize, bool bounds_only, bool do_warn)
 
gimple_opt_passmake_pass_warn_restrict (gcc::context *ctxt)
 
DEBUG_FUNCTION void dump_builtin_memref (FILE *fp, const builtin_memref &ref)
 
DEBUG_FUNCTION void dump_builtin_access (FILE *fp, gimple *stmt, const builtin_access &acs)
 
DEBUG_FUNCTION void debug (gimple *stmt, const builtin_access &acs)
 

Function Documentation

◆ check_bounds_or_overlap() [1/2]

opt_code check_bounds_or_overlap ( gimple * call,
tree dst,
tree src,
tree dstsize,
tree srcsize,
bool bounds_only,
bool do_warn )
Attempt to detect and diagnose invalid offset bounds and (except for
memmove) overlapping copy in a call expression EXPR from SRC to DST
and DSTSIZE and SRCSIZE bytes, respectively.  Both DSTSIZE and
SRCSIZE may be NULL.  DO_WARN is false to detect either problem
without issue a warning.  Return the OPT_Wxxx constant corresponding
to the warning if one has been detected and zero otherwise.   

References cfun, check_bounds_or_overlap(), and get_range_query().

Referenced by check_bounds_or_overlap(), gimple_fold_builtin_memory_op(), strlen_pass::handle_builtin_strcat(), strlen_pass::handle_builtin_strcpy(), and strlen_pass::handle_builtin_stxncpy_strncat().

◆ check_bounds_or_overlap() [2/2]

opt_code check_bounds_or_overlap ( pointer_query & ptrqry,
gimple * call,
tree dst,
tree src,
tree dstsize,
tree srcsize,
bool bounds_only,
bool do_warn )

◆ debug()

DEBUG_FUNCTION void debug ( gimple * stmt,
const builtin_access & acs )

References dump_builtin_access().

◆ dump_builtin_access()

DEBUG_FUNCTION void dump_builtin_access ( FILE * fp,
gimple * stmt,
const builtin_access & acs )

References print_gimple_expr(), and TDF_LINENO.

Referenced by debug().

◆ dump_builtin_memref()

DEBUG_FUNCTION void dump_builtin_memref ( FILE * fp,
const builtin_memref & ref )

References print_generic_expr(), and TDF_LINENO.

◆ make_pass_warn_restrict()

gimple_opt_pass * make_pass_warn_restrict ( gcc::context * ctxt)