From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9222 invoked by alias); 25 Apr 2015 14:46:02 -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 9199 invoked by uid 48); 25 Apr 2015 14:45:58 -0000 From: "vries at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/65887] New: remove va_arg ap copies Date: Sat, 25 Apr 2015 14:46:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: 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: 2015-04/txt/msg02179.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65887 Bug ID: 65887 Summary: remove va_arg ap copies Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: vries at gcc dot gnu.org [ Discussed here: https://gcc.gnu.org/ml/gcc-patches/2015-04/msg01262.html ] When compiling gcc.target/x86_64/abi/callabi/vaarg-6.c, at original we have: ... ;; Function do_cpy2 (null) { char * e; char * e; e = VA_ARG_EXPR ; e = VA_ARG_EXPR ; if (e != b) { abort (); } } ... and after gimplify we have: ... do_cpy2 (char * argp) { char * argp.1; char * argp.2; char * b.3; char * e; argp.1 = argp; e = VA_ARG (&argp.1, 0B); argp = argp.1; argp.2 = argp; e = VA_ARG (&argp.2, 0B); argp = argp.2; b.3 = b; if (e != b.3) goto ; else goto ; : abort (); : } ... We'd like to generate: ... e = VA_ARG (&argp, 0B); ... instead of: ... argp.1 = argp; e = VA_ARG (&argp.1, 0B); argp = argp.1; ... The code generating the copyback 'argp = argp.1' is in gimplify_modify_expr.