I think -fno-merge-all-constants is the option you are looking for. Either that or -fno-global-merge. More information about these options at . The GCC docs for this option  also note that constant merging is not standards compliant. However, I have never seen a program in the wild where this type of merging causes problems.