flang
flang copied to clipboard
Fix sym size on windows
See https://github.com/flang-compiler/flang/pull/1020/files/d7b7df2d206b9355c1989fde9dbd2d238b4985ea#diff-486be7fb1b6bc6bfb2d1fcb6d59aa4a99ddc2a8fb035e28d688fc862343810b7
#1020
There are some assert checks which tests SYM size whether is equal to 44 or 36. Please see one of them:
https://github.com/flang-compiler/flang/blob/97527abd723a85154e54337b5a1f3e1e5db1f86d/tools/shared/utils/symacc.c#L52-L57
On Windows I got this error for that:
Error number 0, line 0, params bad SYM size 40
SYM structure comes from symacc.c/cc, some entry declared as ISZ_T type which is BIGINT. BIGINT is defined as long here:
https://github.com/flang-compiler/flang/blob/97527abd723a85154e54337b5a1f3e1e5db1f86d/include/legacy-ints.h#L25-L32
The root of the problem is Windows uses LLP64 data model where long is still 32bit. That's why assert triggers a bad sym size errors. Changing the BIGINT to int64_t produces lots of warnings as the comment says. So I will disable these assert for Windows since these are not relevant on it at the moment.