Maximum possible compression in a gasoline engine was originally determined by knocking in engines with carburetor. With fuel injection the fuel could be injected after compression and thus eliminate knocking. How high compression does fuel injection permit?
If you want to turn the engine into a compression-ignition one, I suppose there isn't really a limit other than physical based on strength of materials. Your proposed solution is rather how diesel engines run. I believe diesel engines run up to the low 20's in compression ratio.
None of this has anything to do with whether or not it would be worthwhile to do so.