This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, i386]: Fix PR 60017 Struct not returned correctly
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 2 Feb 2014 17:35:19 +0100
- Subject: Re: [PATCH, i386]: Fix PR 60017 Struct not returned correctly
- Authentication-results: sourceware.org; auth=none
- References: <CAFULd4aUzEJO1DVBDRgXQKg2tunW1mRbNkmNHUVfbB7bETQtAA at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sun, Feb 02, 2014 at 04:31:35PM +0100, Uros Bizjak wrote:
> There is off-by-one error in classify_argument, when processing
> integer atomic types. When bit_offset is 64, two X86_64_INTEGER CLASS
> registers should be used.
>
> Attached patch fixes this off-by-one error, so we won't use size = 0
> when bit_offset = 64.
>
> 2014-02-02 Uros Bizjak <ubizjak@gmail.com>
>
> PR target/60017
> * config/i386/i386.c (classify_argument): Fix handling of bit_offset
> when calculating size of integer atomic types.
>
> testsuite/ChangeLog:
>
> 2014-02-02 Uros Bizjak <ubizjak@gmail.com>
>
> PR target/60017
> * gcc.c-torture/execute/pr60017.c: New test.
>
> Tested on x86_64-linux-gnu, committed to mainline SVN.
Isn't it something for -Wpsabi warning, or is purely a bug, where the
affected structures just aren't passed correctly that way at all
(arguments/return values?), meaning that the value passed by caller doesn't
match the value seen by callee or vice versa? Does it affect passing of
following arguments? If yes, that could still be worthwhile to warn about,
say for programs that pass such structures and something after that as
parameters, but don't actually look at the problematic structure argument
or only look at the first few bytes from it, just care about the next
argument.
Jakub