VSI C x86-64 X7.4-843 .... LLVM ERROR: ... REX-prefixed instruction

Post Reply

Topic author
mgdaniel
Valued Contributor
Posts: 62
Joined: Mon Feb 28, 2022 5:16 pm
Reputation: 0
Location: Adelaide, South Australia
Status: Offline
Contact:

VSI C x86-64 X7.4-843 .... LLVM ERROR: ... REX-prefixed instruction

Post by mgdaniel » Thu Nov 16, 2023 1:28 pm

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


jreagan
VSI Expert
Master
Posts: 139
Joined: Tue Dec 01, 2020 8:40 am
Reputation: 0
Status: Offline

Re: VSI C x86-64 X7.4-843 .... LLVM ERROR: ... REX-prefixed instruction

Post by jreagan » Thu Nov 16, 2023 4:37 pm

yeah, we saw it just a few days ago. Already fixed in our sources.

Can you try /NOOPT? It should avoid the bug.


Topic author
mgdaniel
Valued Contributor
Posts: 62
Joined: Mon Feb 28, 2022 5:16 pm
Reputation: 0
Location: Adelaide, South Australia
Status: Offline
Contact:

Re: VSI C x86-64 X7.4-843 .... LLVM ERROR: ... REX-prefixed instruction

Post by mgdaniel » Thu Nov 16, 2023 5:05 pm

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 ***
Last edited by mgdaniel on Thu Nov 16, 2023 5:19 pm, edited 1 time in total.

User avatar

imiller
Master
Posts: 147
Joined: Fri Jun 28, 2019 8:45 am
Reputation: 0
Location: South Tyneside, UK
Status: Offline
Contact:

Re: VSI C x86-64 X7.4-843 .... LLVM ERROR: ... REX-prefixed instruction

Post by imiller » Fri Nov 17, 2023 8:14 am

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.
Ian Miller
[ personal opinion only. usual disclaimers apply. Do not taunt happy fun ball ].

User avatar

arne_v
Master
Posts: 347
Joined: Fri Apr 17, 2020 7:31 pm
Reputation: 0
Location: Rhode Island, USA
Status: Online
Contact:

Re: VSI C x86-64 X7.4-843 .... LLVM ERROR: ... REX-prefixed instruction

Post by arne_v » Fri Nov 17, 2023 9:21 am

I believe stdargs.h has been the recommended way since 1989 (ANSI C).

Maybe it is time now.

:-)
Arne
arne@vajhoej.dk
VMS user since 1986

User avatar

imiller
Master
Posts: 147
Joined: Fri Jun 28, 2019 8:45 am
Reputation: 0
Location: South Tyneside, UK
Status: Offline
Contact:

Re: VSI C x86-64 X7.4-843 .... LLVM ERROR: ... REX-prefixed instruction

Post by imiller » Fri Nov 17, 2023 9:38 am

I started writing C around 1987 ... I guess I could try to update :lol:
Ian Miller
[ personal opinion only. usual disclaimers apply. Do not taunt happy fun ball ].

User avatar

arne_v
Master
Posts: 347
Joined: Fri Apr 17, 2020 7:31 pm
Reputation: 0
Location: Rhode Island, USA
Status: Online
Contact:

Re: VSI C x86-64 X7.4-843 .... LLVM ERROR: ... REX-prefixed instruction

Post by arne_v » Fri Nov 17, 2023 9:50 am

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.
Arne
arne@vajhoej.dk
VMS user since 1986


jreagan
VSI Expert
Master
Posts: 139
Joined: Tue Dec 01, 2020 8:40 am
Reputation: 0
Status: Offline

Re: VSI C x86-64 X7.4-843 .... LLVM ERROR: ... REX-prefixed instruction

Post by jreagan » Fri Nov 17, 2023 12:54 pm

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.

Post Reply