aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-10-04 11:34:27 +0200
committerRichard Biener <rguenther@suse.de>2021-10-04 16:53:25 +0200
commit7e0c0500808d58bca5b8e23cbd474022c32234e4 (patch)
tree72b45f5368fadaa6410ef148ea6139f0a8160e2d /gcc/expr.c
parent55a3be2f5255d69e740d61b2c5aaba1ccbc643b8 (diff)
downloadgcc-7e0c0500808d58bca5b8e23cbd474022c32234e4.zip
gcc-7e0c0500808d58bca5b8e23cbd474022c32234e4.tar.gz
gcc-7e0c0500808d58bca5b8e23cbd474022c32234e4.tar.bz2
middle-end/102285 - refine .DEFERRED_INIT expansion
This refines the way we figure whether we are facing a register that cannot be initialized by emitting a memset away from inspecting expanded RTL of the LHS to using the predicates expand_assignment is using to detect decls or MEM_REFs with non-memory DECL_RTL. 2021-10-04 Richard Biener <rguenther@suse.de> * expr.h (non_mem_decl_p): Declare. (mem_ref_refers_to_non_mem_p): Likewise. * expr.c (non_mem_decl_p): Export. (mem_ref_refers_to_non_mem_p): Likewise. * internal-fn.c (expand_DEFERRED_INIT): Do not expand the LHS but check the base with mem_ref_refers_to_non_mem_p and non_mem_decl_p. * c-c++-common/pr102285.c: New testcase.
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index e0bcbcc..eb33643 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -5305,7 +5305,7 @@ get_bit_range (poly_uint64_pod *bitstart, poly_uint64_pod *bitend, tree exp,
has non-BLKmode. DECL_RTL must not be a MEM; if
DECL_RTL was not set yet, return false. */
-static inline bool
+bool
non_mem_decl_p (tree base)
{
if (!DECL_P (base)
@@ -5322,7 +5322,7 @@ non_mem_decl_p (tree base)
/* Returns true if REF refers to an object that does not
reside in memory and has non-BLKmode. */
-static inline bool
+bool
mem_ref_refers_to_non_mem_p (tree ref)
{
tree base;