PR tree-optimization/84503
commitcf5e422bfbdae5c03fc9342beed10993519a95a0
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Feb 2018 08:28:42 +0000 (22 08:28 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Feb 2018 08:28:42 +0000 (22 08:28 +0000)
tree38ab37d523c307e1c49bcda952b3c3b0814ed074
parent859495c7c14b6a277b9e07134cf042aa3557d1fd
PR tree-optimization/84503
* gimple-ssa-store-merging.c (merged_store_group::merge_into): Compute
width as info->bitpos + info->bitsize - start.
(merged_store_group::merge_overlapping): Simplify width computation.
(check_no_overlap): New function.
(imm_store_chain_info::try_coalesce_bswap): Compute expected
start + width and last_order of the group, fail if check_no_overlap
fails.
(imm_store_chain_info::coalesce_immediate_stores): Don't merge info
to group if check_no_overlap fails.

* gcc.dg/pr84503-1.c: New test.
* gcc.dg/pr84503-2.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257891 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/gimple-ssa-store-merging.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr84503-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr84503-2.c [new file with mode: 0644]