What parts of ARMv4/5/6 code will not work on ARMv7?
For application code the principal problem is unaligned memory accesses. Before ARMv4 and configurable on ARMv4 to ARMv6 a LDR load from an unaligned address would result in the read data being rotated, and other memory access act as if least significant 2 bits are zero.
Compiling for arm instructions armv4 should work all the way through.
The real problem with your question other than not doing your own research on the topic (took you far longer to avoid looking into it than to look into it) is that the majority of the code that you may wish to port from one platform to the next has to do with the peripherals not the instruction set. Most of your code will not port not due to the instruction set but because of the timers, and uarts, and video and usb controllers and such. These are not wintel boxes they dont attempt to be reverse compatible.
The question you linked really has no meat to it since the OP didnt put any code down didnt do any work on the topic, at least not publicly at stackoverflow, it could be a simple case of bad code and have nothing to do with the processor cores, or it could be a case of peripherals that arent there and accessing those, one would expect a hang or crash.