diff mbox

[1/5] Disable lang_hooks.gimplify_expr in free_lang_data

Message ID 54E5BFD9.9010305@mentor.com
State New
Headers show

Commit Message

Tom de Vries Feb. 19, 2015, 10:50 a.m. UTC
On 19-02-15 11:29, Tom de Vries wrote:
> Hi,
>
> I'm posting this patch series for stage1:
> - 0001-Disable-lang_hooks.gimplify_expr-in-free_lang_data.patch
> - 0002-Add-gimple_find_sub_bbs.patch
> - 0003-Factor-optimize_va_list_gpr_fpr_size-out-of-pass_std.patch
> - 0004-Handle-internal_fn-in-operand_equal_p.patch
> - 0005-Postpone-expanding-va_arg-until-pass_stdarg.patch
>
> The patch series - based on Michael's initial patch - postpones expanding va_arg
> until pass_stdarg, which makes pass_stdarg more robust.
>
> Bootstrapped and reg-tested on x86_64 using all languages, with unix/ and
> unix/-m32 testing.
>
> I'll post the patches in reply to this email.
>

This patch disables lang_hooks.gimplify_expr in free_lang_data.

I ran into a situation ( mentioned here: 
https://gcc.gnu.org/ml/gcc/2015-02/msg00074.html ) where gimplify_expr was 
called during pass_stdarg, which called cp_gimplify_expr, which called 
is_really_empty_class, which tried to access some language data (TYPE_BINFO) 
that was already freed, which caused a segmentation fault. This patch fixes that.

OK for stage1?

Thanks,
- Tom

Comments

Richard Biener Feb. 19, 2015, 12:38 p.m. UTC | #1
On Thu, 19 Feb 2015, Tom de Vries wrote:

> On 19-02-15 11:29, Tom de Vries wrote:
> > Hi,
> > 
> > I'm posting this patch series for stage1:
> > - 0001-Disable-lang_hooks.gimplify_expr-in-free_lang_data.patch
> > - 0002-Add-gimple_find_sub_bbs.patch
> > - 0003-Factor-optimize_va_list_gpr_fpr_size-out-of-pass_std.patch
> > - 0004-Handle-internal_fn-in-operand_equal_p.patch
> > - 0005-Postpone-expanding-va_arg-until-pass_stdarg.patch
> > 
> > The patch series - based on Michael's initial patch - postpones expanding
> > va_arg
> > until pass_stdarg, which makes pass_stdarg more robust.
> > 
> > Bootstrapped and reg-tested on x86_64 using all languages, with unix/ and
> > unix/-m32 testing.
> > 
> > I'll post the patches in reply to this email.
> > 
> 
> This patch disables lang_hooks.gimplify_expr in free_lang_data.
> 
> I ran into a situation ( mentioned here:
> https://gcc.gnu.org/ml/gcc/2015-02/msg00074.html ) where gimplify_expr was
> called during pass_stdarg, which called cp_gimplify_expr, which called
> is_really_empty_class, which tried to access some language data (TYPE_BINFO)
> that was already freed, which caused a segmentation fault. This patch fixes
> that.
> 
> OK for stage1?

Ok.

Thanks,
Richard.
diff mbox

Patch

2015-02-17  Tom de Vries  <tom@codesourcery.com>

	* tree.c (free_lang_data): Disable lang_hooks.gimplify_expr.
---
 gcc/tree.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/tree.c b/gcc/tree.c
index 29f70f8..94b7c56 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -5815,6 +5815,8 @@  free_lang_data (void)
      still be used indirectly via the get_alias_set langhook.  */
   lang_hooks.dwarf_name = lhd_dwarf_name;
   lang_hooks.decl_printable_name = gimple_decl_printable_name;
+  lang_hooks.gimplify_expr = lhd_gimplify_expr;
+
   /* We do not want the default decl_assembler_name implementation,
      rather if we have fixed everything we want a wrapper around it
      asserting that all non-local symbols already got their assembler
-- 
1.9.1