aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2020-11-20 12:21:12 +0100
committerEric Botcazou <ebotcazou@adacore.com>2020-11-20 12:24:08 +0100
commit1b3c9813675dc8e3ca03aa6c1624c668ac7fea1d (patch)
treed8a03ef598966b995f46708c34c190214fe35b7d /gcc/gimplify.c
parentcd287abe8cd11cfe9b230b0c9f28e86ecd7859e6 (diff)
downloadgcc-1b3c9813675dc8e3ca03aa6c1624c668ac7fea1d.zip
gcc-1b3c9813675dc8e3ca03aa6c1624c668ac7fea1d.tar.gz
gcc-1b3c9813675dc8e3ca03aa6c1624c668ac7fea1d.tar.bz2
Plug loophole in string store merging
There is a loophole in new string store merging support added recently: it does not check that the stores are consecutive, which is obviously required if you want to concatenate them... Simple fix attached, the nice thing being that it can fall back to the regular processing if any hole is detected in the series of stores, thanks to the handling of STRING_CST by native_encode_expr. gcc/ChangeLog: * gimple-ssa-store-merging.c (struct merged_store_group): Add new 'consecutive' field. (merged_store_group): Set it to true. (do_merge): Set it to false if the store is not consecutive and set string_concatenation to false in this case. (merge_into): Call do_merge on entry. (merge_overlapping): Likewise. gcc/testsuite/ChangeLog: * gnat.dg/opt90a.adb: New test. * gnat.dg/opt90b.adb: Likewise. * gnat.dg/opt90c.adb: Likewise. * gnat.dg/opt90d.adb: Likewise. * gnat.dg/opt90e.adb: Likewise. * gnat.dg/opt90a_pkg.ads: New helper. * gnat.dg/opt90b_pkg.ads: Likewise. * gnat.dg/opt90c_pkg.ads: Likewise. * gnat.dg/opt90d_pkg.ads: Likewise. * gnat.dg/opt90e_pkg.ads: Likewise.
Diffstat (limited to 'gcc/gimplify.c')
0 files changed, 0 insertions, 0 deletions