From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7636 invoked by alias); 10 Jul 2012 03:06:38 -0000 Received: (qmail 7626 invoked by uid 22791); 10 Jul 2012 03:06:36 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Jul 2012 03:06:23 +0000 From: "hp at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/53908] New: [4.7 Regression] csa removes needed memory load Date: Tue, 10 Jul 2012 03:06:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: hp 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-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-07/txt/msg00796.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53908 Bug #: 53908 Summary: [4.7 Regression] csa removes needed memory load Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassigned@gcc.gnu.org ReportedBy: hp@gcc.gnu.org Host: x86_64-linux Target: x86_64-linux-gnu, cris-axis-elf, crisv32-axis-linux-gnu Created attachment 27768 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27768 Repeat with e.g. cc1 -O2 ba2.c Observed with gcc-4_7-branch revision 189394. The attached test-case calls is_basic(user_name) < 0 && is_digest(user_name) < 0 with *user_name = NULL. The call to is_basic "fails"; returns < 0 without writing to *user_name. The call to is_digest is successful and furthermore writes *user_name (a char **). Next, *user_item = find_user(*user_name) is called, but the load of *user_name after the is_digest call is lost; wrongly eliminated in favor of the load after the call to is_basic. A dump shows wrong code first in the ".207r.csa" pass (for crisv32-axis-linux-gnu, likely for x86_64 as well). The test-case does not expose the bug on trunk r189401. Not observed with a gcc-4.3-based toolchain (cris-*), not observed with (host) "Debian 4.4.5-8". Unknown 4.5, 4.6.