aboutsummaryrefslogtreecommitdiff
path: root/libgomp/task.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2021-11-15 09:56:56 +0100
committerAldy Hernandez <aldyh@redhat.com>2021-11-15 13:16:57 +0100
commitfcdf49a0ad3282761c7ac72103407ca4ec4d6968 (patch)
tree6328aae9664a7f2f481be0fac5fc35371cb5061d /libgomp/task.c
parent540d92ae9b629eb40dc45a5d76b0f0d0222bf4e0 (diff)
downloadgcc-fcdf49a0ad3282761c7ac72103407ca4ec4d6968.zip
gcc-fcdf49a0ad3282761c7ac72103407ca4ec4d6968.tar.gz
gcc-fcdf49a0ad3282761c7ac72103407ca4ec4d6968.tar.bz2
Fix PHI ordering problems in the path solver.
After auditing the PHI range calculations, I'm not convinced we've caught all the corner cases. They haven't shown up in the wild (yet), but better safe than sorry. We shouldn't write anything to the cache or trigger additional lookups while calculating a PHI, as this may cause ordering problems. We should resolve the PHI with either the cache as it stands, or by asking for ranges on entry to the path. I've documented this. There was one dubious case where we called fold_range in ssa_range_in_phi, which mostly by luck wasn't triggering lookups, because fold_range solves a PHI by calling range_on_edge, which is set to pick up global ranges by default in path_range_query. This is fragile, so I've rewritten the call to explicitly use cached or global ranges. Also, the cache should be avoided in ssa_range_in_phi when the arg is defined in the PHI's block, as not doing so could create an ordering problem. We have a similar check when calculating relations in PHIs. Tested on x86-64 & ppc64le Linux. gcc/ChangeLog: * gimple-range-path.cc (path_range_query::internal_range_of_expr): Remove useless code. (path_range_query::ssa_defined_in_bb): New. (path_range_query::ssa_range_in_phi): Avoid fold_range call that could trigger additional lookups. Do not use the cache for ARGs defined in this block. (path_range_query::compute_ranges_in_block): Use ssa_defined_in_bb. (path_range_query::maybe_register_phi_relation): Same. (path_range_query::range_of_stmt): Adjust comment. * gimple-range-path.h (ssa_defined_in_bb): New.
Diffstat (limited to 'libgomp/task.c')
0 files changed, 0 insertions, 0 deletions