diff options
| -rw-r--r-- | memops.c | 5 | ||||
| -rw-r--r-- | validation/mem2reg/dead-phisrc.c | 17 |
2 files changed, 22 insertions, 0 deletions
@@ -134,6 +134,11 @@ static void simplify_loads(struct basic_block *bb) goto next_load; } rewrite_load_instruction(insn, dominators); + } else { // cleanup pending phi-sources + pseudo_t phi; + FOR_EACH_PTR(dominators, phi) { + kill_instruction(phi->def); + } END_FOR_EACH_PTR(phi); } } next_load: diff --git a/validation/mem2reg/dead-phisrc.c b/validation/mem2reg/dead-phisrc.c new file mode 100644 index 00000000..4e4f6a8b --- /dev/null +++ b/validation/mem2reg/dead-phisrc.c @@ -0,0 +1,17 @@ +static void foo(void) +{ + extern int *a; + + if (a || *a) + ; + if (a[0] || a[1]) + ; +} + +/* + * check-name: dead-phisrc + * check-command: test-linearize $file + * + * check-output-ignore + * check-output-excludes: phisrc + */ |
