Discussion:
[Bug gdb/22943] New: [aarch64] Failures in gdb.base/infcall-nested-structs.exp
alahay01 at gcc dot gnu.org
2018-03-09 09:50:29 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22943

Bug ID: 22943
Summary: [aarch64] Failures in
gdb.base/infcall-nested-structs.exp
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: alahay01 at gcc dot gnu.org
Target Milestone: ---

Commit dbbb1059e62e9fed10b429c030f76f782cbc1fc4 (gdb: Initial baremetal riscv
support) added a new test set gdb.base/infcall-nested-structs.exp

When run these test expose existing issues on aarch64:

FAIL: gdb.base/infcall-nested-structs.exp: types-tfc: p/d check_arg_struct01
(ref_val_struct01)
FAIL: gdb.base/infcall-nested-structs.exp: types-tfc: check return value
struct01
FAIL: gdb.base/infcall-nested-structs.exp: types-tfc: p/d check_arg_struct02
(ref_val_struct02)
FAIL: gdb.base/infcall-nested-structs.exp: types-tfc: check return value
struct02
FAIL: gdb.base/infcall-nested-structs.exp: types-tfc: p/d check_arg_struct03
(ref_val_struct03)
FAIL: gdb.base/infcall-nested-structs.exp: types-tfc: check return value
struct03
FAIL: gdb.base/infcall-nested-structs.exp: types-tfc: p/d check_arg_struct04
(ref_val_struct04)
FAIL: gdb.base/infcall-nested-structs.exp: types-tfc: check return value
struct04
FAIL: gdb.base/infcall-nested-structs.exp: types-tdc: p/d check_arg_struct01
(ref_val_struct01)
FAIL: gdb.base/infcall-nested-structs.exp: types-tdc: check return value
struct01
FAIL: gdb.base/infcall-nested-structs.exp: types-tdc: p/d check_arg_struct02
(ref_val_struct02)
FAIL: gdb.base/infcall-nested-structs.exp: types-tdc: check return value
struct02
FAIL: gdb.base/infcall-nested-structs.exp: types-tdc: p/d check_arg_struct03
(ref_val_struct03)
FAIL: gdb.base/infcall-nested-structs.exp: types-tdc: check return value
struct03
FAIL: gdb.base/infcall-nested-structs.exp: types-tdc: p/d check_arg_struct04
(ref_val_struct04)
FAIL: gdb.base/infcall-nested-structs.exp: types-tdc: check return value
struct04
FAIL: gdb.base/infcall-nested-structs.exp: types-tldc: p/d check_arg_struct01
(ref_val_struct01)
FAIL: gdb.base/infcall-nested-structs.exp: types-tldc: p/d check_arg_struct02
(ref_val_struct02)
FAIL: gdb.base/infcall-nested-structs.exp: types-tldc: p/d check_arg_struct03
(ref_val_struct03)
FAIL: gdb.base/infcall-nested-structs.exp: types-tldc: p/d check_arg_struct04
(ref_val_struct04)
FAIL: gdb.base/infcall-nested-structs.exp: types-tf-tf: p/d check_arg_struct01
(ref_val_struct01)
FAIL: gdb.base/infcall-nested-structs.exp: types-tf-tf: check return value
struct01
FAIL: gdb.base/infcall-nested-structs.exp: types-tf-tf: p/d check_arg_struct02
(ref_val_struct02)
FAIL: gdb.base/infcall-nested-structs.exp: types-tf-tf: check return value
struct02
FAIL: gdb.base/infcall-nested-structs.exp: types-tf-tf: p/d check_arg_struct03
(ref_val_struct03)
FAIL: gdb.base/infcall-nested-structs.exp: types-tf-tf: check return value
struct03
FAIL: gdb.base/infcall-nested-structs.exp: types-tf-tf: p/d check_arg_struct04
(ref_val_struct04)
FAIL: gdb.base/infcall-nested-structs.exp: types-tf-tf: check return value
struct04
FAIL: gdb.base/infcall-nested-structs.exp: types-td-td: p/d check_arg_struct01
(ref_val_struct01)
FAIL: gdb.base/infcall-nested-structs.exp: types-td-td: p/d check_arg_struct02
(ref_val_struct02)
FAIL: gdb.base/infcall-nested-structs.exp: types-td-td: p/d check_arg_struct03
(ref_val_struct03)
FAIL: gdb.base/infcall-nested-structs.exp: types-td-td: p/d check_arg_struct04
(ref_val_struct04)
FAIL: gdb.base/infcall-nested-structs.exp: types-tld-tld: p/d
check_arg_struct01 (ref_val_struct01)
FAIL: gdb.base/infcall-nested-structs.exp: types-tld-tld: p/d
check_arg_struct02 (ref_val_struct02)
FAIL: gdb.base/infcall-nested-structs.exp: types-tld-tld: p/d
check_arg_struct03 (ref_val_struct03)
FAIL: gdb.base/infcall-nested-structs.exp: types-tld-tld: p/d
check_arg_struct04 (ref_val_struct04)

# of expected passes 1064
# of unexpected failures 36


Looks like aarch64 is not recursively parsing structures when making an
inferior call.

With the following code, making a "call print2(s)" in gdb, gdb should put the
arguments into float registers:

struct s2
{
struct
{
float f1;
} s2;
};

static void
print2 (struct s2 s)
{}

See the TYPE_CODE_STRUCT section in is_hfa_or_hva() in aarch64-tdep.c
--
You are receiving this mail because:
You are on the CC list for the bug.
alahay01 at gcc dot gnu.org
2018-03-09 09:58:47 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22943

Alan Hayward <alahay01 at gcc dot gnu.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |andrew.burgess at embecosm dot com
Assignee|unassigned at sourceware dot org |alahay01 at gcc dot gnu.org

--- Comment #1 from Alan Hayward <alahay01 at gcc dot gnu.org> ---
Taking as actively looking at it.

Adding Andrew to CC as he added the test. (You didn't break anything - just
exposed an existing issue :) )
--
You are receiving this mail because:
You are on the CC list for the bug.
cvs-commit at gcc dot gnu.org
2018-08-29 11:10:04 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22943

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Alan Hayward <***@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4f4aedebed5397ba285c2abcd13fa0206d8af291

commit 4f4aedebed5397ba285c2abcd13fa0206d8af291
Author: Alan Hayward <***@arm.com>
Date: Wed Aug 29 11:41:45 2018 +0100

Aarch64: Float register detection for return values

Use aapcs_is_vfp_call_or_return_candidate to detect float register
args.

gdb/
PR gdb/22943:
* aarch64-tdep.c (is_hfa_or_hva): Remove function.
(aarch64_extract_return_value): Use
aapcs_is_vfp_call_or_return_candidate.
(aarch64_return_in_memory): Likewise.
(aarch64_store_return_value): Likewise.
--
You are receiving this mail because:
You are on the CC list for the bug.
alahay01 at gcc dot gnu.org
2018-08-29 11:12:34 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22943

Alan Hayward <alahay01 at gcc dot gnu.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED

--- Comment #3 from Alan Hayward <alahay01 at gcc dot gnu.org> ---
On aarch64:


make check-gdb RUNTESTFLAGS="gdb.base/infcall-nested-structs.exp"

# of expected passes 3500
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-08-29 10:10:17 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22943

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at sourceware dot org
Target Milestone|--- |8.3

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
You may want to ask Joel about putting this into 8.2.
--
You are receiving this mail because:
You are on the CC list for the bug.
alahay01 at gcc dot gnu.org
2018-08-29 16:03:47 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22943

Alan Hayward <alahay01 at gcc dot gnu.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |brobecker at adacore dot com

--- Comment #5 from Alan Hayward <alahay01 at gcc dot gnu.org> ---
Tom:
My reason
--
You are receiving this mail because:
You are on the CC list for the bug.
alahay01 at gcc dot gnu.org
2018-08-29 10:36:01 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22943

--- Comment #6 from Alan Hayward <alahay01 at gcc dot gnu.org> ---
Tom:
I initially wasn't going to suggest this because this a bug that has always
been in the aarch64 port and it hadn't been noticed until the test suite was
added. However, it could quite easily trip up anyone doing a "call" on a
function that is passing around structs by value.

Joel:
What do you think?
Changes are restricted to the aarch64 port. It's quite a complex change - but
it is based on exisiting gcc code.
--
You are receiving this mail because:
You are on the CC list for the bug.
brobecker at gnat dot com
2018-08-30 13:56:49 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22943

Joel Brobecker <brobecker at gnat dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |brobecker at gnat dot com

--- Comment #7 from Joel Brobecker <brobecker at gnat dot com> ---
I am really torn; although the code is as you say based on GCC code, so it
helps convincing ourselves that at least the intent should be correct, it is
still possible that it caused some regressions. Given that this is not a
regression, and given the fact that this touches inferior function call in
general and no one reported it before the test appeared, I would tend to be on
the conservative side, and leave this out of 8.2.
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...