public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH]: Restore bootstrap with gcc < 4.3
@ 2016-06-13  9:23 Uros Bizjak
  2016-06-13  9:55 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Uros Bizjak @ 2016-06-13  9:23 UTC (permalink / raw)
  To: gcc-patches; +Cc: David Malcolm

Hello!

The new test finalization self tests fail wigh gcc < 4.3 due to the
way need_finalization_p is defined:

template<typename T>
static inline bool
need_finalization_p ()
{
#if GCC_VERSION >= 4003
  return !__has_trivial_destructor (T);
#else
  return true;
#endif
}

It is obvious that checking for

   ASSERT_FALSE (need_finalization_p <test_struct> ());

will always fail. Checking need_finalization_p is meaningless with gcc < 4.3.

2016-06-13  Uros Bizjak  <ubizjak@gmail.com>

    * ggc-tests.c (test_finalization): Only test need_finalization_p
    for GCC_VERSION >= 4003.

Bootstrapped on x86_64-linux-gnu, CentOS 5.11.

OK for mainline?

Uros.

diff --git a/gcc/ggc-tests.c b/gcc/ggc-tests.c
index 48eac03..7f97231 100644
--- a/gcc/ggc-tests.c
+++ b/gcc/ggc-tests.c
@@ -190,8 +190,10 @@ int test_struct_with_dtor::dtor_call_count;
 static void
 test_finalization ()
 {
+#if GCC_VERSION >= 4003
   ASSERT_FALSE (need_finalization_p <test_struct> ());
   ASSERT_TRUE (need_finalization_p <test_struct_with_dtor> ());
+#endif

   /* Create some garbage.  */
   const int count = 10;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-13  9:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-13  9:23 [PATCH]: Restore bootstrap with gcc < 4.3 Uros Bizjak
2016-06-13  9:55 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).