This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix wrong code on aarch64 due to paradoxical subreg
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Jeff Law <law at redhat dot com>,Segher Boessenkool <segher at kernel dot crashing dot org>,Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>,Eric Botcazou <ebotcazou at adacore dot com>,Bernd Schmidt <bschmidt at redhat dot com>,Andreas Schwab <schwab at linux-m68k dot org>,Tamar Christina <tamar dot christina at arm dot com>
- Date: Tue, 02 Aug 2016 19:46:16 +0200
- Subject: Re: [PATCH] Fix wrong code on aarch64 due to paradoxical subreg
- Authentication-results: sourceware.org; auth=none
- References: <AM4PR0701MB21624450BD0047719BD173B7E40E0@AM4PR0701MB2162.eurprd07.prod.outlook.com> <49bd77c6-d53c-ddb1-3fed-d4c0a0d50869@redhat.com> <AM4PR0701MB216299726E688EB475257445E4000@AM4PR0701MB2162.eurprd07.prod.outlook.com> <20160729070216.GC28169@gate.crashing.org> <AM4PR0701MB2162FFEEC57D48DD8E16302BE4010@AM4PR0701MB2162.eurprd07.prod.outlook.com> <AM4PR0701MB2162F00D769B15645676D3ACE4020@AM4PR0701MB2162.eurprd07.prod.outlook.com> <20160730113914.GB32017@gate.crashing.org> <HE1PR0701MB21692482680A44B517210F30E4030@HE1PR0701MB2169.eurprd07.prod.outlook.com> <b0103dfc-7483-6c99-988a-b5c0751f9cc3@redhat.com> <AM4PR0701MB2162EA5A1EBF0B96CC4F473CE4040@AM4PR0701MB2162.eurprd07.prod.outlook.com> <20160801233118.GF1742@gate.crashing.org> <12a38b46-ed4c-f8a2-6621-2abddfc7dcb9@redhat.com>
On August 2, 2016 5:21:34 PM GMT+02:00, Jeff Law <law@redhat.com> wrote:
>On 08/01/2016 05:31 PM, Segher Boessenkool wrote:
>> Hi,
>>
>> On Mon, Aug 01, 2016 at 06:52:54PM +0000, Bernd Edlinger wrote:
>>> On 08/01/16 19:54, Jeff Law wrote:
>>>> Looks like you've probably nailed it. It'll be interesting see if
>>>> there's any fallout (though our RTL optimizer testing is pretty
>weak, so
>>>> even if there were, I doubt we'd catch it).
>>>
>>> If there is, it will probably a performance regression...
>>
>> I tested building Linux with and without the patch, on many archs.
>> The few that show differences are:
>>
>> alpha 6148872 6148776
>> ia64 16946958 16946670
>> s390 12345770 12345850
>> tile 12016086 12016070
>>
>> (left before, right after; arm and aarch64 did not build, kernel
>problems).
>>
>> So all except s390 generate smaller code even.
>They're all deep enough in the noise that I wouldn't care either way
>:-)
>
>>
>>> However I think there are more paradoxical subregs generated all
>over,
>>> but the aarch64 insv code pattern did trigger more hidden bugs than
>>> any other port. It is certainly unfortunate that the major source
>>> of paradoxical subreg is in a target-dependent code path :(
>>
>> It is certainly unfortunate that paradoxical subregs exist at all!
>:-)
>Yea. It probably seemed like a good idea 25-30 years ago, but I always
>
>cringe when I see them being used. Yea it gives the compiler some more
>
>freedom, but more often than not I think we'd be better off with real
>extensions.
But we love to exploit undefined behavior elsewhere, too. Now the init-regs pass comes to my mind again (papering over issues elsewhere)..
Richard.
>jeff