6c: extern registers must be considered used on return

the peephole optimizer would remove stores to extern
register before a return statement as it would think
they are only set, but not used.
This commit is contained in:
cinap_lenrek 2021-11-17 01:23:57 +00:00
parent 3473fa237c
commit fc412aef3d

View file

@ -890,6 +890,8 @@ copyu(Prog *p, Adr *v, Adr *s)
return 0; return 0;
case ARET: /* funny */ case ARET: /* funny */
if(REGEXT && v->type <= REGEXT && v->type > exregoffset)
return 2;
if(v->type == REGRET || v->type == FREGRET) if(v->type == REGRET || v->type == FREGRET)
return 2; return 2;
if(s != A) if(s != A)