This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

cse.c bug


The following, rather minimalistic program causes an assignment of
a garbage value in cse.c, caught by checkergcc, with 970924 with Haifa
on a Linux-486-libc6 system, when compiled with optimization.

$ cat hello.i
int main()
{
    return 0;
}
$ cc1 -O hello.i

[...]

>From Checker (pid:17317): (rus) read uninitialized byte(s) in the stack.
When Reading 4 byte(s) at address 0xbfffb40c, inside the stack.
Stack frames are:
        pc=0x08295537 in cse_insn() at cse.c:7512
        pc=0x08299d59 in cse_basic_block() at cse.c:8431
        pc=0x082995c6 in cse_main() at cse.c:8313
        pc=0x080bb3d6 in rest_of_compilation() at ./toplev.c:3208
        pc=0x08086f62 in finish_function() at c-decl.c:7047
        pc=0x0805aa31 in yyparse() at c-parse.y:316
        pc=0x080b8329 in compile_file() at ./toplev.c:2486
        pc=0x080c035c in main() at ./toplev.c:4331
        pc=0x08058f6f in checker_text_end() at ./end.c:9

The statement in question is

  prev_insn_cc0_mode = this_insn_cc0_mode;

It appears that this_insn_cc0_mode was never assigned a value, so it
contains garbage, which probably is suboptimal.

[Did I mention that playing around with Checker is fun? :-]
-- 
Thomas Koenig, Thomas.Koenig@ciw.uni-karlsruhe.de, ig25@dkauni2.bitnet.
The joy of engineering is to find a straight line on a double
logarithmic diagram.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]