On x86 the cache is implicit when you touch memory, and there are many ISA ops (push, call, ...) that implicitly update stack memory.
But if you never call those, it is possible to access the cache explicitly. Coreboot have a custom in-tree compiler, ROMCC [1] that compiles C to a subset of x86 that never emits memory operations.
They use this to treat cache as RAM [2] for a brief period during early boot before the RAM itself gets initialized.
1. https://github.com/wt/coreboot/tree/master/util/romcc The whole compiler is a single C file
2. https://www.coreboot.org/data/yhlu/cache_as_ram_lb_09142006.... Perform s/LinuxBIOS/Coreboot/ in your head as you read
As caches have gotten bigger I’ve wondered when or if we will treat them as local memory instead of trying to maintain an illusion of cache coherency at a high cost.