This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/33641] New: perlbmk gets type mismatch in pointer plus expression


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]