diff options
author | Xi Ruoyao <xry111@xry111.site> | 2023-03-15 15:34:52 +0800 |
---|---|---|
committer | Xi Ruoyao <xry111@xry111.site> | 2023-03-15 17:28:13 +0800 |
commit | 45641f3a99281bb0a429649741a29c2aace4c63e (patch) | |
tree | 15089cf7c6fcf11508ea436428b074301a1cf5a5 /gcc/fortran | |
parent | 02fcaf412ae9508b75efa9602cd4ac58bc63d6a4 (diff) | |
download | gcc-45641f3a99281bb0a429649741a29c2aace4c63e.zip gcc-45641f3a99281bb0a429649741a29c2aace4c63e.tar.gz gcc-45641f3a99281bb0a429649741a29c2aace4c63e.tar.bz2 |
builtins: Move the character difference into result instead of reassigning result [PR109086]
expand_simple_binop() is allowed to allocate a new pseudo-register and
return it, instead of forcing the result into the provided
pseudo-register. This can cause a problem when we expand the unrolled
loop for __builtin_strcmp: the compiler always generates code for all n
iterations of the loop, so "result" will be an alias of the
pseudo-register allocated and used in the last iteration; but at runtime
the loop can break early, causing this pseudo-register uninitialized.
Emit a move instruction in the iteration to force the difference into
one register which has been allocated before the loop, to avoid this
issue.
gcc/ChangeLog:
PR other/109086
* builtins.cc (inline_string_cmp): Force the character
difference into "result" pseudo-register, instead of reassign
the pseudo-register.
Diffstat (limited to 'gcc/fortran')
0 files changed, 0 insertions, 0 deletions