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. 2026-10-22 Christopher Bazley * support/regression/MakeList: Enable qct/0036-notneg.c on MCS51 and DS390 (bug #3392). * support/regression/qct/0036-notneg.c: Identify the bug tested. * support/regression/tests/bug-3392.c: Remove the duplicate test. 2026-10-21 Christopher Bazley * src/SDCCicode.h (enum pointerCheckKind): Add POINTER_RELATIONAL. * src/SDCCicode.c (picPointerCheck, geniCodeLogic): Record relational pointer checks before the common type can add _Optional to the other operand (bug #4169). * src/SDCCopt.c (checkStaticArrayParams): Diagnose the recorded source operands instead of the converted comparison operands. * support/valdiag/tests/bug-4169.c: Test all four operators in both operand orders, checked and unchecked optional operands, equality comparisons and an explicit cast to an optional target type. 2026-10-21 Philipp Klaus Krause