Compatibility between two SPARC machines

Sorry, if this isn't the right forum for this question. I would like to compile an executable with gcc/g++ under Solaris 10 on the following OLDER SPARC-machine and then run this executable on the NEW SPARC-machine (see description down in this post). I'm wondering if it would be possible or if there can be some HW compatibility issues so that the executable won't work...?

OLDER SPARC-machine:
------------------
Sun Fire V480
(2 x 900 MHz 64-bit Cu UltraSPARC-III w/ 8MB L2 cache
or
4 x 900MHz UltraSPARC IIIi CPU)

NEW SPARC-machine:
----------------
SPARC M5000
(SPARC64 VII+ quad-core processors)