From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107393 invoked by alias); 10 Jun 2015 00:49:14 -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 107353 invoked by uid 48); 10 Jun 2015 00:49:10 -0000 From: "bernhard.kaindl at thalesgroup dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/48181] [4.8/4.9 Regression] wrong code with -O -fgcse --param ira-max-conflict-table-size=0 Date: Wed, 10 Jun 2015 00:49:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 4.7.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: bernhard.kaindl at thalesgroup dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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-06/txt/msg00875.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48181 Bernhard Kaindl changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bernhard.kaindl@thalesgroup | |.com --- Comment #11 from Bernhard Kaindl --- Checked what Steven Bosscher said in comment #5 and what I understood from Comment 6 that LRA fixed this issue: > FWIW I can't reproduce the problem with trunk. I see rcx being saved > and restored around the calls, e.g.: > > movq %rcx, (%rsp) > call bar > movq (%rsp), %rcx > > and likewise around the second memcpy. Unfortunately (an old) valgrind > on gcc17 doesn't work with with "valgrind -q ./a.out" as in comment #0. > http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192719 > fixed this (so, most likely reproduceable by disabling LRA). Indeed, gcc-4.8.4 and gcc-4.9.2 save and restore rcx as described, valgrind-3.10.1 (current release) does not show an error, and program does not crash at all. So affected are only gcc-4.5, 4.6 and 4.7, and only with --param ira-max-conflict-table-size=0 & -fgcse active.