Barkley, a strong contender for the England number 12 shirt against Six Nations champions Wales on February 4, produced an outstanding 40-minute performance before injury forced him off.
His 13-point haul included an exquisite try as Gloucester suffered a second defeat in seven weeks on Bath soil.
In Group D, Leicester's second-half onslaught against Northampton at Welford Road brought them three tries and a place in the semi-finals of the competition.
The hosts went into the match needing to score four tries and win by seven points or more to qualify and their chances were fading when they trailed 11-0 after 37 minutes.
They handed themselves a lifeline when Leon Lloyd crossed in the closing moments of the half.
Ben Kay, Shane Jennings and Lloyd crossed after the break to complete a thrilling 29-16 victory that was secured after they repelled a late spell of pressure from the visitors.
Fly-half Craig Warlow booted 18 points as Newport Gwent Dragons enjoyed a 33-10 victory over Worcester whose first taste of Welsh opposition ended in failure.
But it was a fairly meaningless result as neither side could reach the quarter-finals due to previous results.