diff options
author | Richard Biener <rguenther@suse.de> | 2019-11-05 13:29:52 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2019-11-05 13:29:52 +0000 |
commit | c265dfbf748e9fc3006a0f844294ef2cea145d71 (patch) | |
tree | b5cdf144d28fdfcf0ed650dd26cbbf9b6e682513 /gcc/match.pd | |
parent | d9adca6e663070311c73cbd7dc9d73e7713aa315 (diff) |
re PR target/92280 (gcc.target/i386/pr83008.c FAILs)
2019-11-05 Richard Biener <rguenther@suse.de>
PR tree-optimization/92280
* match.pd (BIT_FIELD_REF of CTOR): Unless the original CTOR
had a single use do not create a new CTOR.
* tree-ssa-forwprop.c (simplify_bitfield_ref): Do not re-fold
BIT_FIELD_REF of a CTOR via GENERIC.
From-SVN: r277832
Diffstat (limited to 'gcc/match.pd')
-rw-r--r-- | gcc/match.pd | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/gcc/match.pd b/gcc/match.pd index 2c82287f216..eabd01fc115 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -5565,15 +5565,19 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (if (elt < CONSTRUCTOR_NELTS (ctor)) (view_convert { CONSTRUCTOR_ELT (ctor, elt)->value; }) { build_zero_cst (type); }) - { - vec<constructor_elt, va_gc> *vals; - vec_alloc (vals, count); - for (unsigned i = 0; - i < count && elt + i < CONSTRUCTOR_NELTS (ctor); ++i) - CONSTRUCTOR_APPEND_ELT (vals, NULL_TREE, - CONSTRUCTOR_ELT (ctor, elt + i)->value); - build_constructor (type, vals); - }))) + /* We don't want to emit new CTORs unless the old one goes away. + ??? Eventually allow this if the CTOR ends up constant or + uniform. */ + (if (single_use (@0)) + { + vec<constructor_elt, va_gc> *vals; + vec_alloc (vals, count); + for (unsigned i = 0; + i < count && elt + i < CONSTRUCTOR_NELTS (ctor); ++i) + CONSTRUCTOR_APPEND_ELT (vals, NULL_TREE, + CONSTRUCTOR_ELT (ctor, elt + i)->value); + build_constructor (type, vals); + })))) /* The bitfield references a single constructor element. */ (if (k.is_constant (&const_k) && idx + n <= (idx / const_k + 1) * const_k) |