diff options
author | Marek Polacek <polacek@redhat.com> | 2012-10-08 17:38:13 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2012-10-08 17:38:13 +0000 |
commit | ee84cd3713c1246afc473ae4acc9b6e061c206fe (patch) | |
tree | 3ccd528de449534d2eb9ed8fb56e11f0b643d079 /gcc | |
parent | da3202a857632b162eb6608ece2f4b48611a234e (diff) | |
download | gcc-ee84cd3713c1246afc473ae4acc9b6e061c206fe.zip gcc-ee84cd3713c1246afc473ae4acc9b6e061c206fe.tar.gz gcc-ee84cd3713c1246afc473ae4acc9b6e061c206fe.tar.bz2 |
re PR debug/54831 (ICE: in vt_add_function_parameter, at var-tracking.c:9412 with -O -fno-split-wide-types -g)
PR54831.
From-SVN: r192218
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/debug/pr54831.C | 20 | ||||
-rw-r--r-- | gcc/var-tracking.c | 13 |
3 files changed, 35 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 14bdc37..b7e0a64 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2012-10-08 Marek Polacek <polacek@redhat.com> + + PR debug/54831 + * var-tracking.c (vt_add_function_parameter): Use condition instead + of gcc_assert. + + * testsuite/g++.dg/debug/pr54831.C: New test. + 2012-10-08 Dehao Chen <dehao@google.com> * predict.c (predict_loops): Predict for short-circuit conditions. diff --git a/gcc/testsuite/g++.dg/debug/pr54831.C b/gcc/testsuite/g++.dg/debug/pr54831.C new file mode 100644 index 0000000..8e73120 --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/pr54831.C @@ -0,0 +1,20 @@ +// PR debug/54831 +// { dg-do compile } +// { dg-options "-O -fno-split-wide-types -g" } + +struct S +{ + int m1(); + int m2(); +}; + +typedef void (S::*mptr) (); + +mptr gmp; +void bar (mptr f); + +void foo (mptr f) +{ + f = gmp; + bar (f); +} diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index bbd2f4b..6a6cd42 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -9404,12 +9404,13 @@ vt_add_function_parameter (tree parm) if (parm != decl) { - /* Assume that DECL_RTL was a pseudo that got spilled to - memory. The spill slot sharing code will force the - memory to reference spill_slot_decl (%sfp), so we don't - match above. That's ok, the pseudo must have referenced - the entire parameter, so just reset OFFSET. */ - gcc_assert (decl == get_spill_slot_decl (false)); + /* If that DECL_RTL wasn't a pseudo that got spilled to + memory, bail out. Otherwise, the spill slot sharing code + will force the memory to reference spill_slot_decl (%sfp), + so we don't match above. That's ok, the pseudo must have + referenced the entire parameter, so just reset OFFSET. */ + if (decl != get_spill_slot_decl (false)) + return; offset = 0; } |