Any time there are flickering dash lights on a Subaru (possibly other makes as well) one should suspect the alternator. This is true from the old GL/DL days right on thru to present - makes no difference if it is a 4cyl or 6 - the symptoms are pretty much the same.
I have said this before, but it bears repeating....
A bad battery can kill a good alternator - and - a bad alternator can kill a good battery.. the two are very closely related.
troubleshooting the problem can be as simple as making a trip to your local chain auto parts store (Advance, O'Reilly's, etc) and asking them to do a charging system check.
Granted, there are occasions when the alternator shows ok on one of these tests, but is still bad.. have had it happen to me personally.. the alternator was only failing under very specific circumstances, but I still had the flickering dash lights (especially noticeable at night) which led to a correct diagnoses.
Generally speaking, aftermarket alternators for Subarus are usually crap and fail pretty quickly. I have had excellent results getting a stock alternator rebuilt at a place that specializes in such work.. cost was comparable to a "new" aftermarket unit at a parts store, but far more reliable.