Commit Graph

2867 Commits

Author SHA1 Message Date
Sven/Sarah Barth
2df57e117b * fix #40381: also check for hints when parsing the parameters of a routine (including open array parameters) or the result type of a function
+ added tests
2023-09-08 15:54:08 +02:00
florian
7e69f399b3 * patch and test by Rika: fixes self inserts in Insert(x, dynarray) and improves Insert(x, dynarray), resolves #40417 2023-08-29 22:23:22 +02:00
J. Gareth "Curious Kit" Moreton
1bcf4a5a8c * New test to detect SSE/AVX optimisation error 2023-08-24 19:41:41 +00:00
Jonas Maebe
1be7416816 default value: fix issue with inlining
Ensure the mangled name is always the same

Resolves #40404
2023-08-20 22:08:47 +02:00
Jonas Maebe
50040a2cab default values: store as staticvarsyms in staticsymtable
Previously, they were stored as localvarsyms in either the localsymtable
(for procedures/functions) or as localvarsyms in the staticsymtable (for
init/fini code of units/main programs). The latter was a hack (staticsymtables
normally cannot contain localvarsyms) and caused the temp allocator to also
allocate them as a local in fini code even if the default was only in the init
code.

The new approach ensures at most one copy gets allocated per unit, it doesn't
require explicit initialisation (since staticvarsyms are in bss -> zeroed by
default), gets rid of the localvarsyms in staticsymtables, and as a bonus
solves an issue with inconsistent LLVM debug information for the localvarsym
in init/fini code (since the staticsymtable is shared between the init and
fini code, so was the local, and therefore we generated debug info stating
it was defined in the fini code but within the scope of the init code).

Resolves #40395
2023-08-15 21:13:48 +02:00
J. Gareth "Curious Kit" Moreton
11957d9a60 * New test, mostly for x86, to detect incorrect TEST/JNE/TEST/JNE optimisation 2023-08-12 23:43:05 +00:00
J. Gareth "Curious Kit" Moreton
6d5876a29c * New CMOV test at webtbs/tw40307.pp 2023-08-12 20:55:12 +00:00
Jonas Maebe
45339ddc98 tw40324: fix compilation on unix platforms 2023-07-30 22:22:28 +02:00
J. Gareth "Curious Kit" Moreton
ae5544db4c * New test for i40358 2023-07-21 09:24:53 +01:00
Sven/Sarah Barth
c994b5efe8 * fix #39447: when checking whether the parameters are valid for pointer arithmetic check the *correct* parameter for being valid pointer-like type (I'd say that this was a copy&paste mistake...)
+ added test
2023-06-30 17:42:39 +02:00
Sven/Sarah Barth
d5c1533377 * fix #40331: for enumeration with holes (that don't have type information) use the binary comparers
+ added test
2023-06-30 16:30:46 +02:00
Sven/Sarah Barth
8592d42afa * test added for #40332 is supposed to fail 2023-06-30 16:24:20 +02:00
Sven/Sarah Barth
d97d34ee9c * fix #40332: apply patch by Rika to avoid a crash when an overload can't be picked outside of a function (e.g. when using intrinsics inside constants)
+ added test
2023-06-30 15:35:28 +02:00
Sven/Sarah Barth
f721210638 * fix #40142 and #40324: don't alias the function name to the $result variable for anonymous functions unless an explicit result name is provided
+ added tests
2023-06-23 17:06:41 +02:00
Sven/Sarah Barth
e44a33a78b + previous commit also fixes #40143, #40144, #40145, #40308 and #40315, so add the tests for them 2023-06-16 17:03:51 +02:00
Sven/Sarah Barth
d24eeffa2b * fix #40293: have the SysUtils unit use the TArray<> declaration in the ObjPas unit instead of declaring it again 2023-06-03 18:10:45 +02:00
Pierre Muller
3bb2586269 Fix for sparc64 specific code generation bug report #40252 2023-05-26 17:10:23 +02:00
J. Gareth "Curious Kit" Moreton
0a89e68d55 * Added test to attempt to catch access violation caused by faulty optimisation (i40165) 2023-04-30 22:25:55 +00:00
Pierre Muller
11a390117c Improve test for unaligned access 2023-04-21 20:46:11 +00:00
florian
e40f997a40 * another patch to fix #40223 2023-03-31 23:45:45 +02:00
florian
6663d5ca63 * do not replace index registers with esp/rsp, resolves #40223 2023-03-30 21:36:35 +02:00
Jonas Maebe
12bde4e903 WPO: fix dead code detection, and handle procvars
Extend dead code detection to not only look for the main mangled name, but also
for any aliases before deciding that a routine has been dead-stripped.

Assume objects/classes can also be constructed if the address of one of their
constructors or of the TObject.NewInstance class method has been taken.

Resolves #40204
2023-03-24 21:22:18 +01:00
florian
3e3b96e088 * fix of Erroneous reading of the value of the StackLength variable at program start based on issue report by Sergey Larin, resolves #40211 2023-03-21 22:37:40 +01:00
florian
0d3ec87492 * also initalize default helper variables of initialization sections, resolves #40183 2023-03-19 21:19:10 +01:00
Jonas Maebe
0e46041717 WPO: also consider NewInstance to detect class instancing
Resolves #40200
2023-03-18 21:18:25 +01:00
florian
64319dc019 * PopCount takes care only of the bit pattern, so take the uvalue to avoid an internal error, resolves #40190 2023-03-17 22:30:36 +01:00
Sven/Sarah Barth
6aab856213 + add test for already fixed #37380 2023-03-15 23:39:59 +01:00
Sven/Sarah Barth
d6d693696e + add test for fixed #40077 2023-03-06 23:29:04 +01:00
Sven/Sarah Barth
4823ca7114 * fix #40074: adjust Generics.Defaults to make use of the new ConstParamIsRef<> utility function to correctly determine how a generic binary parameter needs to be compared 2023-03-06 23:24:36 +01:00
florian
99b01f6634 * second mul might get called with a zero operand if the other has a side effect,
handle this correctly in ti386addnode.second_mul64bit, resolves #40182
2023-03-06 23:19:34 +01:00
J. Gareth "Curious Kit" Moreton
090e4fea96 * New test for i40122 2023-02-19 20:22:49 +00:00
florian
811c683775 * set rangedef of dyn. arrays correctly, resolves #40149 2023-02-15 22:14:55 +01:00
Jinyang He
176462c39a add loongarch64 tests support 2023-02-05 19:18:48 +00:00
florian
a9f9996dc8 + support leap seconds in TryEncodeTime, resolves #40121 2023-01-30 22:40:15 +01:00
florian
8ef0f59025 * mark constant symbols used in preprocessor expressions as used, resolves #40108 2023-01-24 22:36:26 +01:00
florian
5598ffc210 * x86_64: warn only on negative offsets if rsp is involed, second part of #40113
+ tests
2023-01-17 23:09:42 +01:00
florian
8b08486fa1 * do not warn on lea e/rsp with negative address offset, part of #40113
+ tests
2023-01-15 23:06:05 +01:00
Sven/Sarah Barth
e1288897f3 * fix #40031: with support for inline specializations it no longer makes sense to make the parameter symtable of a procedure variable type readonly as there *are* defs that are added to it
+ add adjusted test
2022-12-30 23:32:00 +01:00
Sven/Sarah Barth
4510945465 * fix #40062: ensure that Self is only added to anonymous functions when dealing with method pointers
+ added test
2022-12-30 23:32:00 +01:00
Sven/Sarah Barth
5d7e3ca240 * fix #40060: ensure that Self is not added for anonymous functions that are part of a static class method
+ added test
2022-12-30 23:32:00 +01:00
Sven/Sarah Barth
4c6338207f * fix #40061: the Self of types that aren't implicit pointers (recods, TP-style objects, primitive types (for helpers)) needs to be stored as a Pointer in the Capturer so that modifications are correctly visible
+ added tests
2022-12-30 23:32:00 +01:00
florian
3203eac6d3 + missing -O4 option added 2022-12-24 17:07:27 +01:00
florian
28b4189a9a * mess cleaned up 2022-12-23 18:16:52 +01:00
florian
30e0df384d * second part of #40041 fixed
+ tests
2022-12-22 22:41:39 +01:00
florian
e0fef23d77 * properly transform a+const1-const2 into a+const1+(-const2), resolves #40041 2022-12-21 22:34:46 +01:00
Jonas Maebe
851af5033f Darwin/AArch64: adjust alignment info of custom-aligned paralocs
Resolves #40019
2022-12-06 21:46:26 +01:00
Pierre Muller
b202fb2b0a Fix two tests for ELFV2 powerpc64 ABI 2022-12-01 00:05:05 +00:00
florian
b835005941 * proper naming for test, resolves #40013 2022-11-30 22:17:58 +01:00
florian
96d4bd19ac * use bzhi only (if at all) for in_and_assign_x_y and not other in_*_x_y operations, resolves #40016 2022-11-30 22:16:21 +01:00
J. Gareth "Curious Kit" Moreton
5704626762 * New test to catch issue identified in #40003 2022-11-28 21:43:50 +00:00