From ca72dad54a775cbcf4be545feb1f5575e064387a Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 23 Jan 2015 15:57:42 +0000 Subject: [PATCH] PR jit/64722: fix corruption of %ebx on 32-bit i386 with libgccjit gcc/ChangeLog: PR jit/64722 * emit-rtl.c (init_emit_regs): Set pic_offset_table_rtx to NULL_RTX before testing PIC_OFFSET_TABLE_REGNUM, since the latter may be affected by the former (e.g. on i686). From-SVN: r220044 --- gcc/ChangeLog | 7 +++++++ gcc/emit-rtl.c | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2b53eed1955..2a47ca2cecf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-01-23 David Malcolm + + PR jit/64722 + * emit-rtl.c (init_emit_regs): Set pic_offset_table_rtx to + NULL_RTX before testing PIC_OFFSET_TABLE_REGNUM, since the + latter may be affected by the former (e.g. on i686). + 2015-01-23 Martin Liska * tree.h (tree_vec_elt_check): Workaround -Wstrict-overflow diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index df85366c5d6..483eacb2d6c 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -5872,10 +5872,9 @@ init_emit_regs (void) = gen_raw_REG (Pmode, RETURN_ADDRESS_POINTER_REGNUM); #endif + pic_offset_table_rtx = NULL_RTX; if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM) pic_offset_table_rtx = gen_raw_REG (Pmode, PIC_OFFSET_TABLE_REGNUM); - else - pic_offset_table_rtx = NULL_RTX; for (i = 0; i < (int) MAX_MACHINE_MODE; i++) { -- 2.30.2