From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18730 invoked by alias); 8 Jan 2015 16:06:08 -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 18700 invoked by uid 48); 8 Jan 2015 16:06:04 -0000 From: "skvadrik at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/64541] New: .fre1 pass optimization failure Date: Thu, 08 Jan 2015 16:06: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: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: skvadrik at gmail dot com 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 attachments.created 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-01/txt/msg00485.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64541 Bug ID: 64541 Summary: .fre1 pass optimization failure Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: skvadrik at gmail dot com Created attachment 34403 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34403&action=edit 1.c 2.c 1.c.028t.esra 2.c.028t.esra 1.c.030t.fre1 2.c.030t.fre1 1.s 2.s compile_gcc.sh Files 1.c and 2.c in attach are equivalent from C/C++ standpoint: $ diff 1.c 2.c 3c3,5 < return *(*q = ++*p); --- > ++*p; > *q = *p; > return **p; Compiled with gcc-5.0.0, disassembled with objdump (GNU Binutils) 2.24 (see full script compile_gcc.sh in attach). For 1.c gcc generates better code than for 2.c (compare 1.s vs 2.s in attach). I looked at GIMPLE optimization dumps (-fdump-tree-all) and found that up to *.029t.ealias pass dumps differ insignificantly (attached *.028t.esra dumps as they are shorter), but .030t.fre1 pass fails to reduce intermediate variable '_9' in the second case (attached *.030t.fre dumps). Looks like a bug in full redundancy elimination.