This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][GCC][mid-end] Fix DSE big-endian subreg crash


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]