This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/32079] New: [4.2 Regression] there seems to be a gcc optimization problem.
- From: "liqin at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 May 2007 09:11:51 -0000
- Subject: [Bug c/32079] New: [4.2 Regression] there seems to be a gcc optimization problem.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
below c code will get "false" at -O0, -O1, -O3,
and get "true" at -O2, -Os.
#include <stdio.h>
typedef struct {
int aa;
int bb;
} test;
//test t1;
void foo (test **pp)
{
if (((*pp)->bb != 0) && (*pp))
printf ("true\n");
else
printf ("false\n");
printf ("finished.\n");
}
int main (void)
{
test *p;
p = NULL;
foo (&p);
return 0;
}
--
Summary: [4.2 Regression] there seems to be a gcc optimization
problem.
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: liqin at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: arm-elf
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32079