From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4222 invoked by alias); 10 Feb 2014 08:56:58 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 4211 invoked by uid 89); 10 Feb 2014 08:56:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pd0-f179.google.com Received: from mail-pd0-f179.google.com (HELO mail-pd0-f179.google.com) (209.85.192.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 10 Feb 2014 08:56:57 +0000 Received: by mail-pd0-f179.google.com with SMTP id fp1so5461329pdb.38 for ; Mon, 10 Feb 2014 00:56:55 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.66.221.199 with SMTP id qg7mr24687672pac.88.1392022615148; Mon, 10 Feb 2014 00:56:55 -0800 (PST) Received: by 10.70.30.33 with HTTP; Mon, 10 Feb 2014 00:56:55 -0800 (PST) Date: Mon, 10 Feb 2014 08:56:00 -0000 Message-ID: Subject: foptimize_strlen From: Vikas Salar To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2014-02/txt/msg00051.txt.bz2 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