libgccjit: Clear pending_assemble_externals_processed
Checks
Commit Message
Hi.
This patch fixes the bug 113842.
I cannot yet add a test with this patch since it requires using
try/catch which is not yet merged in master.
Thanks for the review.
Comments
David: Ping.
On Thu, 2024-02-08 at 17:09 -0500, Antoni Boucher wrote:
> Hi.
> This patch fixes the bug 113842.
> I cannot yet add a test with this patch since it requires using
> try/catch which is not yet merged in master.
> Thanks for the review.
On Thu, 2024-02-08 at 17:09 -0500, Antoni Boucher wrote:
> Hi.
> This patch fixes the bug 113842.
> I cannot yet add a test with this patch since it requires using
> try/catch which is not yet merged in master.
> Thanks for the review.
Thanks; patch looks good for trunk, assuming you've tested it on a
target that defines ASM_OUTPUT_EXTERNAL.
Dave
It's OK to merge even though it touches files outside of the jit
directory and we're in stage 4?
Or do we need some kind of approval?
On Thu, 2024-02-15 at 10:35 -0500, David Malcolm wrote:
> On Thu, 2024-02-08 at 17:09 -0500, Antoni Boucher wrote:
> > Hi.
> > This patch fixes the bug 113842.
> > I cannot yet add a test with this patch since it requires using
> > try/catch which is not yet merged in master.
> > Thanks for the review.
>
> Thanks; patch looks good for trunk, assuming you've tested it on a
> target that defines ASM_OUTPUT_EXTERNAL.
>
> Dave
>
On Thu, 2024-02-15 at 14:14 -0500, Antoni Boucher wrote:
> It's OK to merge even though it touches files outside of the jit
> directory and we're in stage 4?
> Or do we need some kind of approval?
I think this patch is sufficiently low-risk that you can go ahead and
merge it.
Dave
>
> On Thu, 2024-02-15 at 10:35 -0500, David Malcolm wrote:
> > On Thu, 2024-02-08 at 17:09 -0500, Antoni Boucher wrote:
> > > Hi.
> > > This patch fixes the bug 113842.
> > > I cannot yet add a test with this patch since it requires using
> > > try/catch which is not yet merged in master.
> > > Thanks for the review.
> >
> > Thanks; patch looks good for trunk, assuming you've tested it on a
> > target that defines ASM_OUTPUT_EXTERNAL.
> >
> > Dave
> >
>
From 71f5f5fa8e68594454d5511b6d0c795bc6a8c37a Mon Sep 17 00:00:00 2001
From: Antoni Boucher <bouanto@zoho.com>
Date: Fri, 26 Jan 2024 11:31:47 -0500
Subject: [PATCH] libgccjit: Clear pending_assemble_externals_processed
Without this patch, code using exception handling will fail the
following assert in the function assemble_external_libcall in varasm.cc:
gcc_assert (!pending_assemble_externals_processed)
gcc/ChangeLog:
PR jit/113842
* toplev.cc (toplev::finalize): Call varasm_cc_finalize.
* varasm.cc (varasm_cc_finalize): New function to clear
pending_assemble_externals_processed.
* varasm.h (varasm_cc_finalize): New function.
---
gcc/toplev.cc | 1 +
gcc/varasm.cc | 8 ++++++++
gcc/varasm.h | 2 ++
3 files changed, 11 insertions(+)
@@ -2372,6 +2372,7 @@ toplev::finalize (void)
ira_costs_cc_finalize ();
tree_cc_finalize ();
reginfo_cc_finalize ();
+ varasm_cc_finalize ();
/* save_decoded_options uses opts_obstack, so these must
be cleaned up together. */
@@ -8661,4 +8661,12 @@ handle_vtv_comdat_section (section *sect, const_tree decl ATTRIBUTE_UNUSED)
switch_to_comdat_section(sect, DECL_NAME (decl));
}
+void
+varasm_cc_finalize (void)
+{
+#ifdef ASM_OUTPUT_EXTERNAL
+ pending_assemble_externals_processed = false;
+#endif
+}
+
#include "gt-varasm.h"
@@ -81,4 +81,6 @@ extern rtx assemble_trampoline_template (void);
extern void switch_to_comdat_section (section *, tree);
+extern void varasm_cc_finalize (void);
+
#endif // GCC_VARASM_H
--
2.43.0