From: Marek Polacek Date: Mon, 2 May 2016 07:42:06 +0000 (+0000) Subject: Fix ICE in dump_pred_graph X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6b9933b9b483b37bbed0a83e6631fff8de14a1f8;p=gcc.git Fix ICE in dump_pred_graph 2016-05-02 Marek Polacek Tom de Vries PR tree-optimization/70700 * tree-ssa-structalias.c (dump_pred_graph): Fix getting varinfo for ids bigger than FIRST_REF_NODE. * gcc.dg/pr70700.c: New test. Co-Authored-By: Tom de Vries From-SVN: r235700 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e88ca467c59..b2a7a238918 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-05-02 Marek Polacek + Tom de Vries + + PR tree-optimization/70700 + * tree-ssa-structalias.c (dump_pred_graph): Fix getting varinfo for ids + bigger than FIRST_REF_NODE. + 2016-05-02 Oleg Endo PR target/52898 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cee09bc1251..c4f45fa8b6c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-05-02 Marek Polacek + Tom de Vries + + PR tree-optimization/70700 + * gcc.dg/pr70700.c: New test. + 2016-05-01 Uros Bizjak * gcc.target/i386/avx256-unaligned-load-1.c: Update scan strings. diff --git a/gcc/testsuite/gcc.dg/pr70700.c b/gcc/testsuite/gcc.dg/pr70700.c new file mode 100644 index 00000000000..613cd29fc1f --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr70700.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -fdump-tree-ealias-graph" } */ + +struct S +{ + long m; +}; + +struct S +fn1 (struct S *a) +{ + if (a->m) + a->m |= 2; + return *a; +} diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 0a4149489a9..d66bdfa94ce 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -2241,7 +2241,11 @@ dump_pred_graph (struct scc_info *si, FILE *file) if (graph->points_to[i] && !bitmap_empty_p (graph->points_to[i])) { - fprintf (file, "[label=\"%s = {", get_varinfo (i)->name); + if (i < FIRST_REF_NODE) + fprintf (file, "[label=\"%s = {", get_varinfo (i)->name); + else + fprintf (file, "[label=\"*%s = {", + get_varinfo (i - FIRST_REF_NODE)->name); unsigned j; bitmap_iterator bi; EXECUTE_IF_SET_IN_BITMAP (graph->points_to[i], 0, j, bi)