https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69192

            Bug ID: 69192
           Summary: valgrind trunk build fail in predict_loops
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

I just tried a trunk gcc build with valgrind

svn says 

$ svn info
Revision: 232153

Configure line is

$ ../src/trunk/configure --prefix=/home/dcb/gcc/results \
    --disable-bootstrap \
    --disable-multilib \
    --disable-werror \
    --enable-checking=valgrind \
    --enable-languages=c,c++,fortran \
    CC="/home/dcb/llvm/results/bin/clang" \
    CXX="/home/dcb/llvm/results/bin/clang++"

and the valgrind error is 

/home/dcb/gcc/working/./gcc/xgcc -B/home/dcb/gcc/working/./gcc/
-B/home/dcb/gcc/results/x86_64-pc-linux-gnu/bin/
-B/home/dcb/gcc/results/x86_64-pc-linux-gnu/lib/ -isystem
/home/dcb/gcc/results/x86_64-pc-linux-gnu/include -isystem
/home/dcb/gcc/results/x86_64-pc-linux-gnu/sys-include    -g -O3 -march=native
-O2  -g -O3 -march=native -DIN_GCC    -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition 
-isystem ./include   -fpic -mlong-double-80 -DUSE_ELF_SYMVER -g -DIN_LIBGCC2
-fbuilding-libgcc -fno-stack-protector   -fpic -mlong-double-80
-DUSE_ELF_SYMVER -I. -I. -I../.././gcc -I../../../src/trunk/libgcc
-I../../../src/trunk/libgcc/. -I../../../src/trunk/libgcc/../gcc
-I../../../src/trunk/libgcc/../include
-I../../../src/trunk/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT
-DHAVE_CC_TLS  -DUSE_TLS -o _powidf2.o -MT _powidf2.o -MD -MP -MF _powidf2.dep
-DL_powidf2 -c ../../../src/trunk/libgcc/libgcc2.c -fvisibility=hidden
-DHIDE_EXPORTS
==25598== Conditional jump or move depends on uninitialised value(s)
==25598==    at 0x9073D6: predict_loops (predict.c:1503)
==25598==    by 0x9073D6: tree_estimate_probability() (predict.c:2349)
==25598==    by 0x90B3F7: (anonymous
namespace)::pass_profile::execute(function*) (predict.c:3043)
==25598==    by 0x8FA4CD: execute_one_pass(opt_pass*) (passes.c:2336)

In the source code predict.c:1503 is

      if (!niter || TREE_CODE (niter_desc.niter) != INTEGER_CST)
        niter = loop_niter_by_eval (loop, ex);

svn blame says

118694    hubicka     if (!niter || TREE_CODE (niter_desc.niter) !=
INTEGER_CST)
119039    rakdver       niter = loop_niter_by_eval (loop, ex);

Reply via email to