gpc issue with some record structure
I did some further investigations on the gpc issue I recently discovered on Mac OS X 10.4.10 PowerPC (gpc 20070904, based on gcc-4.1.2). The following program exhibits the problem: program schorn3; type abc = record a, b, c: Extended; end; const d = 22092007.192016; procedure outer; var x: abc; procedure inner(p: abc); begin if x.a = d then writeln('OK') else writeln('Fail. Got x.a = ', x.a, '. Expected x.a =', d); end; begin { outer } x.a := d; inner(x); end; begin outer; end. The following behavior is observed: peter% /Developer/Pascal/gpc412/bin/gpc -o schorn3 schorn3.pas peter% schorn3 Fail. Got x.a = -3.066700750256657e-231. Expected x.a = 2.209200719201600e+07 Now with --pack-struct (although it seems there is nothing to pack) peter% /Developer/Pascal/gpc412/bin/gpc --pack-struct -o schorn3 schorn3.pas peter% schorn3 OK The previous test program for this issue caused bus errors or segmentation faults on Macintoshes but also had a chance to succeed by chance (only a boolean at a possibly wrong address was tested). Maybe the issue now shows up on other platforms as well. Peter ----- peter.schorn at acm.org
participants (5)
-
Adriaan van Os -
Gale Paeper -
Maurice Lombardi -
Peter Schorn -
Russell Whitaker