[Bug 242506] [PowerPC] lang/gcc9: cc1: internal compiler error: Segmentation fault (on FreeBSD 12.1-RELEASE-p1)

[email protected]
Newsgroups gmane.os.freebsd.devel.ppc
Message-ID <[email protected]/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242506

Gustavo Romero <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]
                   |                            |om

--- Comment #3 from Gustavo Romero <[email protected]> ---
(In reply to canardo from comment #0)

Hello, canardo,

This is a segfault in gcc9 selftest framework due to a wrong use o singleton
dump_context get() method.

This is the fix I intend to send upstream for review:

commit e02cbe3668cc63c8da1fed404c306c1ed50235f3
Author: Gustavo Romero <[email protected]>
Date:   Mon Dec 9 07:37:49 2019 -0500

    devel/gcc9: Fix ICE due to wrong singleton get() use

    Currently get() method of singleton is being used in a way a new class is
    instantiated, which call singleton dtor's freeing memory that is referenced
    after free() is called generating an internal compiler error.

    Fix is simply call get() appropriately, i.e. call it directly since it's in
    fact an static method, just as usually any get method in a singleton is by
    design.

diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c
index 7ea8f85..fc17fe9 100644
--- a/gcc/dumpfile.c
+++ b/gcc/dumpfile.c
@@ -2076,7 +2076,7 @@ temp_dump_context::temp_dump_context (bool
forcibly_enable_optinfo,
                                      bool forcibly_enable_dumping,
                                      dump_flags_t test_pp_flags)
 : m_context (),
-  m_saved (&dump_context ().get ())
+  m_saved(&dump_context::get())
 {
   dump_context::s_current = &m_context;
   if (forcibly_enable_optinfo)


Could you please try and check if it fixes the error you've posted?

Thanks.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ppc
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.