Preheat oven to 400 degrees. Butter a 9-by-13-inch baking dish. Heat 3 tablespoons oil in a large skillet over medium-low heat. Add onions; season with salt and pepper. Cover; cook until onions are soft and release liquid, 15 minutes. Uncover; raise heat to medium. Cook, stirring, until onions are browned, 20 to 25 minutes. Stir in 1 teaspoon rosemary.
Meanwhile, cook pasta in large pot of boiling salted water 2 minutes less than package instructions suggest. Drain, reserving 1 1/2 cups cooking water. Return pasta to pot.
Stir squash and reserved pasta water into onions; simmer 2 minutes. Toss squash mixture and 1/2 cup Parmesan with pasta. Transfer to prepared dish.
Combine bread cubes with remaining Parmesan, rosemary, and oil; season with salt and pepper. Top pasta with bread cubes; bake until golden brown, 10 to 15 minutes.