Bob Andrews
316ae886d7
Merge pull request #2242 from acqn/SwitchFix
...
[cc65] Fixed type promotion of switch case values
2023-10-26 16:56:01 +02:00
Bob Andrews
a8d00bfaae
Merge pull request #2240 from acqn/BitwiseOpt
...
[cc65] New TOS optimization steps for 8-bit subtraction and bitwise operations
2023-10-26 16:53:37 +02:00
acqn
df392fc104
Fixed type promotion of switch case values.
2023-10-25 22:38:21 +08:00
acqn
a31b35b2a6
Fixed naming of local variables in CG_TypeOfBySize and CG_TypeOf.
2023-10-22 10:42:17 +08:00
acqn
70549e868e
New optimizer steps to restore some possibly lost optimization with boolean due to the previous fix.
2023-10-21 23:56:13 +08:00
acqn
f321bb16e5
Fixed potential bugs with boolean branch optimizers when more than one jeq/jne follows.
2023-10-21 23:56:07 +08:00
acqn
79c52e742f
Added new opts OptBoolUnary1/OptBoolUnary2 to remove unnecessary cmp + bcastax/bnegax,
...
as well as OptBoolUnary3 to "strength-reduce" certain bcastax/bnegax to boolne/booleq.
2023-10-21 23:56:04 +08:00
acqn
e5bbdfa995
Separated boolean optimizers from bitwise unary operator optimizers.
...
Renamed OptCmp6 to OptBoolCmp.
2023-10-21 23:56:01 +08:00
acqn
c52427fc65
Minor fix for error recovery from duplicated struct members.
2023-10-21 23:52:14 +08:00
acqn
178573a128
Fixed inlined strlen when it takes a string literal with extra characters after the first '\0'.
...
Added testcases.
2023-10-17 17:57:19 +08:00
acqn
8111946731
Fixed array subscript with a bit-field with patch by kugelfuhr.
2023-10-15 15:53:03 +08:00
acqn
7b0d1d9679
Added warning on concatenated string literals in _Pragma operations.
2023-10-13 14:54:54 +08:00
acqn
25832ef5fc
Fixed timing of #pragma charmap.
...
Now it is immediately applied and affects almost all characters and string literals after it.
Exceptions:
- String literals as the message of a static assertion or inline assembler code (only the required one, not any optional formatted arguments) in an asm() expression are not translated with either #pragma charmap or target presets.
- String literals used for preprocessor directives or as the result of stringized macro arguments are never translated.
2023-10-13 16:32:06 +08:00
acqn
c6ead99b00
Fixed string literal concatenation with pragmas in between.
2023-10-13 16:32:05 +08:00
acqn
7b6f8249a0
General fixes for prerequisites for optimization on certain std functions.
...
Added utility functions for extracting expression info.
2023-10-11 22:29:15 +08:00
acqn
20c3e994c6
Fixed compiling with pragmas in the middle of declarations or statements.
2023-10-04 21:22:04 +08:00
Bob Andrews
2726192aaf
Merge pull request #2224 from acqn/DeclCleanUp
...
[cc65] Made functions in src/cc65/declare.c less confusing
2023-10-14 20:09:05 +02:00
acqn
74922afa7c
Made the intension of functions in src/cc65/declare.c less confusing.
2023-10-12 17:31:49 +08:00
Bob Andrews
494bf10e80
Merge pull request #2216 from acqn/FuncDefFix
...
[cc65] Type category in a function definition cannot be inherited from a typedef
2023-10-08 18:58:29 +02:00
acqn
0028b14071
The type category in a function definition cannot be inherited from a typedef.
2023-10-05 17:48:16 +08:00
acqn
51e304f10f
Added check for total arguments size for variadic functions.
2023-09-18 16:44:04 +08:00
acqn
878264d948
Minor consistency improvement for AddEnumSym() usage. No impact.
2023-09-13 22:26:41 +08:00
Bob Andrews
537aa665cf
Merge pull request #2006 from bbbradsmith/ca65_jmp_abs_wrap_error
...
jmp (abs) wrap warning promoted to an error, suppressed on 65C02/etc
2023-09-08 18:26:55 +02:00
Bob Andrews
05cd805cbc
Merge pull request #2085 from bbbradsmith/numerical_constant_errors-float
...
Numerical constant errors and improvements (float)
2023-08-25 22:30:07 +02:00
bbbradsmith
28ffe2f59b
add jmp page crossing to --relax-checks, document it, fix --relax-checks documentation (segment branch error is not suppressed)
2023-08-19 15:39:51 -04:00
bbbradsmith
d09e0a7f20
Merge branch 'master' into ca65_jmp_abs_wrap_error
2023-08-19 14:07:52 -04:00
Bob Andrews
652949f183
Merge pull request #2104 from Movax12/remove-feature-requirement-addrsize
...
ca65: Remove .feature requirement for .addrsize
2023-05-22 00:39:04 +02:00
Bob Andrews
70bf4d492b
Merge pull request #2105 from bbbradsmith/sim65-64bit-cycle-count
...
Sim65 64bit cycle count
2023-05-16 15:53:23 +02:00
bbbradsmith
3b7be09a7f
extern redeclared as static = error (C spec: undefined)
...
static redeclared as extern = warning (C spec: ignore extern)
See: #2111
2023-05-11 19:50:58 -04:00
Movax12
a058d4a2f3
Fix warning message, remove comment
2023-05-08 16:55:54 -04:00
bbbradsmith
f15e9c4159
Linux build rejects %llu in ErrorCode
2023-05-07 17:41:54 -04:00
bbbradsmith
2cb457b85f
sim65 use error codes outside the simulated program's range for non-sim errors
2023-05-07 16:51:12 -04:00
bbbradsmith
0081fe548c
sim64 universal 64-bit cycle count support:
...
MaxCycleCount is accounted by countdown, eliminating the 1-instruction-overhead issue, and removing the need to compare against a growing TotalCycles.
Makes main.c responsible for counting total cycles, instead of 6502.c, so the size of MaxCycleCount etc. is fully determined in one location.
Makes error.c responsible for PrintCycles instead of paravirt.c, so that it can be treated globally instead of
Return value of main() should be SIM65_ERROR because it is unreachable by design.
2023-05-07 16:26:42 -04:00
mvax
56df849101
add warning for .feature addrsize, clean up switch in SetFeature
2023-05-07 14:53:44 -04:00
Bob Andrews
9c70235173
Merge pull request #2096 from Movax12/BugFix-for-ismnemonic-function
...
Bugfix for the .ISMNEMONIC, .ISMNEM builtin function
2023-05-06 21:42:59 +02:00
Bob Andrews
9c27084fa5
Merge pull request #2084 from bbbradsmith/numerical_constant_errors-int
...
Numerical constant errors and improvements (integer)
2023-05-06 21:36:59 +02:00
Bob Andrews
7b40515506
Merge pull request #2099 from bbbradsmith/split2092-sim65-fix
...
sim65 fix platform-dependent issues
2023-05-06 20:36:59 +02:00
mvax
11cc5b6f06
remove .feature requirment for addrsize function, silently ignore '.feature addrsize'
2023-05-06 14:24:53 -04:00
bbbradsmith
84f0ab322d
sim65: cycles does not increment 1 at a time, so some small overhead is needed in range check
2023-05-06 13:54:28 -04:00
bbbradsmith
532681c961
braces were requested
...
combining the two a = ' ' cases was requested
2023-05-06 12:06:06 -04:00
bbbradsmith
1df7ab0352
opening brace on same line as while
...
other AbEnd messages don't end in .
2023-05-06 11:55:21 -04:00
bbbradsmith
c03d00bc80
sim65 suppress uninitialized variable warning
...
the EOF check was protecting uninitialized Val2 but the compiler can't figure that out
2023-05-05 21:46:42 -04:00
bbbradsmith
773716c32a
sim65 close(-1) crash fix
...
test/val/constexpr.c relies on close(-1) to return -1 for some reason (comment says "abuse"), but on MSVC close(-1) is treated as a security issue and terminates the program instead of returning -1
simulating this desire for sim65, though constexpr.c may also warrant a review
2023-05-05 21:46:11 -04:00
bbbradsmith
f2e7609046
sim65 cycles 32-bit range fix
...
long is 64-bit on some platforms, making this inconsistent, added range check to catch overflow.
reduced tests requesting 5 billion cycles to 2^32-1 so they can fun on 32-bit long sim65.
2023-05-05 21:45:57 -04:00
bbbradsmith
8d048699ee
grc65 fix flawed text parsing
...
Was using fseek(F,-1,SEEK_CUR) which is invalid for text files, behaviour unreliable across platforms.
Added check for internal buffer overflow.
2023-05-05 21:32:34 -04:00
mvax
1c58b302d8
Bugfix for the .ISMNEMONIC, .ISMNEM builtin function
2023-05-05 12:31:19 -04:00
Bob Andrews
a7676bdff5
Merge pull request #2075 from bbbradsmith/struct-duplicate-member-error
...
Error for struct/union with a duplicate member
2023-05-04 22:43:17 +02:00
bbbradsmith
69f4cd1847
limits.h was apparently already included somewhere on windows but not linux
2023-05-04 05:48:48 -04:00
bbbradsmith
ca8201a314
Overflow test optimization suggested by kugelfuhr
...
User CHAR_BIT instead of 8
2023-05-04 05:44:20 -04:00
Brad Smith
5ed7153841
Merge branch 'master' into ca65_jmp_abs_wrap_error
2023-05-03 21:12:37 -04:00