If you just want to implement one latest change or bugfix that does not fit in, you might consider a different toolchain. The Keil compiler is renowned for it's compact code size, compared with other compilers.
OTOH, if you plan several incremental updates and extensions, an upgrade of the controller is probably required.
> I know that LPC4088 is pin-to-pin compatible with LPC1788 but it has the same (512 kByte) flash memory size.
In my experience, porting a serious firmware to another MCU is far more effort than a PCB reshuffle.