Skip to content

invalid ARM assembly generated #155

@regehr

Description

@regehr

I have a CompCert for ARM compiled from the master branch on a Raspberry Pi 3 like this:

pi@raspberrypi:~/CompCert-origin $ ./configure arm-eabihf 
Testing assembler support for CFI directives... yes
Testing Coq... version 8.5pl2 -- good!
Testing OCaml... version 4.02.1 -- good!
Testing OCaml .opt compilers... yes
Testing Menhir... version 20161115 -- good!
Testing GNU make... version 4.1 (command 'make') -- good!

CompCert configuration:
    Target architecture........... arm
    Hardware model................ armv7a
    Application binary interface.. hardfloat
    Endianness.................... little
    Composite passing conventions. arguments: ints, return values: int1-4
    OS and development env........ linux
    C compiler.................... gcc
    C preprocessor................ gcc
    Assembler..................... gcc
    Assembler supports CFI........ true
    Assembler for runtime lib..... gcc -c
    Linker........................ gcc
    Math library.................. -lm
    Binaries installed in......... /usr/local/bin
    Runtime library provided...... true
    Library files installed in.... /usr/local/lib/compcert
    Standard headers provided..... true
    Standard headers installed in. /usr/local/lib/compcert/include
    Build command to use.......... make

It is creating code that bombs the assembler like this:

pi@raspberrypi:~/reduce $ ~/CompCert-origin/ccomp foo.c
/tmp/compcert4ba6cf.s: Assembler messages:
/tmp/compcert4ba6cf.s:35: Error: co-processor offset out of range
Error: assembler command failed with exit code 1 (use -v to see invocation)
pi@raspberrypi:~/reduce $ cat foo.c
void ca(void);
void cb(int,int,int);
int cc(int,int,int,int);

int c;
int d;
int e;
int f;
int g;
int h;
int i;
int j;
int k;
int l;
int m;
int n;
int o;
int p;
int q;
float aa;
enum {
  r = 127,
  s,
  t,
  u,
  v,
  w,
  x,
  y,
  b,
  ab,
  ac,
  ad,
  ae,
  af,
  ag,
  ah,
  ai,
  aj,
  ak,
  al,
  am,
  an,
  ao,
  ap,
  aq,
  ar,
  as,
  at,
  au,
  av,
  aw,
  ax,
  ay,
  az,
  ba,
  bb,
  bc,
  bd,
  be,
  bf,
  bg,
  bh,
  bi,
  bj,
  bk,
  bl,
  bm,
  bn,
  bo,
  bp,
  bq,
  br,
  bs,
  bt,
  bu,
  bv,
  bw,
  bx,
  by,
  a,
  bz
} z() {
  aa = 0.0;
  c = 0;
  d = 0;
  i = 1;
  j = 1;
  k = 1;
  l = 1;
  m = 1;
  n = 1;
  o = 1;
  p = 1;
  e = 1;
  f = 0;
  g = 0;
  h = 0;
  ca();
  cb(f, q, aa);
  if (cc(e, d, c, 0))
    switch (f)
    case 'T':
    case 't':
    case 'a':
    case 1:
    case 'l':
    case 'b':
    case 'r':
    case 'S':
    case 'w':
    case 'm':
    case 'd':
    case 'D':
    case 'H':
    case 'E':
    case 'B':
    case 'F':
    case 'K':
    case 'L':
    case 'o':
    case 'O':
    case ab:
    case ac:
    case ad:
    case ae:
    case at:
    case ax:
    case ay:
    case a:
    case am:
    case b:
    case bb:
    case bc:
    case bd:
    case bf:
    case bg:
    case bh:
    case bi:
    case bj:
    case bk:
    case bl:
    case bm:
    case bp:
    case bq:
    case br:
    case bz:
    case 'v':
    case 'h':
    case be:
    case '?':;
}

Any help appreciated. This affects compilation of one of the program in SPEC CPU 2006. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions