aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range.cc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2022-11-11 10:12:28 +0100
committerRichard Biener <rguenther@suse.de>2022-11-11 14:31:51 +0100
commitaf96500eea72c674a5686b35c66202ef2bd9688f (patch)
treeea5adc4eefb3f6fa63ae089208ed270781266bc9 /gcc/gimple-range.cc
parentbe2c74fdcd0e8d66c3667008ba2561ab5dcc379b (diff)
downloadgcc-af96500eea72c674a5686b35c66202ef2bd9688f.zip
gcc-af96500eea72c674a5686b35c66202ef2bd9688f.tar.gz
gcc-af96500eea72c674a5686b35c66202ef2bd9688f.tar.bz2
tree-optimization/107618 - enhance copy propagation of constants
The following enhances copy propagation of constants to also see through simple operations like conversions but also operations with otherwise constant operands. That's required to fulfill the promise /* Copy propagation also copy-propagates constants, this is necessary to forward object-size and builtin folding results properly. */ NEXT_PASS (pass_copy_prop); and avoid false diagnostics as shown in the testcase. We're using gimple_fold_stmt_to_constant_1 with not following SSA edges and accordingly adjust what stmts we simulate during SSA propagation. PR tree-optimization/107618 * tree-ssa-copy.cc (stmt_may_generate_copy): Simulate all assignments with a single SSA use. (copy_prop_visit_assignment): Use gimple_fold_stmt_to_constant_1 to perform simple constant folding. (copy_prop::visit_stmt): Visit all assignments. * gcc.dg/pr107618.c: New testcase.
Diffstat (limited to 'gcc/gimple-range.cc')
0 files changed, 0 insertions, 0 deletions