* when deciding about the case code generation in case of size optimization, the number of labels is relevant, not the covered range, resolves #34818

git-svn-id: trunk@40851 -
This commit is contained in:
florian 2019-01-13 10:32:00 +00:00
parent dd072ce76b
commit 644c47e121
3 changed files with 27 additions and 1 deletions

1
.gitattributes vendored
View File

@ -16474,6 +16474,7 @@ tests/webtbs/tw3474.pp svneol=native#text/plain
tests/webtbs/tw3477.pp svneol=native#text/plain
tests/webtbs/tw3478.pp svneol=native#text/plain
tests/webtbs/tw3479.pp svneol=native#text/plain
tests/webtbs/tw34818.pp svneol=native#text/pascal
tests/webtbs/tw34848.pp svneol=native#text/pascal
tests/webtbs/tw3489.pp svneol=native#text/plain
tests/webtbs/tw3490.pp svneol=native#text/plain

View File

@ -1259,7 +1259,7 @@ implementation
(max_label<=high(aint)) and
not((labelcnt<=2) or
(distv.svalue<0) or
(dist>3*TrueCount)) then
(dist>3*labelcnt)) then
begin
{ if the labels less or more a continuum then }
genjumptable(labels,min_label.svalue,max_label.svalue);

25
tests/webtbs/tw34818.pp Normal file
View File

@ -0,0 +1,25 @@
{ %OPT=-O1s }
program Project1;
var CharValue: cardinal;
begin
CharValue:=12;
case CharValue of
$00000000..$0000007f:begin
writeln('ok');
halt(0);
end;
$00000080..$000007ff:begin
halt(1);
end;
$00000800..$0000ffff:begin
halt(1);
end;
$00010000..$0010ffff:begin
halt(1);
end;
$00200000..$03ffffff:begin
halt(1);
end;
end;
end.