This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/33641] New: perlbmk gets type mismatch in pointer plus expression
- From: "janis at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Oct 2007 17:00:36 -0000
- Subject: [Bug middle-end/33641] New: perlbmk gets type mismatch in pointer plus expression
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Benchmark perlbmk from SPEC CPU2000 fails at runtime on powerpc64-linux with
several sets of optimization flags. When built with a compiler configured with
--enable-checks=all, file toke.c fails to build. The following minimized
testcase:
typedef enum { one, two } exp;
extern exp pe;
extern char pt[256];
void psd (void (*f) (void *), void *p);
static void rle (void *e) { }
void
foo (void)
{
psd ((void (*)(void *)) (rle), (void *) (pt + pe));
}
fails the same way, even with -O0, and also with an i686-linux cross compiler,
with:
bug6.c: In function ?foo?:
bug6.c:14: error: type mismatch in pointer plus expression
void *
char *
<unnamed type>
D.1249 = &pt + pe.0
Besides the obvious bug, it's annoying that the compiler doesn't report an ICE.
--
Summary: perlbmk gets type mismatch in pointer plus expression
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: janis at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33641