Why does everyone think that the earth will be destroyed by the sun becoming a red giant? We've got billions of years to solve that problem.
And we have a billion ways to go extinct long before then. I would be surprised if humanity is around in a million years, heck even 1,000 seems doubtful these days. Very surprised.