Opened 5 years ago

Last modified 5 years ago

#95 accepted defect

sim: Integers < -5 appearing in dbg.value are discarded.

Reported by: Lukáš Zaoral Owned by: mornfall
Priority: major Milestone: 4.4
Component: sim Keywords:
Cc: kdudka@…, jamartis@…, lzaoral@…

Description

Hello,
if I run the following code in the divine sim (occurs also on next builds):

  int main(void)
  {
      int a = -1;
      int b = -5;
      return 0;
  }

the show command outputs:

   > show
   attributes:
       address: heap* 1f78a5dd 0+0
       size:    16
       pc:      code* 80001 0
       location: test3.c:5
       symbol:  main
   .a:
       type:    int
       value:   [i32 4294967295 d]
       scope:   main
   related:     [ caller ]
   # executing main at test3.c:5

where the b variable entry is missing. Thanks!

Change History (1)

comment:1 Changed 5 years ago by mornfall

Status: newaccepted
Summary: sim: Negative integer is ignored when defined after another negative integer.sim: Integers < -5 appearing in dbg.value are discarded.

Some data points: this works if the variables are used (e.g. put a printf after the declarations) or --disable-static-reduction is given. The only real problem seems to be with dbg.value (which is what remains after the alloca is removed) and values less than -4 (changing b to -2 fixes the problem too).

Note: See TracTickets for help on using tickets.