From f1176d9edc35ded39bd48e5bea342c5aeec1b2ac Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 16 Jan 2018 12:49:29 +0000 Subject: [PATCH] i386: Don't use reference of struct ix86_frame Use reference of struct ix86_frame in ix86_expand_prologue and ix86_expand_epilogue caused: raised STORAGE_ERROR : stack overflow or erroneous memory access make[5]: *** [/export/gnu/import/git/sources/gcc/gcc/ada/Make-generated.in:45: ada/sinfo.h] Error 1 on trunk when bootstrapping GCC with ada on x86-64. * config/i386/i386.c (ix86_expand_prologue): Don't use reference of struct ix86_frame. (ix86_expand_epilogue): Likewise. From-SVN: r256742 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/i386/i386.c | 6 ++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1ef52541038..8de7e8cf188 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-01-16 H.J. Lu + + * config/i386/i386.c (ix86_expand_prologue): Don't use reference + of struct ix86_frame. + (ix86_expand_epilogue): Likewise. + 2018-01-16 H.J. Lu Backport from mainline @@ -214,6 +220,8 @@ 2018-01-15 H.J. Lu Backport from mainline + 2017-11-06 H.J. Lu + * config/i386/i386.c (ix86_can_use_return_insn_p): Use reference of struct ix86_frame. (ix86_initial_elimination_offset): Likewise. @@ -222,6 +230,8 @@ 2018-01-15 H.J. Lu Backport from mainline + 2017-06-01 Bernd Edlinger + * config/i386/i386.c (ix86_frame): Moved to ... * config/i386/i386.h (ix86_frame): Here. (machine_function): Add frame. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index e758387dacd..ba2abc53ed1 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -14061,6 +14061,7 @@ ix86_expand_prologue (void) { struct machine_function *m = cfun->machine; rtx insn, t; + struct ix86_frame frame; HOST_WIDE_INT allocate; bool int_registers_saved; bool sse_registers_saved; @@ -14084,7 +14085,7 @@ ix86_expand_prologue (void) m->fs.sp_valid = true; ix86_compute_frame_layout (); - struct ix86_frame &frame = cfun->machine->frame; + frame = m->frame; if (!TARGET_64BIT && ix86_function_ms_hook_prologue (current_function_decl)) { @@ -14747,12 +14748,13 @@ ix86_expand_epilogue (int style) { struct machine_function *m = cfun->machine; struct machine_frame_state frame_state_save = m->fs; + struct ix86_frame frame; bool restore_regs_via_mov; bool using_drap; ix86_finalize_stack_realign_flags (); ix86_compute_frame_layout (); - struct ix86_frame &frame = cfun->machine->frame; + frame = m->frame; m->fs.sp_valid = (!frame_pointer_needed || (crtl->sp_is_unchanging