Commit d397e394 by Jakub Jelinek

re PR c++/89187 (ICE in initialize_argument_information, at calls.c:2023)

	PR c++/89187
	* optimize.c (maybe_thunk_body): Clear TREE_ADDRESSABLE on
	PARM_DECLs of the thunk.
	* lambda.c (maybe_add_lambda_conv_op): Likewise.

	* g++.dg/opt/pr89187.C: New test.

From-SVN: r268564
parent 216090cc
2019-02-05 Jakub Jelinek <jakub@redhat.com>
PR c++/89187
* optimize.c (maybe_thunk_body): Clear TREE_ADDRESSABLE on
PARM_DECLs of the thunk.
* lambda.c (maybe_add_lambda_conv_op): Likewise.
2019-02-05 Marek Polacek <polacek@redhat.com> 2019-02-05 Marek Polacek <polacek@redhat.com>
PR c++/89158 - by-value capture of constexpr variable broken. PR c++/89158 - by-value capture of constexpr variable broken.
......
...@@ -1130,6 +1130,9 @@ maybe_add_lambda_conv_op (tree type) ...@@ -1130,6 +1130,9 @@ maybe_add_lambda_conv_op (tree type)
{ {
tree new_node = copy_node (src); tree new_node = copy_node (src);
/* Clear TREE_ADDRESSABLE on thunk arguments. */
TREE_ADDRESSABLE (new_node) = 0;
if (!fn_args) if (!fn_args)
fn_args = tgt = new_node; fn_args = tgt = new_node;
else else
......
...@@ -417,6 +417,8 @@ maybe_thunk_body (tree fn, bool force) ...@@ -417,6 +417,8 @@ maybe_thunk_body (tree fn, bool force)
gcc_assert (clone_parm); gcc_assert (clone_parm);
DECL_ABSTRACT_ORIGIN (clone_parm) = NULL; DECL_ABSTRACT_ORIGIN (clone_parm) = NULL;
args[parmno] = clone_parm; args[parmno] = clone_parm;
/* Clear TREE_ADDRESSABLE on thunk arguments. */
TREE_ADDRESSABLE (clone_parm) = 0;
clone_parm = TREE_CHAIN (clone_parm); clone_parm = TREE_CHAIN (clone_parm);
} }
if (fn_parm_typelist) if (fn_parm_typelist)
......
2019-02-05 Andrea Corallo <andrea.corallo@arm.com> 2019-02-05 Jakub Jelinek <jakub@redhat.com>
PR c++/89187
* g++.dg/opt/pr89187.C: New test.
2019-02-05 Andrea Corallo <andrea.corallo@arm.com>
* jit.dg/add-driver-options-testlib.c: Add support file for * jit.dg/add-driver-options-testlib.c: Add support file for
test-add-driver-options.c testcase. test-add-driver-options.c testcase.
......
// PR c++/89187
// { dg-do compile { target c++11 } }
// { dg-options "-Os -fno-tree-ccp -fno-tree-sra -fno-inline" }
template <typename T, int N> struct A {
typedef T __attribute__((vector_size (N))) type;
};
template <typename T, int N> using B = typename A<T, N>::type;
template <typename T> using C = B<T, 4>;
struct D {
D (C<int> x) : d{x[3]} {}
D foo () { return d; }
C<int> d;
};
extern D d;
struct { D bar () { return d; } } l;
struct E { void baz () const; };
void
E::baz () const
{
l.bar ().foo ();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment