aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils2.cc
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2022-02-16 18:21:58 -0500
committerDavid Malcolm <dmalcolm@redhat.com>2022-02-16 21:39:56 -0500
commit5fbcbcaff7248604e04b39464f4fbd64fbf6e43b (patch)
tree895f547813e8a260b8528c9adbdf655e591f674d /gcc/ada/gcc-interface/utils2.cc
parentcb3afcd2a380f2fb6c490f2c1318f76402eab43a (diff)
downloadgcc-5fbcbcaff7248604e04b39464f4fbd64fbf6e43b.zip
gcc-5fbcbcaff7248604e04b39464f4fbd64fbf6e43b.tar.gz
gcc-5fbcbcaff7248604e04b39464f4fbd64fbf6e43b.tar.bz2
analyzer: const functions have no side effects [PR104576]
PR analyzer/104576 tracks that we issue a false positive from -Wanalyzer-use-of-uninitialized-value for the reproducers of PR 63311 when optimization is disabled. The root cause is that the analyzer was considering that a call to __builtin_sinf could have side-effects. This patch fixes things by generalizing the handling for "pure" functions to also consider "const" functions. gcc/analyzer/ChangeLog: PR analyzer/104576 * region-model.cc: Include "calls.h". (region_model::on_call_pre): Use flags_from_decl_or_type to generalize check for DECL_PURE_P to also check for ECF_CONST. gcc/testsuite/ChangeLog: PR analyzer/104576 * gcc.dg/analyzer/torture/uninit-pr63311.c: New test. * gcc.dg/analyzer/uninit-pr104576.c: New test. * gfortran.dg/analyzer/uninit-pr63311.f90: New test. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/ada/gcc-interface/utils2.cc')
0 files changed, 0 insertions, 0 deletions