public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* cse.c bug
@ 1997-09-30  8:57 Thomas Koenig
  1997-09-30 13:36 ` Thomas Koenig
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Thomas Koenig @ 1997-09-30  8:57 UTC (permalink / raw)
  To: egcs

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1997-10-06 11:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-09-30  8:57 cse.c bug Thomas Koenig
1997-09-30 13:36 ` Thomas Koenig
1997-09-30 14:06   ` Joe Buck
1997-09-30 22:49 ` Jeffrey A Law
1997-10-06 11:12 ` Thomas Koenig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).