On Tue, 25 Apr 2006, Leopold Toetsch via RT wrote:
 
> On Apr 25, 2006, at 17:34, Andy Dougherty (via RT) wrote:
> 
> > Previously, I expect the only reason it was passing for some folks is 
> > that
> > unused I registers are somehow automatically set to 0 on Linux/x86.

> Unitialized I and N regs have more or less garbage.

Sort of.  It turns out they are automatically set to 0 only for a 
debugging build.  For a non-debugging build, they also sometimes end up 
being zero, but not always.  This is likely architecture and compiler 
dependent.  In the past, this has masked at least three problems in the 
test suite where uninitialized registers were inadvertantly used.

>                                                    See also:
> $ ./parrot --help-debug
> $ ./parrot -D40 ...

Unfortunately, that doesn't necessarily do anything.  The problem is
that -D40 (unlike many of the other -D flags) is only effective if you
are running a debugging build, which I'm not.

$ cat try1.pir
.sub main :main
        print "I1 = "
        print I1
        print "\n"
.end
$ ./parrot try1.pir
I1 = 0
$ ./parrot -D40 try1.pir
I1 = 0

Here's an example that does generate something in a non-initialized
register.  It turns out to be rather sensitive to the details of the
file.  Small changes make the value of '4437328' turn to either '37'
or '0'.

$ cat try2.pir
.sub main :main
        $P1 = new .File
        $S1 = "src"
        $I1 = $P1."is_file"($S1)
        print "$S1 = "
        print $S1
        print "\n"
        print "$I1 = "
        print $I1
        print "\n"
        print "I1 = "
        print I1
        print "\n"
ok1:
        print "ok 1\n"
ok2:
        print "ok 2\n"
        end
.end


$ ./parrot try2.pir
$S1 = src
$I1 = 0
I1 = 4437328
ok 1
ok 2

-- 
    Andy Dougherty              [EMAIL PROTECTED]

Reply via email to