2026-10-23 Christopher Bazley * src/SDCCpeeph.c (notVolatileRange, directOperandSymbol, notVolatileSymbol, notVolatileVariable, notVolatile): Check preserved volatile-access flags over the matched lines instead of using the function-wide fallback. Share direct-symbol lookup, including byte offsets and assembly-name verification, across ports. Include MOS65C02 and HuC6280 in numeric-address checks. * src/SDCCsymt.h (symbol): Remove funcUsesVolatile. * src/SDCCsymt.c (newSymbol), src/SDCCopt.c (checkPurity): Remove assignments to funcUsesVolatile. Retain volatility checking when determining funcPure. * src/SDCCast.c: Remove the obsolete comment about funcUsesVolatile. 2026-10-23 Christopher Bazley * src/SDCCopt.c (optimizeFinalCast): Retain pointer casts that change the volatility of the pointed-to type. Replacing the cast pointer with its source otherwise loses the qualification before register allocation and can allow a required volatile read to be deleted by peephole optimisation. This change is a precondition for removing the check for currFunc->funcUsesVolatile in notVolatileVariable. 2026-10-23 Christopher Bazley * src/SDCCast.c (decorateType): Diagnose incompatible referenced types in pointer comparisons and non-object pointer operands of relational operators before optimisation. Apply array and function conversions when checking the operands. Retain the equality exceptions for object/void pointers and null pointer constants (bug #4174). * src/SDCCsymt.c, src/SDCCsymt.h: Share pointerTargetType and needsPtrTargetTypeWarning between comparison, conditional-expression and implicit-conversion constraint checks. Use similarTypes to compare referenced types. Check array and function operands without constructing temporary pointer types in comparisons and conditional expressions. * src/SDCCerr.c, src/SDCCerr.h: Add W_COMPARE_POINTERS as a warning. * support/valdiag/tests/bug-4174.c: Test all six operators, reversed operands, function pointers, arrays, constant folding and valid comparisons, including void and other incomplete object types, qualifiers, null pointers and address spaces. * support/regression/tests/bug-2710.c: Suppress the warning for the comparison of pointers to incompatible types. 2026-10-23 Lishin * support/regression/MakeList, support/regression/tests/bigreturn-remat.c.in, support/regression/tests/dynamiccstructret.c.in, support/regression/tests/funptrsstructreturn.c.in, support/regression/tests/gcc-torture-execute-struct-ret-1.c, support/regression/tests/largeoddstruct.c.in, support/regression/tests/structreturn.c.in: Run DS390 struct return tests for direct and indirect calls, and check returned data. 2026-10-23 Lishin * device/include/stdlib.h, device/lib/div.c, device/lib/ldiv.c, device/lib/lldiv.c: Enable div(), ldiv(), and lldiv() for the DS390 flat24 model. These functions return structs. 2026-10-23 Lishin * src/SDCCast.c, src/SDCCsymt.c, src/ds390/gen.c, src/ds390/main.c: Add struct and union return support for the DS390 flat24 model. Pass the result pointer in parameter registers and save it in the callee. Keep other parameters on the stack. * support/regression/tests/ds390-structreturn-static.c: Add a test for returning a static struct. 2026-10-22 Christopher Bazley * src/SDCCgen.h (lineElem_t, lineNode): Record possible volatile accesses. * src/SDCCpeeph.c (mightHaveVolatileAccess, notVolatileVariable, notVolatile, replaceRule, peepHole): Preserve volatile-access information through peephole replacements, including SET_VALUE_AT_ADDRESS stores, protecting required accesses even when instruction iCode associations are lost or changed (bugs #4202, #4203 and #4204). Make the no-parameter notVolatile rule restriction use the preserved information instead of scanning the lines’ current iCode associations. 2026-10-22 Philipp Klaus Krause * src/z80/gen.c, support/regression/tests/bug-4186.c: Fix bug #4186. 2026-10-22 Christopher Bazley * src/SDCCpeeph.c (notVolatileVariable): Resolve exact Z80-family direct symbol operands through the symbol table when checking volatility. Retain the conservative fallback for indirect accesses, address expressions and unresolved symbols. Restore redundant-load elimination affected by bug #4149.