From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7907 invoked by alias); 19 Dec 2013 18:39:19 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 7865 invoked by uid 48); 19 Dec 2013 18:39:16 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/59501] [4.9 Regression] Vector Gather with GCC 4.9 2013-12-08 Snapshot Date: Thu, 19 Dec 2013 18:39:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-12/txt/msg01879.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59501 --- Comment #3 from Jakub Jelinek --- (In reply to H.J. Lu from comment #2) > (In reply to Jakub Jelinek from comment #1) > > > > if (ix86_force_drap || !ACCUMULATE_OUTGOING_ARGS) > > crtl->need_drap = true; > > They are needed for -m32. Otherwise, we got > > FAIL: g++.dg/torture/stackalign/eh-fastcall-1.C -Os -fpic execution test > FAIL: g++.dg/torture/stackalign/eh-global-1.C -Os -fpic execution test > FAIL: g++.dg/torture/stackalign/eh-inline-1.C -Os -fpic execution test > FAIL: g++.dg/torture/stackalign/eh-thiscall-1.C -Os -fpic execution test I'm not saying that ix86_get_drap_rtx should be changed. But perhaps: /* If the only reason for frame_pointer_needed is that we conservatively assumed stack realignment might be needed, but in the end nothing that needed the stack alignment had been spilled, clear frame_pointer_needed and say we don't need stack realignment. */ if (stack_realign && !crtl->need_drap && frame_pointer_needed && crtl->is_leaf && flag_omit_frame_pointer && crtl->sp_is_unchanging && !ix86_current_function_calls_tls_descriptor && !crtl->accesses_prior_frames && !cfun->calls_alloca && !crtl->calls_eh_return && !(flag_stack_check && STACK_CHECK_MOVING_SP) && !ix86_frame_pointer_required () && get_frame_size () == 0 && ix86_nsaved_sseregs () == 0 && ix86_varargs_gpr_size + ix86_varargs_fpr_size == 0) in ix86_finalize_stack_realign_flags could be tweaked, not to bail out always if we have !crtl->need_drap, because then it will be set pretty much for all leaf functions. I wonder if we can e.g. ask DF whether the drap reg is live at entry, if it isn't live, supposedly we can clear crtl->need_drap or ignore it for this purpose? Also, I wonder even if we actually need the drap register we can't for the leaf functions just avoid the dynamic realignment and simply let the prologue set the drap reg to the right value.