This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/53908] New: [4.7 Regression] csa removes needed memory load
- From: "hp at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 10 Jul 2012 03:06:21 +0000
- Subject: [Bug rtl-optimization/53908] New: [4.7 Regression] csa removes needed memory load
- Auto-submitted: auto-generated
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.