From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 803 invoked by alias); 26 Apr 2015 09:26:22 -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 777 invoked by uid 48); 26 Apr 2015 09:26:17 -0000 From: "vries at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/65824] [6 Regression] execution failures for stdarg/va-arg testcases for aarch64 Date: Sun, 26 Apr 2015 09:26: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: 6.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: vries at gcc dot gnu.org X-Bugzilla-Target-Milestone: 6.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: 2015-04/txt/msg02214.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65824 --- Comment #2 from vries at gcc dot gnu.org --- minimal version of stdarg-1.c, returns 14 if correct, but 12 for current failure, indicating that the the first and resultless va_arg has been ignored: ... include extern void exit (int); int f6 (int i, ...) { int res; va_list ap; va_start (ap, i); va_arg (ap, long); res = va_arg (ap, long); va_end (ap); return res; } int main (void) { int res = f6 (7, 12L, 14L); exit (res); } ... The expression returned by gimpify_va_arg_internal is: ... (gdb) call debug_generic_expr ($1) *D.2689 >= 0 ? ap.__stack = (void *) ((long int) D.2690 + 15 & -8);, (long int *) D.2690; : ap.__gr_offs = D.2689 + 8;, ap.__gr_offs > 0 ? ap.__stack = (void *) ((long int) D.2690 + 15 & -8);, (long int *) D.2690; : (long int *) ap.__gr_top + (sizetype) D.2689; ... Indeed, not side-effect free. This is most likely a duplicate of PR65818.