summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErick Ochoa <erick.ochoa@theobroma-systems.com>2020-05-20 15:10:13 +0200
committerErick Ochoa <erick.ochoa@theobroma-systems.com>2020-05-20 15:10:13 +0200
commitbadf96c3edd465c4041843488c9ce997422e3791 (patch)
tree98bc5698edf1b080c39a880c7aea0536feeb177b
parent34142e041aec8e6414663d549340a7f5ab619893 (diff)
wip
-rwxr-xr-xbuild.sh2
-rw-r--r--gcc/collect-types.c16
-rw-r--r--gcc/testsuite/gcc.dg/ipa/type-playground-00.c2
3 files changed, 12 insertions, 8 deletions
diff --git a/build.sh b/build.sh
index f1ebba3e23c..4b28c2293cc 100755
--- a/build.sh
+++ b/build.sh
@@ -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" } } */