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

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Dec 9 12:46:18 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242506

Gustavo Romero <gustavo.romero at protonmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gustavo.romero at protonmail.c
                   |                            |om

--- Comment #3 from Gustavo Romero <gustavo.romero at protonmail.com> ---
(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 <gromero at linux.vnet.ibm.com>
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.


More information about the freebsd-ppc mailing list