From patchwork Wed Jun 20 03:52:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PR49888,VTA] don't keep VALUEs bound to modified MEMs Date: Tue, 19 Jun 2012 17:52:12 -0000 From: Alexandre Oliva X-Patchwork-Id: 165872 Message-Id: To: "H.J. Lu" Cc: Richard Henderson , Jakub Jelinek , gcc-patches@gcc.gnu.org On Jun 16, 2012, "H.J. Lu" wrote: > If I understand it correctly, the new approach fails to handle push > properly. It's actually cselib that didn't deal with push properly, so it thinks incoming stack arguments may be clobbered by them. But that's not the whole story, unfortunately. I still don't have a complete fix for the problem, but I have some patches that restore nearly all of the passes. The first one extends RTX alias analysis so that cselib can recognize that (mem:SI ARGP) and (mem:SI (plus (and (plus ARGP #-4) #-32) #-4)) don't alias. Before the patch, we'd go for infinite sized objects upon AND. The second introduces an entry-point equivalence between ARGP and SP, so that SP references in push and stack-align sequences can be canonicalized to ARGP-based. The third introduces address canonicalization that uses information in the dataflow variable set in addition to the static cselib table. This is the one I'm still working on, because some expressions still fail to canonicalize to ARGP although they could. The fourth removes a now-redundant equivalence from the dynamic table; the required information is always preserved in the static table. I've regstrapped (and checked results! :-) all of these on x86_64-linux-gnu and i686-linux-gnu. It fixes all visible regressions in x86_64-linux-gnu, and nearly all on i686-linux-gnu. May I check these in and keep on working to complete the fix, or should I revert the original patch and come back only with a patchset that fixes all debug info regressions? for gcc/ChangeLog from Alexandre Oliva PR debug/53671 PR debug/49888 * var-tracking.c (vt_init_cfa_base): Drop redundant recording of CFA base. Index: gcc/var-tracking.c =================================================================== --- gcc/var-tracking.c.orig 2012-06-18 08:44:13.459569497 -0300 +++ gcc/var-tracking.c 2012-06-18 08:55:31.023984364 -0300 @@ -9582,9 +9582,6 @@ vt_init_cfa_base (void) VOIDmode, get_insns ()); preserve_value (val); cselib_preserve_cfa_base_value (val, REGNO (cfa_base_rtx)); - var_reg_decl_set (&VTI (ENTRY_BLOCK_PTR)->out, cfa_base_rtx, - VAR_INIT_STATUS_INITIALIZED, dv_from_value (val->val_rtx), - 0, NULL_RTX, INSERT); } /* Allocate and initialize the data structures for variable tracking