public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] harden cond: broaden detaching constraint
@ 2021-11-19 13:32 Alexandre Oliva
0 siblings, 0 replies; only message in thread
From: Alexandre Oliva @ 2021-11-19 13:32 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:13b33e79588cedfcdfd8a08c23f65dc76a92789d
commit 13b33e79588cedfcdfd8a08c23f65dc76a92789d
Author: Alexandre Oliva <oliva@adacore.com>
Date: Fri Nov 19 10:31:44 2021 -0300
harden cond: broaden detaching constraint
The asm statements used to prevent the hardening compares from being
optimized out as redundant are too narrow, unintentionally forcing
values into general registers, which is inefficient, undesirable, and
occasionally conflicting with machine expectations as to which modes
go in which registers.
This patch extends the constraint of the asm to accept any kind of
register, besides everything that was already accepted as a general
operand.
for gcc/ChangeLog
PR target/103097
PR middle-end/103149
* gimple-harden-conditionals.cc (detach_value): Broaden the
asm constraints to accept any kind of register.
Diff:
---
gcc/gimple-harden-conditionals.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/gimple-harden-conditionals.cc b/gcc/gimple-harden-conditionals.cc
index cfa2361d65b..8cf7f2cab47 100644
--- a/gcc/gimple-harden-conditionals.cc
+++ b/gcc/gimple-harden-conditionals.cc
@@ -132,13 +132,13 @@ detach_value (location_t loc, gimple_stmt_iterator *gsip, tree val)
tree ret = make_ssa_name (TREE_TYPE (val));
SET_SSA_NAME_VAR_OR_IDENTIFIER (ret, SSA_NAME_IDENTIFIER (val));
- /* Output asm ("" : "=g" (ret) : "0" (val)); */
+ /* Output asm ("" : "=gX" (ret) : "0" (val)); */
vec<tree, va_gc> *inputs = NULL;
vec<tree, va_gc> *outputs = NULL;
vec_safe_push (outputs,
build_tree_list
(build_tree_list
- (NULL_TREE, build_string (2, "=g")),
+ (NULL_TREE, build_string (3, "=gX")),
ret));
vec_safe_push (inputs,
build_tree_list
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-19 13:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-19 13:32 [gcc(refs/users/aoliva/heads/testme)] harden cond: broaden detaching constraint Alexandre Oliva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).