[ISan] Fix issue with constexpr. 84/158084/8
authorDenis Khalikov <d.khalikov@partner.samsung.com>
Mon, 30 Oct 2017 16:12:50 +0000 (19:12 +0300)
committerDenis Khalikov <d.khalikov@partner.samsung.com>
Thu, 9 Nov 2017 14:39:55 +0000 (17:39 +0300)
commit91dc6cda498f9cd7c608bd1494ddcd2aacee9e84
tree7beb7b838e5ee40f90087a3eeada90da9a74d0f5
parent7ff73c022a558042dfb4406afe213e26a007eb5c
[ISan] Fix issue with constexpr.

The semantic of the constexpr does not allow us
to convert POINTER type to INTERGER type inside constexpr.
All ISAN instrumentation should be folded, but it's
little bit tricky, in case we should convert INTEGER
type back to POINTER type, because INTEGER type could
not be assigned to POINTER type.
Another issue is that some actual value of PARM_DECL
could not be getting by "constexpr context" and
could not be folded.
So, just disable ISAN insrumentation and pointer
conversions for constexpr semantic. In this case we
can rely on current_function_decl while processing function,
but also should handle constexpr with pointers:
constexpr unsigned *pointer = ptr + index;

Change-Id: I68eb660438a1acd881207219c3d72045c445dcb7
gcc/c-family/c-common.c
gcc/cp/parser.c
gcc/cp/typeck.c
gcc/testsuite/g++.dg/isan/constexpr.C
gcc/toplev.c