--- Comment #20 from Jakub Jelinek <jakub at gcc dot> ---
Created attachment 47814

WIP patch, so far only the store covering all the bits (the reconstruction from
pieces could be done later) for non-byte aligned positions or sizes and only
done for little endian (of course will handle big endian next); the last hunk
is the workaround for the premature optimization, so if we nuke it for GCC11
and replace with it done late, that hunk can be removed.  The rest of the patch
IMHO can be useful even for later, e.g.
union U {
  struct S { int a : 1, b : 4, c : 27; } s;
  struct T { int d : 2; int e : 2; int f : 28; } t;

foo (void)
  union U u;
  u.s.b = 10;
  return u.t.e;
wasn't optimized into return 1; until combine without this patch, now fre1 can
do it already.
Thoughts on this?
And, where should the shifting functions from gimple-ssa-store-merging.c go? 
Either they can stay where they are and have gimple-ssa-store-merging.h that
declares them, or say fold-const.[ch]?

Reply via email to