Not sure if it's legal...
It's definitely illegal if you're not getting compensated for that time.
Two things will happen, if you stick it out.
1) They will continue to take advantage of you
2) They will see you working hard and possibly give you a raise...i dunno how your company works. If you're in a position where you need to ask for a raise, then you can use this to your advantage