Finding the optimization that is making the change
Will Hawkins
whh8b@virginia.edu
Fri Aug 11 17:09:00 GMT 2017
Hello everyone!
First, thank you all for your participation in the gcc community -- I
firmly believe that one of the great strengths of free software is the
community of people that participate in its development, maintenance
and support. So, thank you!
I have a simple C program and I am attempting to determine which of
the optimizations at O1 cause a particular transformation. In order to
isolate the optimizations enabled at O1 vs O0, I followed an idea set
out in the gcc man page and ran the following command:
$ diff <(gcc -Q -O1 --help=optimizers) <(gcc -Q --help=optimizers) |
grep enabled | awk '{print $2;}' > optimizations
Then I compiled with the following command:
gcc -o scfi.poptim `cat optimizations | tr '\n' ' '` scfi.c
I compared simple.poptim with simple.optim that came from running this command:
gcc -o simple.optim -O1 simple.c
I expected that simple.optim and simple.poptim would be (largely)
identical. That is not the case, however. It does not look like the
scfi.poptim program has been optimized at all.
I was wondering if anyone could shed some light on why this is not the
case. I ask only because the gcc man page seems to imply that this is
the "right" way to isolate the different optimizations performed at
different levels.
I know that everyone is tremendously busy, but I would sincerely
appreciate any responses that might help me figure out why I am not
seeing the behavior that I expect.
Again, thank you for being part of the community and helping us baffled users.
Will
PS: If possible, please cc me directly on all replies -- I am not
subscribed to gcc-help. Thank you!
More information about the Gcc-help
mailing list