Preheat the oven to 375 degrees F.
To make the topping, measure the flour, polenta, sugar, salt, baking powder, and anise seeds into a food processor or a stand mixer fitted with the paddle attachment. Pulse for a few seconds to combine.
Add the butter and pulse or mix on medium-low speed until the mixture resembles coarse crumbs.
Transfer the mixture to a bowl and make a well in the center. Pour the egg into the well and toss the egg and flour together lightly and thoroughly with your fingers until evenly mixed. The mixture will not adhere in the manner of a dough but will clump together if pressed in your palm. Set aside until needed.
To make the filling, combine all the ingredients in a large bowl and toss until well mixed. Turn mixture into a 2 quart shallow baking dish. Sprinkle the topping over the filling in an even layer. Do not press down. Place the dish on a baking sheet to catch the drips and place in the oven.
Bake until the juices are bubbling up around the topping and the top is crisp and golden brown, about 1 hour. Serve warm with gelato, if desired.
If you choose to bake the dessert in individual dishes, cut the baking time by about half.
Recipe courtesy of Michael Chiarello