foptimize_strlen

Vikas Salar vikassalar0507@gmail.com
Mon Feb 10 08:56:00 GMT 2014


Hi,

I'm getting one valgrind error of "Invalid read of size 4" with
executable build by g++481 with -O2 option.
Error is not reported if binary is build with g++481 with -O2 and
-fno-builtin-strlen on command line.
Though I think it's a valgrind false positive and my suspect g++481
optimization for this error is -foptimize-strlen, but error is not
reported if
binary is build with -O1 and -foptimize-strlen on command line.

My queries are:
does g++481 activates strlen optimization when -foptimize-strlen is
enables explicitly?
Is there any difference between fno-optimize-strlen and -fno-builtin-strlen?
Why error is reported with "-O2" and not with "-O1 -foptimize-strlen"?

Thanks,
Vikas



More information about the Gcc-help mailing list