To make the topping:
Preheat the oven to 375 degrees F. Measure the flour, polenta, aniseeds, sugar and salt into a medium mixing bowl. Add the butter and mix with your hands until the mixture resembles coarse crumbs. Make a well in the center of the mixture. 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 pastry 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 into a 2-quart shallow, buttered 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 or whipped cream if desired.