This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/24142] New: VRP miscompiles unzip inflate.c
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Sep 2005 09:58:05 -0000
- Subject: [Bug tree-optimization/24142] New: VRP miscompiles unzip inflate.c
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
For the following testcase reduced from inflate.c
int bar(void);
int foobar(void);
static unsigned dbits = 6;
int foo(void)
{
int retval;
unsigned bd;
unsigned nl;
bd = dbits;
retval = bar();
if (retval == 1)
retval = 0;
if (bd == 0 && nl > 257)
retval = 1;
if (retval)
return retval;
return foobar();
}
VRP removes the call to foobar() because it thinks it can fold the
last comparison:
Folding predicate retval_2 != 0 to 1
--
Summary: VRP miscompiles unzip inflate.c
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rguenth at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
OtherBugsDependingO 23968
nThis:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24142