mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 07:26:24 +02:00
cs_opt_consts: disable when non-local gotos are active
This optimisation can insert code after the call to fpc_setjmp, resulting in it not getting executed after a longjmp. Fixes tmacnonlocalgoto on AArch64 with -O2 or higher.
This commit is contained in:
parent
5b73fc4d0e
commit
d12bf094ab
@ -1314,7 +1314,11 @@ implementation
|
|||||||
if cs_opt_use_load_modify_store in current_settings.optimizerswitches then
|
if cs_opt_use_load_modify_store in current_settings.optimizerswitches then
|
||||||
do_optloadmodifystore(code);
|
do_optloadmodifystore(code);
|
||||||
|
|
||||||
if cs_opt_consts in current_settings.optimizerswitches then
|
if (cs_opt_consts in current_settings.optimizerswitches) and
|
||||||
|
{ non-local gotos can cause an fpc_setjmp call to be generated before
|
||||||
|
this block, which means the loaded value won't be loaded when the
|
||||||
|
longjmp is performed }
|
||||||
|
not(m_non_local_goto in current_settings.modeswitches) then
|
||||||
do_consttovar(code);
|
do_consttovar(code);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user