On Mon, Jan 16, 2006 at 11:53:31AM -0800, H. J. Lu wrote: > Due to > > http://gcc.gnu.org/ml/gcc-patches/2006-01/msg00837.html > > I got > > cc1: warnings being treated as errors > /export/gnu/src/gcc/gcc/gcc/fold-const.c: In function ‘fold_minmax’: > /export/gnu/src/gcc/gcc/gcc/fold-const.c:7194: warning: ‘compl_code’ > may be used uninitialized in this function make[5]: *** [fold-const.o] > Error 1 > make[5]: *** Waiting for unfinished jobs.... > >
This patch works for me. H.J. ---- 2006-01-16 H.J. Lu <[EMAIL PROTECTED]> * fold-const.c (fold_minmax): Always initialize compl_code. --- gcc/fold-const.c.foo 2006-01-16 11:33:31.000000000 -0800 +++ gcc/fold-const.c 2006-01-16 11:56:13.000000000 -0800 @@ -7191,14 +7191,12 @@ fold_unary (enum tree_code code, tree ty static tree fold_minmax (enum tree_code code, tree type, tree op0, tree op1) { - enum tree_code compl_code; + enum tree_code compl_code = MIN_EXPR; if (code == MIN_EXPR) compl_code = MAX_EXPR; - else if (code == MAX_EXPR) - compl_code = MIN_EXPR; else - gcc_assert (FALSE); + gcc_assert (code == MAX_EXPR); /* MIN (MAX (a, b), b) == b. */ if (TREE_CODE (op0) == compl_code