There are 398 miles from Barcelona to Gap. It will take about 6 hours to drive.
about 6 hours and 15 minutes
There are 394 miles from Cannes to Barcelona. It should take just about 6 hours to drive.
It would be at least 5 hours. In order to get there you have to go around the Pyrenees Mountains, making it a longer journey than it first appears.
The drive is 411 miles, or just over 6 hours length.