Test suite results for test file webtbs/tw3782.pp

Test run data :

Free Pascal Compiler Test Suite Results

View Test suite results

Please specify search criteria:
File:
Operating system:
Processor:
Version
Date
Submitter
Machine
Comment
Limit
Cond
Category
Only failed tests
Hide skipped tests
List all tests

Test file "webtbs/tw3782.pp" information:

t_id 1537
t_cpu i386
t_adddate 2005/03/25
t_result 0
t_knownrunerror 0
t_opts -Ogr

Detailed test run results:

Record count: 50

Total = 50

OK=6 Percentage= 12.00

Skipped=44 Percentage= 88.00

Result type Cat. Count Percentage First date Last Date
Successfully run 6 12.0 2024/05/08 03:32:00 26 2024/05/08 03:58:00 25
i386 6 100.0 2024/05/08 03:32:00 26 2024/05/08 03:58:00 25
linux 5 83.3 2024/05/08 03:32:00 26 2024/05/08 03:58:00 25
go32v2 1 16.7 2024/05/08 03:49:00 59 2024/05/08 03:49:00 59
3.2.3 6 100.0 2024/05/08 03:32:00 26 2024/05/08 03:58:00 25
Skipping test because for other cpu 44 88.0 2024/05/08 03:27:00 38 2024/05/08 04:18:00 21
sparc 2 4.5 2024/05/08 03:54:00 52 2024/05/08 04:02:00 39
x86_64 36 81.8 2024/05/08 03:27:00 27 2024/05/08 04:18:00 21
powerpc64 3 6.8 2024/05/08 03:37:00 60 2024/05/08 04:10:00 55
aarch64 3 6.8 2024/05/08 03:27:00 38 2024/05/08 03:58:00 39
linux 41 93.2 2024/05/08 03:27:00 38 2024/05/08 04:18:00 21
solaris 2 4.5 2024/05/08 03:54:00 52 2024/05/08 04:02:00 39
win64 1 2.3 2024/05/08 03:29:00 39 2024/05/08 03:29:00 39
3.3.1 22 50.0 2024/05/08 03:28:00 28 2024/05/08 04:18:00 21
3.2.3 22 50.0 2024/05/08 03:27:00 38 2024/05/08 04:17:00 35

Source:

{ %cpu=i386 }
{ %opt=-Ogr }

{$mode delphi}

type
  my_rec = record
    my_field: string;
    end;

var
 my_fyl: my_rec;
 my_str: array[0..99] of char;

function my_func(var f: my_rec):PChar;
begin
  my_func:=@my_str[1];
end;

procedure my_proc(var f: my_rec; const s: String);
var i, len: Integer; wascur: PChar;
begin
  len := length(s);
  wascur := my_func(f);
  for i:=0 to len-1 do
   wascur[i]:=s[i+1];
end;

begin
my_proc(my_fyl,'xxx');
my_str[0]:='y';
writeln(my_str);
end.

{
It's a spilling bug:

# [23] wascur[i]:=s[i+1];
         movl    -8(%ebp),%ireg23d
         # Register %ireg24d allocated
         movl    %ireg16d,%ireg24d
         incl    %ireg24d
         # Register %ireg24d released
         # Register %ireg25d allocated
         movl    %ireg24d,%ireg25d
         # Register %ireg26d allocated
        movl    -12(%ebp),%ireg26d
         # Register %ireg26d released
         # Register %edi allocated
         leal    (%ireg26d,%ireg16d,1),%edi
         # Register %ireg23d,%ireg25d released

becomes

# [23] wascur[i]:=s[i+1];
         movl    -8(%ebp),%edx
         # Register %ecx allocated
         movl    -20(%ebp),%ecx
         incl    %ecx
         # Register %eax allocated
        movl    -12(%ebp),%eax
         # Register %eax released
         # Register %edi,%eax allocated
        movl    -20(%ebp),%eax
         # Register %eax released
         leal    (%eax,%eax,1),%edi
         # Register %edx,%ecx released


ireg16d is spilled to -20(%ebp), so before the leal it must be loaded
into a register. The spilling code picks eax, but that one is already
used at that moment (by ireg26d).
}

Link to SVN view of webtbs/tw3782.pp source.