It should not be very hard to fork gcc and make a quick hack that dumps the AST. You don't need the latest optimizations or AST versions, just a correct one, so there is no need to update it a lot (sans fixing bugs you created with the hack). You wont see at this point bogus ASTs generated by gcc.