Page 1 of 1
VSI C x86-64 X7.4-843 .... LLVM ERROR: ... REX-prefixed instruction
Posted: Thu Nov 16, 2023 1:28 pm
by mgdaniel
Code: Select all
$ X86VMS$ cc/version
VSI C x86-64 X7.4-843 (GEM 50XB9) on OpenVMS x86_64 V9.2-1
$ CC /DECC /STAND=RELAXED_ANSI /PREFIX=ALL /NAMES=AS_IS /OPTIMIZE
/NODEBUG /WARNING=(NOINFORM,DISABLE=(PREOPTW)) /FLOAT=IEEE /IEEE=DENORM
/DEFINE=(WASD_VMS_V7,SESOLA,WATCH_CAT=1,WATCH_MOD=0,WASD_ACME=1,WASD_GETSPI=1)
/OBJ=[.obj_X86_64]Error Error.c
LLVM ERROR: Cannot encode high byte register in REX-prefixed instruction
Re: VSI C x86-64 X7.4-843 .... LLVM ERROR: ... REX-prefixed instruction
Posted: Thu Nov 16, 2023 4:37 pm
by jreagan
yeah, we saw it just a few days ago. Already fixed in our sources.
Can you try /NOOPT? It should avoid the bug.
Re: VSI C x86-64 X7.4-843 .... LLVM ERROR: ... REX-prefixed instruction
Posted: Thu Nov 16, 2023 5:05 pm
by mgdaniel
Indeed John. Should have noticed that myself.
Error.OBJ;1 76KB 17-NOV-2023 08:34:15.22
Will build the whole thing now and make sure it links.
*** it does ***
Re: VSI C x86-64 X7.4-843 .... LLVM ERROR: ... REX-prefixed instruction
Posted: Fri Nov 17, 2023 8:14 am
by imiller
I am also seeing
LLVM ERROR: Cannot encode high byte register in REX-prefixed instruction
when building my pwait_sda utility. Compiling sda_utils.c /NOOPT works around this issue.
I also noted I'm using varargs not stdarg and in the C compile release notes it's strongly recommended to use stdarg so I will have to look at that.
Re: VSI C x86-64 X7.4-843 .... LLVM ERROR: ... REX-prefixed instruction
Posted: Fri Nov 17, 2023 9:21 am
by arne_v
I believe stdargs.h has been the recommended way since 1989 (ANSI C).
Maybe it is time now.
Re: VSI C x86-64 X7.4-843 .... LLVM ERROR: ... REX-prefixed instruction
Posted: Fri Nov 17, 2023 9:38 am
by imiller
I started writing C around 1987 ... I guess I could try to update
Re: VSI C x86-64 X7.4-843 .... LLVM ERROR: ... REX-prefixed instruction
Posted: Fri Nov 17, 2023 9:50 am
by arne_v
VAX C 3.x was not ANSI C (and a horrible compiler).
VMS C became ANSI C with DEC C 4.0 early 90's. Not sure what year it was released. But 1992 with first VMS Alpha seems likely.
Re: VSI C x86-64 X7.4-843 .... LLVM ERROR: ... REX-prefixed instruction
Posted: Fri Nov 17, 2023 12:54 pm
by jreagan
On Alpha/Itanium, we support either stdarg or varargs. Linux does not. For x86, we didn't think we could do varargs given that LLVM is VERY MUCH biased to the stdarg model. However, I think we have much of varargs in place but we had to "be creative" in our description to LLVM. It isn't clear if the LLVM optimizer will trash our hack-around for varargs.