diff options
author | Richard Guenther <rguenther@suse.de> | 2011-11-08 15:14:21 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-11-08 15:14:21 +0000 |
commit | a59526334d3f36a43f94cdd29ac661eb59260bc6 (patch) | |
tree | c1be7c2707ddb53067f9ffca959dccdfcc6aaf44 /gcc | |
parent | 07f03cd34884a0635d571eeb21fa61c6d2c690ca (diff) | |
download | gcc-a59526334d3f36a43f94cdd29ac661eb59260bc6.zip gcc-a59526334d3f36a43f94cdd29ac661eb59260bc6.tar.gz gcc-a59526334d3f36a43f94cdd29ac661eb59260bc6.tar.bz2 |
re PR middle-end/51010 (bad diagnostics: #'ssa_name' not supported by pp_c_expression#]')
2011-11-08 Richard Guenther <rguenther@suse.de>
PR middle-end/51010
c-family/
* c-pretty-print.c (pp_c_expression): Handle SSA_NAMEs.
cp/
* error.c (dump_expr): Handle SSA_NAMEs.
* c-c++-common/uninit-pr51010.c: New testcase.
From-SVN: r181165
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-family/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-family/c-pretty-print.c | 7 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/error.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/c-c++-common/uninit-pr51010.c | 13 |
6 files changed, 42 insertions, 0 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 914c916..9716cc9 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2011-11-08 Richard Guenther <rguenther@suse.de> + + PR middle-end/51010 + c-family/ + 2011-11-07 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Torvald Riegel <triegel@redhat.com> diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c index 9119561..be28b39 100644 --- a/gcc/c-family/c-pretty-print.c +++ b/gcc/c-family/c-pretty-print.c @@ -2129,6 +2129,13 @@ pp_c_expression (c_pretty_printer *pp, tree e) pp_primary_expression (pp, e); break; + case SSA_NAME: + if (!DECL_ARTIFICIAL (SSA_NAME_VAR (e))) + pp_c_expression (pp, SSA_NAME_VAR (e)); + else + pp_c_ws_string (pp, M_("<unknown>")); + break; + case POSTINCREMENT_EXPR: case POSTDECREMENT_EXPR: case ARRAY_REF: diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 15b44b5..2f3bf21 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2011-11-08 Richard Guenther <rguenther@suse.de> + + PR middle-end/51010 + * error.c (dump_expr): Handle SSA_NAMEs. + 2011-11-07 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Torvald Riegel <triegel@redhat.com> diff --git a/gcc/cp/error.c b/gcc/cp/error.c index d2b6a62..602cb75 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1792,6 +1792,13 @@ dump_expr (tree t, int flags) | TFF_NO_FUNCTION_ARGUMENTS)); break; + case SSA_NAME: + if (!DECL_ARTIFICIAL (SSA_NAME_VAR (t))) + dump_expr (SSA_NAME_VAR (t), flags); + else + pp_cxx_ws_string (cxx_pp, M_("<unknown>")); + break; + case INTEGER_CST: case REAL_CST: case STRING_CST: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 72c6d43..6fb865c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-11-08 Richard Guenther <rguenther@suse.de> + + PR middle-end/51010 + * c-c++-common/uninit-pr51010.c: New testcase. + 2011-11-08 Jakub Jelinek <jakub@redhat.com> * lib/target-supports.exp (check_effective_target_vect_call_sqrtf, diff --git a/gcc/testsuite/c-c++-common/uninit-pr51010.c b/gcc/testsuite/c-c++-common/uninit-pr51010.c new file mode 100644 index 0000000..f28da46 --- /dev/null +++ b/gcc/testsuite/c-c++-common/uninit-pr51010.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O -Wuninitialized" } */ + +int f (int j) +{ + int a [10]; + return a [j]; /* { dg-warning "a\\\[j\\\]. is used uninitialized" } */ +} +int g (int j) +{ + int a [10]; + return a [j+1]; /* { dg-warning "a\\\[<unknown>\\\]. is used uninitialized" } */ +} |