diff options
author | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-05-20 15:10:13 +0200 |
---|---|---|
committer | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-06-03 16:05:58 +0200 |
commit | 7b0dc9de3925702de2ca7a8e4a3b1005db698ca0 (patch) | |
tree | 4e43ab5572739156a509d0a27bd8cc5a359d0638 | |
parent | 2cac852f744bd842494da077cd03412589241f64 (diff) |
wip
-rwxr-xr-x | build.sh | 2 | ||||
-rw-r--r-- | gcc/collect-types.c | 16 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/type-playground-00.c | 2 |
3 files changed, 12 insertions, 8 deletions
@@ -10,6 +10,6 @@ pushd $HOME/code/gcc-build${suffix}/ $OLDPWD/configure --disable-bootstrap --disable-libsanitizer --enable-__cxa_atexit --enable-shared --disable-libsanitizer --enable-languages=c,c++,fortran --enable-lto --enable-gold --enable-linker-build-id --with-cpu-emag --prefix="$HOME/code/gcc-inst${suffix}/" make -j `nproc` make install -j `nproc` -make check-gcc RUNTESTFLAGS="ipa.exp" +./$HOME/code/${OLDPWD}/test.sh popd diff --git a/gcc/collect-types.c b/gcc/collect-types.c index 200e5f16e98..894a755cd5f 100644 --- a/gcc/collect-types.c +++ b/gcc/collect-types.c @@ -225,6 +225,7 @@ collect_types_from_record_or_union_type(const_tree type, ptrset_t &types) const bool is_qual_union = QUAL_UNION_TYPE == code; const bool is_valid_input = is_record || is_union || is_qual_union; gcc_assert(is_valid_input); + assert_is_complete(type); for (tree field = TYPE_FIELDS(type) ; field ; field = DECL_CHAIN(field)) { @@ -237,14 +238,14 @@ collect_types_from_record_or_union_type(const_tree type, ptrset_t &types) static void collect_types_from_record_type(const_tree type, ptrset_t &types) { - assert_is_type(type, RECORD_TYPE); + assert_is_complete_type(type, RECORD_TYPE); collect_types_from_record_or_union_type(type, types); } static void collect_types_from_union_type(const_tree type, ptrset_t &types) { - assert_is_type(type, UNION_TYPE); + assert_is_complete_type(type, UNION_TYPE); collect_types_from_record_or_union_type(type, types); } @@ -252,6 +253,7 @@ static void collect_types_from_wrapper_type(const_tree type, ptrset_t &types) { gcc_assert(type); + assert_is_complete(type); const_tree inner_type = TREE_TYPE(type); gcc_assert(inner_type); collect_types(inner_type, types); @@ -261,20 +263,21 @@ static void collect_types_from_pointer_type(const_tree type, ptrset_t &types) { assert_is_type(type, POINTER_TYPE); + assert_is_complete(type); collect_types_from_wrapper_type(type, types); } static void collect_types_from_reference_type(const_tree type, ptrset_t &types) { - assert_is_type(type, REFERENCE_TYPE); + assert_is_complete_type(type, REFERENCE_TYPE); collect_types_from_wrapper_type(type, types); } static void collect_types_from_array_type(const_tree type, ptrset_t &types) { - assert_is_type(type, ARRAY_TYPE); + assert_is_complete_type(type, ARRAY_TYPE); collect_types_from_wrapper_type(type, types); } @@ -282,6 +285,7 @@ static void collect_types_from_function_or_method_type(const_tree type, ptrset_t &types) { gcc_assert(type); + assert_is_complete(type); const enum tree_code code = TREE_CODE(type); const bool is_function = FUNCTION_TYPE == code; const bool is_method = METHOD_TYPE == code; @@ -305,14 +309,14 @@ collect_types_from_function_or_method_type(const_tree type, ptrset_t &types) static void collect_types_from_function_type(const_tree type, ptrset_t &types) { - assert_is_type(type, FUNCTION_TYPE); + assert_is_complete_type(type, FUNCTION_TYPE); collect_types_from_function_or_method_type(type, types); } static void collect_types_from_method_type(const_tree type, ptrset_t &types) { - assert_is_type(type, METHOD_TYPE); + assert_is_complete_type(type, METHOD_TYPE); collect_types_from_function_or_method_type(type, types); } diff --git a/gcc/testsuite/gcc.dg/ipa/type-playground-00.c b/gcc/testsuite/gcc.dg/ipa/type-playground-00.c index 8a38de1dbfb..b94c4c0d643 100644 --- a/gcc/testsuite/gcc.dg/ipa/type-playground-00.c +++ b/gcc/testsuite/gcc.dg/ipa/type-playground-00.c @@ -17,5 +17,5 @@ main () // evaluates to false -/* { dg-final { scan-wpa-ipa-dump "0,32:integer_type x 0,32:integer_type = t," "type-collector" } } */ +/* { dg-final { scan-wpa-ipa-dump "0,32:integer_type x 0,32:integer_type = f," "hello-world" } } */ |