GCC Middle and Back End API Reference
gimple-ssa-warn-restrict.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

opt_code check_bounds_or_overlap (gimple *, tree, tree, tree, tree, bool=false, bool=true)
 
opt_code check_bounds_or_overlap (class pointer_query &, gimple *, tree, tree, tree, tree, bool=false, bool=true)
 

Function Documentation

◆ check_bounds_or_overlap() [1/2]

opt_code check_bounds_or_overlap ( class pointer_query & ptrqry,
gimple * call,
tree dst,
tree src,
tree dstsize,
tree srcsize,
bool bounds_only = false,
bool do_warn = true )
extern

◆ check_bounds_or_overlap() [2/2]

opt_code check_bounds_or_overlap ( gimple * call,
tree dst,
tree src,
tree dstsize,
tree srcsize,
bool bounds_only,
bool do_warn )
extern
Warn on violations of the restrict qualifier.
Copyright (C) 2017-2024 Free Software Foundation, Inc.
Contributed by Martin Sebor <msebor@redhat.com>.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
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().