https://bugs.kde.org/show_bug.cgi?id=386945

            Bug ID: 386945
           Summary: Bogus memcheck errors on ppc64(le) when using strcmp()
                    with gcc-7
           Product: valgrind
           Version: 3.14 SVN
          Platform: Other
               URL: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80479
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: memcheck
          Assignee: jsew...@acm.org
          Reporter: octopl...@yandex.com
  Target Milestone: ---

trippels@gcc2-power8 ~ % cat example.c
#include <string.h>

int main ()
{
   char str1[15];
   char str2[15];
   strcpy(str1, "abcdef");
   strcpy(str2, "ABCDEF");
   return strcmp(str1, str2);
}

trippels@gcc2-power8 ~ % gcc -O2 -g example.c
trippels@gcc2-power8 ~ % valgrind ./a.out
==28988== Memcheck, a memory error detector
==28988== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==28988== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==28988== Command: ./a.out
==28988== 
==28988== Conditional jump or move depends on uninitialised value(s)
==28988==    at 0x100004E8: main (example.c:9)

A new strcmp optimization was added to gcc-7. Since then valgrind
shows the bogus errors. So some kind of suppression would be needed.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to