Place the sugar and spices into a heavy-based pan and pour over the water. Bring the mixture to the boil, stirring well so that the sugar dissolves, then reduce the heat until the mixture is simmering and continue to simmer for 8-10 minutes, or until the mixture has thickened and resembles syrup.
Strain the mixture into a clean jug, discarding the whole spices (reserve the strained liquid). Set aside to cool.
Meanwhile, lay the pineapple pieces onto a roasting tray. Drizzle over two thirds of the sugar syrup, then transfer to the oven and roast for 8-10 minutes, basting regularly with the remaining sugar syrup.
To serve, arrange two pieces of spiced, roasted pineapple into the centre of each of four serving plates. Place a scoop of ice cream alongside each, if using.