This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR bootstrap/78493


Hello.

As described in the PR, the patch fixes profiled bootstrap on x86_64-linux-gnu.

Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. And
profiled bootstrap on x86_64-linux-gnu finishes successfully.

Ready to be installed?
Martin
>From 8b7cd9a83cd14f7a15f39e105ccd78e143ec84f2 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Wed, 23 Nov 2016 14:08:52 +0100
Subject: [PATCH] Fix PR bootstrap/78493

gcc/ChangeLog:

2016-11-23  Martin Liska  <mliska@suse.cz>

	PR bootstrap/78493
	* vec.h (~auto_vec): Do va_heap::release just if
	this->m_vec == &m_auto.  That would help compiler not to
	trigger -Werror=free-nonheap-object.
---
 gcc/vec.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gcc/vec.h b/gcc/vec.h
index 14fb2a6..d2d253b 100644
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -1272,7 +1272,14 @@ public:
 
   ~auto_vec ()
   {
-    this->release ();
+    if (this->m_vec == &m_auto)
+      {
+	gcc_checking_assert (this->using_auto_storage ());
+	this->m_vec->m_vecpfx.m_num = 0;
+	return;
+      }
+
+    va_heap::release (this->m_vec);
   }
 
 private:
-- 
2.10.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]