From: Rudolf Polzer Date: Wed, 2 May 2012 08:27:31 +0000 (+0200) Subject: work around QCC STORE_V bug X-Git-Tag: xonotic-v0.7.0~55^2~26 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=99737dee776f8b60436c2b944b2ca3ae69f2efde;p=xonotic%2Fxonotic.git work around QCC STORE_V bug --- diff --git a/misc/tools/progs-analyzer.pl b/misc/tools/progs-analyzer.pl index a6528d2b..95a66132 100644 --- a/misc/tools/progs-analyzer.pl +++ b/misc/tools/progs-analyzer.pl @@ -661,8 +661,18 @@ sub find_uninitialized_locals($$) my ($ip, $state, $s, $c) = @_; my $op = $s->{op}; + # QCVM BUG: RETURN always takes vector, there is no float equivalent my $return_hack = $c->{isreturn} // 0; + if($op eq 'STORE_V') + { + # COMPILER BUG of QCC: params are always copied using STORE_V + if($s->{b} >= 4 && $s->{b} < 28) # parameter range + { + $return_hack = 1; + } + } + for(qw(a b c)) { my $type = $c->{$_}; @@ -681,7 +691,8 @@ sub find_uninitialized_locals($$) my $valid = $state->{$ofs}{valid}; if($valid->[0] == 0) { - if($return_hack <= 2 and ($op ne 'OR' && $op ne 'AND' || $_ ne 'b')) # fteqcc logicops cause this + # COMPILER BUG of FTEQCC: AND and OR may take uninitialized as second argument (logicops) + if($return_hack <= 2 and ($op ne 'OR' && $op ne 'AND' || $_ ne 'b')) { print "; Use of uninitialized value $ofs in $func->{debugname} at $ip.$_\n"; ++$warned{$ip}{$_}; @@ -689,7 +700,8 @@ sub find_uninitialized_locals($$) } elsif($valid->[0] < 0) { - if($return_hack <= 2 and ($op ne 'OR' && $op ne 'AND' || $_ ne 'b')) # fteqcc logicops cause this + # COMPILER BUG of FTEQCC: AND and OR may take uninitialized as second argument (logicops) + if($return_hack <= 2 and ($op ne 'OR' && $op ne 'AND' || $_ ne 'b')) { print "; Use of temporary $ofs across CALL in $func->{debugname} at $ip.$_\n"; ++$warned{$ip}{$_};