public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Aditya Kamath1 <Aditya.Kamath1@ibm.com>,
	Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	"tom@tromey.com" <tom@tromey.com>
Cc: Sangamesh Mallayya <sangamesh.swamy@in.ibm.com>,
	"simon.marchi@efficios.com" <simon.marchi@efficios.com>
Subject: Re: [PATCH] Modify align-c/align-c++ test case for AIX
Date: Thu, 6 Apr 2023 17:18:05 +0100	[thread overview]
Message-ID: <cd583f88-264f-97e4-2fd7-308fbfbf7480@palves.net> (raw)
In-Reply-To: <CH2PR15MB3544E623998D23053A2F649ED6919@CH2PR15MB3544.namprd15.prod.outlook.com>

Às 14:15 de 06/04/2023, Aditya Kamath1 escreveu:
> Hi Pedro, Ulrich, Tom and community,
> 
> I actually made a mistake while I was experimenting. I copied this line 
> in two places resulting in this hunk by mistake which was not required. 
> That is why I saw the error of initialising a non-static member. I 
> apologise for the same.

Ah, OK.  Makes sense now.  No worries.


> I am okay with the patch with change ID = 
> I874b717afde7b6fb1e45e526912b518a20a12716 pasted to me on the 29^th of 
> March. It is the same in AIX as well. Kindly commit the same.

Alright, merged.

> 
> 
> Only one more problem Pedro, Tom and Ulrich..
> Consider the code below..
> 
> #include <iostream>
> 
> using namespace std;
> 
> #define DEF(T,U) struct align_pair_ ## T ## _x_ ## U { T one; U two; }
> 
> DEF (char, double);
> 
> struct align_pair_char_x_double item_char_x_double;
> 
> int main (){
> 
>      int x = alignof (struct align_pair_char_x_double);
> 
>      printf ("%d \n", x);
> 
>      return 0;
> 
> }
> 
> The output of this in linux is 8. But in AIX is 4. Though the size is 8 
> for double, alignment is 4.
> 
> bash-5.1$ ~/gdb_tests/align
> 
> 4

That it's different between Linux and AIX does not by itself indicate
a problem.

> 
> So we have failures in all test cases involving double data type in AIX.

... because GDB's alignof operator returns 8?

It sounds like what the compiler says is the type's alignment differs
from GDB's built-in knowledge of the type's alignment.  I.e., GDB
alignof implementation returns the wrong alignment.  This is exactly the
sort of bug that the testcase is meant to catch.

Grepping around, it doesn't seem like AIX installs a gdbarch_type_align
hook, so the fix may to install one, and make it handle the double type
specially.

Pedro Alves

  reply	other threads:[~2023-04-06 16:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10  8:57 Aditya Kamath1
2023-03-10 14:46 ` Tom Tromey
2023-03-13 13:04   ` Aditya Kamath1
2023-03-13 14:10     ` Ulrich Weigand
2023-03-15 11:52       ` Aditya Kamath1
2023-03-15 12:45         ` Tom Tromey
2023-03-16  7:01           ` Aditya Kamath1
2023-03-17 17:06             ` Ulrich Weigand
2023-03-17 22:03             ` Tom Tromey
2023-03-21  7:01               ` Aditya Kamath1
2023-03-21  7:41                 ` Ulrich Weigand
2023-03-21 11:05                   ` Pedro Alves
2023-03-21 14:17                   ` Tom Tromey
2023-03-21 14:26                     ` Ulrich Weigand
2023-03-29 11:28                       ` Aditya Kamath1
2023-03-29 13:36                         ` Pedro Alves
2023-03-31 12:29                           ` Aditya Kamath1
2023-04-04 13:24                             ` Aditya Kamath1
2023-04-05 16:33                             ` Pedro Alves
2023-04-06 13:15                               ` Aditya Kamath1
2023-04-06 16:18                                 ` Pedro Alves [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-03-10  8:56 Aditya Kamath1
2023-03-10 10:08 ` Aditya Kamath1

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cd583f88-264f-97e4-2fd7-308fbfbf7480@palves.net \
    --to=pedro@palves.net \
    --cc=Aditya.Kamath1@ibm.com \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sangamesh.swamy@in.ibm.com \
    --cc=simon.marchi@efficios.com \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).