I have so many gallon jugs of sugar stored, it’s not funny. Some of the older ones (circa 2008) have turned a sort of off white. No worries. I tested them, last fall and they’re good as new.
We inherited some stuff from my uncle (like 40 years ago). He had sugar stored in glass containers and bars of soap all over the place. The soap was pre-WWII labeled (that would made it than like 50 years old). The sugar was from that time probably too. Both were OK.
Just to be safe, we used the sugar boiled. Took us quite a while to consume it all, good as new.