Commit c94c3532 by Eric Botcazou Committed by Eric Botcazou

gimple-ssa-store-merging.c: Include gimple-fold.h.

	* gimple-ssa-store-merging.c: Include gimple-fold.h.
	(struct store_immediate_info): Document BIT_INSERT_EXPR stores.
	(struct merged_store_group): Add bit_insertion field.
	(dump_char_array): Use standard hexadecimal format.
	(merged_store_group::merged_store_group): Set bit_insertion to false.
	(merged_store_group::apply_stores): Use optimal buffer size.  Deal
	with BIT_INSERT_EXPR stores.  Move up code updating the mask and
	also print the mask in the dump file.
	(pass_store_merging::gate): Minor tweak.
	(imm_store_chain_info::coalesce_immediate): Fix wrong association
	of stores with groups in dump.  Allow coalescing of BIT_INSERT_EXPR
	stores with INTEGER_CST stores.
	(count_multiple_uses) <BIT_INSERT_EXPR>: New case.
	(imm_store_chain_info::output_merged_store): Add try_bitpos variable
	and use it throughout.  Generate bit insertion sequences if need be.
	(pass_store_merging::process_store): Remove redundant condition.
	Record stores from a SSA name to a bit-field with BIT_INSERT_EXPR.

From-SVN: r261089
parent 3827838d
2018-06-01 Eric Botcazou <ebotcazou@adacore.com>
* gimple-ssa-store-merging.c: Include gimple-fold.h.
(struct store_immediate_info): Document BIT_INSERT_EXPR stores.
(struct merged_store_group): Add bit_insertion field.
(dump_char_array): Use standard hexadecimal format.
(merged_store_group::merged_store_group): Set bit_insertion to false.
(merged_store_group::apply_stores): Use optimal buffer size. Deal
with BIT_INSERT_EXPR stores. Move up code updating the mask and
also print the mask in the dump file.
(pass_store_merging::gate): Minor tweak.
(imm_store_chain_info::coalesce_immediate): Fix wrong association
of stores with groups in dump. Allow coalescing of BIT_INSERT_EXPR
stores with INTEGER_CST stores.
(count_multiple_uses) <BIT_INSERT_EXPR>: New case.
(imm_store_chain_info::output_merged_store): Add try_bitpos variable
and use it throughout. Generate bit insertion sequences if need be.
(pass_store_merging::process_store): Remove redundant condition.
Record stores from a SSA name to a bit-field with BIT_INSERT_EXPR.
2018-06-01 Segher Boessenkool <segher@kernel.crashing.org>
* config/rs6000/rs6000.c (rs6000_mangle_type): Change the mangling of
......
2018-06-01 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/store_merging_20.c: New test.
* gnat.dg/opt71.adb: Likewise.
* gnat.dg/opt71_pkg.ads: New helper.
2018-06-01 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/altivec-35.c (foo): Add builtin test vec_madds.
* gcc.target/powerpc/builtins-6-runnable.c (main): Fix typo for output.
Add vec_xst_be for signed and unsigned arguments.
......
/* { dg-do run } */
/* { dg-require-effective-target store_merge } */
/* { dg-options "-O2 -fdump-tree-store-merging" } */
extern void abort (void);
struct S1 {
unsigned int flag : 1;
unsigned int size : 31;
};
__attribute__((noipa))
void foo1 (struct S1 *s, unsigned int size)
{
s->flag = 1;
s->size = size & 0x7FFFFFFF;
}
struct S2 {
unsigned int flag : 1;
unsigned int size : 15;
unsigned short count;
};
__attribute__((noipa))
void foo2 (struct S2 *s, unsigned short size)
{
s->flag = 1;
s->size = size;
s->count = 0xABCD;
}
struct S3 {
unsigned int n1 : 4;
unsigned int c : 8;
unsigned int n2 : 4;
};
__attribute__((noipa))
void foo3 (struct S3 *s, unsigned char n1, unsigned char c, unsigned char n2)
{
s->n1 = n1 & 0xF;
s->n2 = n2 & 0xF;
s->c = c;
}
int main (void)
{
struct S1 s1;
struct S2 s2;
struct S3 s3;
foo1 (&s1, 0x12345678);
if (s1.flag != 1 || s1.size != 0x12345678)
abort ();
foo2 (&s2, 0x1234);
if (s2.flag != 1 || s2.size != 0x1234 || s2.count != 0xABCD)
abort ();
foo3 (&s3, 0x12, 0x34, 0x56);
if (s3.n1 != 0x2 || s3.c != 0x34 || s3.n2 != 0x6)
abort ();
return 0;
}
/* { dg-final { scan-tree-dump-times "Merging successful" 3 "store-merging" } } */
-- { dg-do compile }
-- { dg-require-effective-target store_merge }
-- { dg-options "-O2 -fdump-tree-store-merging" }
with Opt71_Pkg; use Opt71_Pkg;
procedure Opt71 (X : not null access Rec; Size : Positive) is
begin
X.all := (Flag => True, Size => Size);
end;
-- { dg-final { scan-tree-dump "Merging successful" "store-merging" } }
package Opt71_Pkg is
type Rec is record
Flag : Boolean;
Size : Positive;
end record;
pragma Pack (Rec);
end Opt71_Pkg;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment