From 94715c179098ab86bf188fae4a32e2283c5f173f Mon Sep 17 00:00:00 2001 From: Kevin Buettner Date: Sat, 23 Jan 2016 15:06:08 -0700 Subject: [PATCH] rx: Treat scalars larger than 8 bytes as aggregates in rx_push_dummy_call. This patch fixes the following failures (which are also GDB internal errors) for the -m64bit-doubles multilib: FAIL: gdb.base/callfuncs.exp: p t_double_complex_values(dc1, dc2) (GDB internal error) FAIL: gdb.base/callfuncs.exp: p t_double_complex_values(dc3, dc4) (GDB internal error) FAIL: gdb.base/callfuncs.exp: p t_double_complex_many_args(dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4) (GDB internal error) FAIL: gdb.base/callfuncs.exp: p t_double_complex_many_args(dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1) (GDB internal error) FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_values(ldc1, ldc2) (GDB internal error) FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_values(ldc3, ldc4) (GDB internal error) FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_many_args(ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4) (GDB internal error) FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_many_args(ldc1, ldc1, ldc1, ldc1, ldc1, ldc1, ldc1,ldc1, ldc1, ldc1, ldc1, ldc1, ldc1, ldc1, ldc1, ldc1) (GDB internal error) FAIL: gdb.base/callfuncs.exp: noproto: p t_double_complex_values(dc1, dc2) (GDB internal error) FAIL: gdb.base/callfuncs.exp: noproto: p t_double_complex_values(dc3, dc4) (GDB internal error) FAIL: gdb.base/callfuncs.exp: noproto: p t_double_complex_many_args(dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4) (GDB internal error) FAIL: gdb.base/callfuncs.exp: noproto: p t_double_complex_many_args(dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1) (GDB internal error) FAIL: gdb.base/callfuncs.exp: noproto: p t_long_double_complex_values(ldc1, ldc2) (GDB internal error) FAIL: gdb.base/callfuncs.exp: noproto: p t_long_double_complex_values(ldc3, ldc4) (GDB internal error) FAIL: gdb.base/callfuncs.exp: noproto: p t_long_double_complex_many_args(ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4) (GDB internal error) FAIL: gdb.base/callfuncs.exp: noproto: p t_long_double_complex_many_args(ldc1, ldc1, ldc1, ldc1, ldc1, ldc1, ldc1,ldc1, ldc1, ldc1, ldc1, ldc1, ldc1, ldc1, ldc1, ldc1) (GDB internal error) FAIL: gdb.base/varargs.exp: print find_max_double_real(4, dc1, dc2, dc3, dc4) (GDB internal error) FAIL: gdb.base/varargs.exp: print find_max_long_double_real(4, ldc1, ldc2, ldc3, ldc4) (GDB internal error) The assertion failure which is tripped is: gdb_assert (arg_size <= 4); While it may seem that the patch ought to disallow scalars larger than 4, scalars of size 8 are explicitly handled by the code elsewhere. This came up because gcc has a complex type that is 16 bytes in length when 64-bit doubles are used. gdb/ChangeLog: * rx-tdep.c (rx_push_dummy_call): Treat scalars larger than 8 bytes as aggregates. --- gdb/ChangeLog | 5 +++++ gdb/rx-tdep.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f5e8891..0958c5b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2016-01-27 Kevin Buettner + + * rx-tdep.c (rx_push_dummy_call): Treat scalars larger than 8 + bytes as aggregates. + 2016-01-27 Joel Brobecker * MAINTAINERS (Responsible Maintainers): Add Keith Seitz as diff --git a/gdb/rx-tdep.c b/gdb/rx-tdep.c index 2732608..904aebd 100644 --- a/gdb/rx-tdep.c +++ b/gdb/rx-tdep.c @@ -813,7 +813,8 @@ rx_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct_addr); } else if (TYPE_CODE (arg_type) != TYPE_CODE_STRUCT - && TYPE_CODE (arg_type) != TYPE_CODE_UNION) + && TYPE_CODE (arg_type) != TYPE_CODE_UNION + && arg_size <= 8) { /* Argument is a scalar. */ if (arg_size == 8) -- 2.7.4