public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug tdep/27007] New: [-m32] FAIL: gdb.cp/many-args.exp: check passing many structures
@ 2020-12-03 12:21 vries at gcc dot gnu.org
  2020-12-03 12:21 ` [Bug tdep/27007] " vries at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2020-12-03 12:21 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27007

            Bug ID: 27007
           Summary: [-m32] FAIL: gdb.cp/many-args.exp: check passing many
                    structures
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tdep
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

In more detail:
...
(gdb) PASS: gdb.cp/many-args.exp: continue to breakpoint: break-here
p check_val (ref_val, ref_val, ref_val, ref_val, ref_val, ref_val, ref_val,
ref_val, ref_val, ref_val, ref_val, ref_val, ref_val, ref_val, ref_val,
ref_val, ref_val, ref_val, ref_val, ref_val, ref_val, ref_val, ref_val,
ref_val, ref_val, ref_val, ref_val, ref_val, ref_val, ref_val, ref_val,
ref_val, ref_val, ref_val, ref_val, ref_val, ref_val, ref_val, ref_val,
ref_val)^M
$1 = false^M
(gdb) FAIL: gdb.cp/many-args.exp: check passing many structures
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tdep/27007] [-m32] FAIL: gdb.cp/many-args.exp: check passing many structures
  2020-12-03 12:21 [Bug tdep/27007] New: [-m32] FAIL: gdb.cp/many-args.exp: check passing many structures vries at gcc dot gnu.org
@ 2020-12-03 12:21 ` vries at gcc dot gnu.org
  2020-12-03 12:40 ` vries at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2020-12-03 12:21 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27007

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Minimal version:
...
$ cat gdb/testsuite/gdb.cp/many-args.cc      
typedef int v4si __attribute__ ((vector_size (16)));

struct ss
{
  static v4si static_field;
  unsigned char aa;
};

bool
check_val (ss v1, ss v2)
{
  return (v1.aa == 'a' && v2.aa == 'a');
}

int
main (void)
{
  ss ref_val = { 'a' };
  bool flag = check_val (ref_val, ref_val);
  return (flag ? 0 : 1);        /* break-here */
}
$ gcc -g gdb/testsuite/gdb.cp/many-args.cc -m32
$ ./a.out; echo $?
0
$ gdb -batch a.out -ex start -ex n -ex n -ex "p check_val (ref_val, ref_val)"
Temporary breakpoint 1 at 0x804842d: file gdb/testsuite/gdb.cp/many-args.cc,
line 18.

Temporary breakpoint 1, main () at gdb/testsuite/gdb.cp/many-args.cc:18
18        ss ref_val = { 'a' };
19        bool flag = check_val (ref_val, ref_val);
20        return (flag ? 0 : 1);        /* break-here */
$1 = false
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tdep/27007] [-m32] FAIL: gdb.cp/many-args.exp: check passing many structures
  2020-12-03 12:21 [Bug tdep/27007] New: [-m32] FAIL: gdb.cp/many-args.exp: check passing many structures vries at gcc dot gnu.org
  2020-12-03 12:21 ` [Bug tdep/27007] " vries at gcc dot gnu.org
@ 2020-12-03 12:40 ` vries at gcc dot gnu.org
  2020-12-03 12:44 ` vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2020-12-03 12:40 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27007

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
Hmm, i386_16_byte_align_p triggers on the static field.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tdep/27007] [-m32] FAIL: gdb.cp/many-args.exp: check passing many structures
  2020-12-03 12:21 [Bug tdep/27007] New: [-m32] FAIL: gdb.cp/many-args.exp: check passing many structures vries at gcc dot gnu.org
  2020-12-03 12:21 ` [Bug tdep/27007] " vries at gcc dot gnu.org
  2020-12-03 12:40 ` vries at gcc dot gnu.org
@ 2020-12-03 12:44 ` vries at gcc dot gnu.org
  2020-12-04 12:37 ` cvs-commit at gcc dot gnu.org
  2020-12-04 12:39 ` vries at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2020-12-03 12:44 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27007

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
Tentative patch:
...
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 8b07ca67b5..6223066ce0 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -2666,6 +2666,8 @@ i386_16_byte_align_p (struct type *type)
       int i;
       for (i = 0; i < type->num_fields (); i++)
        {
+         if (field_is_static (&type->field (i)))
+           continue;
          if (i386_16_byte_align_p (type->field (i).type ()))
            return 1;
        }
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tdep/27007] [-m32] FAIL: gdb.cp/many-args.exp: check passing many structures
  2020-12-03 12:21 [Bug tdep/27007] New: [-m32] FAIL: gdb.cp/many-args.exp: check passing many structures vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-12-03 12:44 ` vries at gcc dot gnu.org
@ 2020-12-04 12:37 ` cvs-commit at gcc dot gnu.org
  2020-12-04 12:39 ` vries at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-04 12:37 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27007

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

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

commit b6a6aa07c5bd53d19c33db1f7c9645fc99b66e1b
Author: Tom de Vries <tdevries@suse.de>
Date:   Fri Dec 4 13:36:48 2020 +0100

    [gdb/tdep] Handle static field in i386_16_byte_align_p

    When running test-case on gdb.cp/many-args.exp with target board unix/-m32,
I
    run into:
    ...
    (gdb) p check_val (ref_val, ref_val, ... , ref_val, ref_val)^M
    $1 = false^M
    (gdb) FAIL: gdb.cp/many-args.exp: check passing many structures
    ...

    The test source contains struct ss:
    ...
    typedef int v4si __attribute__ ((vector_size (16)));

    struct ss
    {
      static v4si static_field;
      unsigned char aa;
    };
    ...
    and i386_16_byte_align_p returns true for this type.

    Fix this by skipping static fields in i386_16_byte_align_p.

    Tested on x86_64-linux.

    gdb/ChangeLog:

    2020-12-04  Tom de Vries  <tdevries@suse.de>

            PR tdep/27007
            * i386-tdep.c (i386_16_byte_align_p): Skip static fields.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tdep/27007] [-m32] FAIL: gdb.cp/many-args.exp: check passing many structures
  2020-12-03 12:21 [Bug tdep/27007] New: [-m32] FAIL: gdb.cp/many-args.exp: check passing many structures vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-12-04 12:37 ` cvs-commit at gcc dot gnu.org
@ 2020-12-04 12:39 ` vries at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2020-12-04 12:39 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27007

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.1
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
Patch with fix committed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-12-04 12:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03 12:21 [Bug tdep/27007] New: [-m32] FAIL: gdb.cp/many-args.exp: check passing many structures vries at gcc dot gnu.org
2020-12-03 12:21 ` [Bug tdep/27007] " vries at gcc dot gnu.org
2020-12-03 12:40 ` vries at gcc dot gnu.org
2020-12-03 12:44 ` vries at gcc dot gnu.org
2020-12-04 12:37 ` cvs-commit at gcc dot gnu.org
2020-12-04 12:39 ` vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).