- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I discovered a problem with the IFX 2024.0.2 compiler (but it's also in 2024.0.0 and 2023.x) when using the windows PtInRect function. The function returns an incorrect value because it is incorrectly called. If I compile source code with IFORT it works correctly.
My sample code is the following
...
type (T_POINT) point
type (T_RECT) Rect
Rect%left=15
Rect%right=100
Rect%top=90
Rect%bottom=100
point%x=0
point%y=95
iret=PtInRect(Rect,point) ! should return 0 point is out of rect
...
IFORT generates assembly code:
lea rcx,[RECT (07FF7896E80C0h)]
mov rdx,qword ptr [POINT (07FF7896E80D0h)]
call PtInRect (07FF7896E1410h)
(address of Rect is in rcx, values of point x and y coordinates in rdx according to calling conventions)
IFX generates assembly code:
lea rcx,[RECT (07FF7723460A0h)]
mov r8d,dword ptr [POINT+4h (07FF7723460C4h)]
mov edx,dword ptr [POINT (07FF7723460C0h)]
call PtInRect (07FF772341380h)
(address of Rect is in rcx, value of point x coordinate is in edx and value of y coordinate is in r8). IFX handles type (T_POINT) as two integers instead as one 64bit value.
Sample project is attached (compiler should be changet to IFORT if needed)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the great reproducer! I duplicated the wrong answers you got with ifx. I filed a bug report, CMPLRLLVM-54891, for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good news! This issue is fixed in ifx 2024.1.0. It's planned for release in March/April 2024.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page