From: Richard Biener Date: Tue, 5 Sep 2017 08:15:21 +0000 (+0000) Subject: re PR tree-optimization/82102 (ICE: Segmentation fault in /home/arnd/git/gcc/gcc... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a0f8cad6254428d0f9b95f7328aa0c20207aa5a9;p=gcc.git re PR tree-optimization/82102 (ICE: Segmentation fault in /home/arnd/git/gcc/gcc/tree-ssa-pre.c:4863) 2017-09-05 Richard Biener PR tree-optimization/82102 * tree-ssa-pre.c (fini_eliminate): Check if lhs is NULL. * gcc.dg/torture/pr82102.c: New testcase. From-SVN: r251692 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7a824f82a2e..5f60fe27690 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-09-05 Richard Biener + + PR tree-optimization/82102 + * tree-ssa-pre.c (fini_eliminate): Check if lhs is NULL. + 2017-09-05 Martin Liska PR tree-optimization/82032 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 28691293aa6..a21730089ed 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-09-05 Richard Biener + + PR tree-optimization/82102 + * gcc.dg/torture/pr82102.c: New testcase. + 2017-09-05 Eric Botcazou * testsuite/gnat.dg/array29.ad[sb]: New test. diff --git a/gcc/testsuite/gcc.dg/torture/pr82102.c b/gcc/testsuite/gcc.dg/torture/pr82102.c new file mode 100644 index 00000000000..393f8bf9590 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr82102.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ + +void *a, *b; +struct pt3_i2cbuf { + int num_cmds; +} c; +void *memcpy(void *, void *, __SIZE_TYPE__); +void put_stop(); +void translate(struct pt3_i2cbuf *p1, int p2) +{ + p1->num_cmds = 0; + if (p2) + put_stop(); +} +void pt3_i2c_master_xfer(int p1) +{ + translate(&c, p1); + memcpy(a, b, c.num_cmds); + for (; p1;) + ; +} diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 185c19268ec..f6fa3bbddc0 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -4860,6 +4860,7 @@ fini_eliminate (void) lhs = gimple_get_lhs (stmt); if (inserted_exprs + && lhs && TREE_CODE (lhs) == SSA_NAME && bitmap_bit_p (inserted_exprs, SSA_NAME_VERSION (lhs))) continue;