This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][GCC][mid-end] Fix DSE big-endian subreg crash
- From: Jeff Law <law at redhat dot com>
- To: Tamar Christina <tamar dot christina at arm dot com>, gcc-patches at gcc dot gnu dot org
- Cc: nd at arm dot com, rguenther at suse dot de, ian at airs dot com
- Date: Mon, 20 Aug 2018 12:43:36 -0600
- Subject: Re: [PATCH][GCC][mid-end] Fix DSE big-endian subreg crash
- References: <20180815125709.GA31341@arm.com>
On 08/15/2018 06:57 AM, Tamar Christina wrote:
> Hi All,
>
> This patch fixes an ICE that would happen when extract_low_bits
> is called with modes for which you can't extract a valid subreg.
> e.g. taking a 32 bytes subreg from a 48 byte mode.
>
> The ICE happens because convert_modes which eventually calls
> simplify_gen_subreg does not expect the convertion to fail.
>
> The assert in gen_lowpart_general would then be hit. The patch
> changes it to validate the subreg before trying to convert the
> modes. If the subreg is not possible we return NULL_RTX and bail
> out early.
>
> I don't have a target independent test for this because it depends
> on the target having a 48byte mode and using it for loads.
>
> Cross compiled and regtested on
> aarch64_be-none-elf
> and no issues
>
> Boostrapped and regtested
> aarch64-none-linux-gnu
>
> and found no issues.
>
> Bootstrapped on
> x86_64-pc-linux-gnu
> arm-none-linux-gnueabihf
>
> and no issues.
>
> Ok for trunk?
>
> Thanks,
> Tamar
>
> gcc/ChangeLog:
>
> 2018-08-15 Tamar Christina <tamar.christina@arm.com>
>
> * expmed.c (extract_low_bits): Reject invalid subregs early.
>
> gcc/testsuite/ChangeLog:
>
> 2018-08-15 Tamar Christina <tamar.christina@arm.com>
>
> * gcc.target/aarch64/large_struct_copy.c: New test.
>
OK.
jeff