aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfghooks.h
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-02-22 08:38:14 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-02-22 08:38:14 +0000
commit229d576cde53ac4396583da3642ca969cca413d1 (patch)
tree90ee3349ab449b0ce61e8104f5c1086026142119 /gcc/cfghooks.h
parent3c8b06dcc68be1ba6dbb01fbbd32ba2a337dd3b8 (diff)
downloadgcc-229d576cde53ac4396583da3642ca969cca413d1.zip
gcc-229d576cde53ac4396583da3642ca969cca413d1.tar.gz
gcc-229d576cde53ac4396583da3642ca969cca413d1.tar.bz2
re PR tree-optimization/87609 (miscompilation with restrict and loop)
2019-02-22 Richard Biener <rguenther@suse.de> PR middle-end/87609 * cfghooks.h (dependence_hash): New typedef. (struct copy_bb_data): New type. (cfg_hooks::duplicate_block): Adjust to take a copy_bb_data argument. (duplicate_block): Likewise. * cfghooks.c (duplicate_block): Pass down copy_bb_data. (copy_bbs): Create and pass down copy_bb_data. * cfgrtl.c (cfg_layout_duplicate_bb): Adjust. (rtl_duplicate_bb): Likewise. * tree-cfg.c (gimple_duplicate_bb): If the copy_bb_data arg is not NULL remap dependence info. * gcc.dg/torture/restrict-7.c: New testcase. From-SVN: r269098
Diffstat (limited to 'gcc/cfghooks.h')
-rw-r--r--gcc/cfghooks.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/cfghooks.h b/gcc/cfghooks.h
index 8244f5a..e9385c9 100644
--- a/gcc/cfghooks.h
+++ b/gcc/cfghooks.h
@@ -54,6 +54,19 @@ struct profile_record
bool run;
};
+typedef int_hash <unsigned short, 0> dependence_hash;
+
+/* Optional data for duplicate_block. */
+
+struct copy_bb_data
+{
+ copy_bb_data() : dependence_map (NULL) {}
+ ~copy_bb_data () { delete dependence_map; }
+
+ /* A map from the copied BBs dependence info cliques to
+ equivalents in the BBs duplicated to. */
+ hash_map<dependence_hash, unsigned short> *dependence_map;
+};
struct cfg_hooks
{
@@ -112,7 +125,7 @@ struct cfg_hooks
bool (*can_duplicate_block_p) (const_basic_block a);
/* Duplicate block A. */
- basic_block (*duplicate_block) (basic_block a);
+ basic_block (*duplicate_block) (basic_block a, copy_bb_data *);
/* Higher level functions representable by primitive operations above if
we didn't have some oddities in RTL and Tree representations. */
@@ -227,7 +240,8 @@ extern void tidy_fallthru_edges (void);
extern void predict_edge (edge e, enum br_predictor predictor, int probability);
extern bool predicted_by_p (const_basic_block bb, enum br_predictor predictor);
extern bool can_duplicate_block_p (const_basic_block);
-extern basic_block duplicate_block (basic_block, edge, basic_block);
+extern basic_block duplicate_block (basic_block, edge, basic_block,
+ copy_bb_data * = NULL);
extern bool block_ends_with_call_p (basic_block bb);
extern bool empty_block_p (basic_block);
extern basic_block split_block_before_cond_jump (basic_block);