1)Are -O and -O1 flags equal?
Yes.
2) What happens internally when -O1/-O flag is used?
Lots of stuff, read the source code; gcc/opts.c is a good starting point. The "optimize" variable is set to the optimisation level.
I have been searching gcc internal manuals. But I could not locate.
The internals manual is not a replacement for the source code; the manual is meant to help understanding and modifying the source code. Have fun and good luck, Segher