aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2008-05-01 20:13:56 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2008-05-01 20:13:56 +0000
commitb5487346841fcd5a5834e458c8504d1febc1a46f (patch)
tree9828a8380bd06a56ecc335ce3c88debf94b1c748 /gcc/tree.h
parent32d99e6869ec4eb0d8f801893d2ea499f9951f71 (diff)
downloadgcc-b5487346841fcd5a5834e458c8504d1febc1a46f.zip
gcc-b5487346841fcd5a5834e458c8504d1febc1a46f.tar.gz
gcc-b5487346841fcd5a5834e458c8504d1febc1a46f.tar.bz2
tree.h (TYPE_NONALIASED_COMPONENT): Expand comment.
* tree.h (TYPE_NONALIASED_COMPONENT): Expand comment. (DECL_NONADDRESSABLE_P): Likewise. * alias.c (record_component_aliases): Fix comment. From-SVN: r134868
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index c63ee94..d52c760 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2264,8 +2264,9 @@ struct tree_block GTY(())
#define TYPE_TRANSPARENT_UNION(NODE) \
(UNION_TYPE_CHECK (NODE)->type.transparent_union_flag)
-/* For an ARRAY_TYPE, indicates that it is not permitted to
- take the address of a component of the type. */
+/* For an ARRAY_TYPE, indicates that it is not permitted to take the
+ address of a component of the type. This is the counterpart of
+ DECL_NONADDRESSABLE_P for arrays, see the definition of this flag. */
#define TYPE_NONALIASED_COMPONENT(NODE) \
(ARRAY_TYPE_CHECK (NODE)->type.transparent_union_flag)
@@ -2896,7 +2897,20 @@ struct tree_decl_with_rtl GTY(())
#define DECL_BIT_FIELD(NODE) (FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_2)
/* Used in a FIELD_DECL to indicate that we cannot form the address of
- this component. */
+ this component. This makes it possible for Type-Based Alias Analysis
+ to disambiguate accesses to this field with indirect accesses using
+ the field's type:
+
+ struct S { int i; } s;
+ int *p;
+
+ If the flag is set on 'i', TBAA computes that s.i and *p never conflict.
+
+ From the implementation's viewpoint, the alias set of the type of the
+ field 'i' (int) will not be recorded as a subset of that of the type of
+ 's' (struct S) in record_component_aliases. The counterpart is that
+ accesses to s.i must not be given the alias set of the type of 'i'
+ (int) but instead directly that of the type of 's' (struct S). */
#define DECL_NONADDRESSABLE_P(NODE) \
(FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_3)