Shanghai Composite gains