Generalized Devil's staircase and RG flows