summaryrefslogtreecommitdiff
path: root/ChangeLog
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2020-04-09 14:37:21 +0200
committerMartin Jambor <mjambor@suse.cz>2020-04-09 14:37:21 +0200
commit2111d5406a4ec56d6335bde779a995914d0a36d1 (patch)
treed3e35dc3a2eb4373abb505764ee5d9a5261a958c /ChangeLog
parent830c572428758f134bd001e699a08e622e2452c3 (diff)
sra: Fix sra_modify_expr handling of partial writes (PR 94482)
when sra_modify_expr is invoked on an expression that modifies only part of the underlying replacement, such as a BIT_FIELD_REF on a LHS of an assignment and the SRA replacement's type is not compatible with what is being replaced (0th operand of the B_F_R in the above example), it does not work properly, basically throwing away the partd of the expr that should have stayed intact. This is fixed in two ways. For BIT_FIELD_REFs, which operate on the binary image of the replacement (and so in a way serve as a VIEW_CONVERT_EXPR) we just do not bother with convertsing. For REALPART_EXPRs and IMAGPART_EXPRs, if the replacement is not a register, we insert a VIEW_CONVERT_EXPR under the complex partial access expression, which is always OK, for loads from registers we take the extra step of converting it to a temporary. This revealed a bug in fwprop which is fixed with the hunk from Richi. The testcase for handling REALPART_EXPR and IMAGPART_EXPR is a bit fragile because SRA prefers complex and vector types over anything else (and in between the two it decides based on TYPE_UID which in my testing today always preferred complex types) and so I only run it at -O1 (which is the only level where the the test fails for me). Bootstrapped and tested on x86_64-linux, i686-linux and aarch64-linux. 2020-04-09 Martin Jambor <mjambor@suse.cz> Richard Biener <rguenther@suse.de> PR tree-optimization/94482 * tree-sra.c (create_access_replacement): Dump new replacement with TDF_UID. (sra_modify_expr): Fix handling of cases when the original EXPR writes to only part of the replacement. * tree-ssa-forwprop.c (pass_forwprop::execute): Properly verify the first operand of combinations into REAL/IMAGPART_EXPR and BIT_FIELD_REF. testsuite/ * gcc.dg/torture/pr94482.c: New test. * gcc.dg/tree-ssa/pr94482-2.c: Likewise.
Diffstat (limited to 'ChangeLog')
0 files changed, 0 insertions, 0 deletions