This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
foptimize_strlen
- From: Vikas Salar <vikassalar0507 at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 10 Feb 2014 14:26:55 +0530
- Subject: foptimize_strlen
- Authentication-results: sourceware.org; auth=none
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