diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-03-10 16:33:04 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-03-10 16:33:04 +0100 |
commit | e260b0a7dda804cd2bd0beee477d47ce9c01d4c0 (patch) | |
tree | 9961619e7d8b0c379157514d3bc89a496171ee28 /gcc/cp/optimize.c | |
parent | da0ced6eb890fbb1cbe1da7bc620dc6ef9f13246 (diff) | |
download | gcc-e260b0a7dda804cd2bd0beee477d47ce9c01d4c0.zip gcc-e260b0a7dda804cd2bd0beee477d47ce9c01d4c0.tar.gz gcc-e260b0a7dda804cd2bd0beee477d47ce9c01d4c0.tar.bz2 |
re PR c++/79899 (ICE in ctor_omit_inherited_parms at gcc/cp/method.c:576 on ARM target)
PR c++/79899
* optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
Use XALLOCAVEC macro.
* g++.dg/other/friend7.C: New test.
From-SVN: r246038
Diffstat (limited to 'gcc/cp/optimize.c')
-rw-r--r-- | gcc/cp/optimize.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c index 933612c..d646ef7 100644 --- a/gcc/cp/optimize.c +++ b/gcc/cp/optimize.c @@ -262,7 +262,7 @@ maybe_thunk_body (tree fn, bool force) populate_clone_array (fn, fns); /* Don't use thunks if the base clone omits inherited parameters. */ - if (ctor_omit_inherited_parms (fns[0])) + if (fns[0] && ctor_omit_inherited_parms (fns[0])) return 0; DECL_ABSTRACT_P (fn) = false; @@ -324,7 +324,7 @@ maybe_thunk_body (tree fn, bool force) if (length > max_parms) max_parms = length; } - args = (tree *) alloca (max_parms * sizeof (tree)); + args = XALLOCAVEC (tree, max_parms); /* We know that any clones immediately follow FN in TYPE_METHODS. */ FOR_EACH_CLONE (clone, fn) |