We consider the problem of controlling Connected and Automated Vehicles (CAVs) traveling through a roundabout so as to jointly minimize their travel time, energy consumption, and centrifugal discomfort while providing speed-dependent and lateral roll-over safety guarantees, as well as satisfying velocity and acceleration constraints. We first develop a systematic approach to determine the safety constraints for each CAV dynamically, as it moves through different merging points in the roundabout. We then derive the unconstrained optimal control solution which is subsequently optimally tracked by a real-time controller while guaranteeing that all constraints are always satisfied. Simulation experiments are performed to compare the controller we develop to a baseline of human-driven vehicles, showing its effectiveness under symmetric and asymmetric roundabout configurations, balanced and imbalanced traffic rates, and different sequencing rules for CAVs.