]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/doc/gccint/analysis-and-optimization-of-gimple-tuples/memory-model.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / doc / gccint / analysis-and-optimization-of-gimple-tuples / memory-model.rst
1 ..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6 .. index:: memory model
7
8 .. _memory-model:
9
10 Memory model
11 ************
12
13 The memory model used by the middle-end models that of the C/C++
14 languages. The middle-end has the notion of an effective type
15 of a memory region which is used for type-based alias analysis.
16
17 The following is a refinement of ISO C99 6.5/6, clarifying the block copy case
18 to follow common sense and extending the concept of a dynamic effective
19 type to objects with a declared type as required for C++.
20
21 ::
22
23 The effective type of an object for an access to its stored value is
24 the declared type of the object or the effective type determined by
25 a previous store to it. If a value is stored into an object through
26 an lvalue having a type that is not a character type, then the
27 type of the lvalue becomes the effective type of the object for that
28 access and for subsequent accesses that do not modify the stored value.
29 If a value is copied into an object using memcpy or memmove,
30 or is copied as an array of character type, then the effective type
31 of the modified object for that access and for subsequent accesses that
32 do not modify the value is undetermined. For all other accesses to an
33 object, the effective type of the object is simply the type of the
34 lvalue used for the access.