This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, ARM] Fix PR target/59142: internal compiler error while compiling OpenCV 2.4.7
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Charles Baylis <charles dot baylis at linaro dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>
- Date: Mon, 25 Nov 2013 14:54:25 +0000
- Subject: Re: [PATCH, ARM] Fix PR target/59142: internal compiler error while compiling OpenCV 2.4.7
- Authentication-results: sourceware.org; auth=none
- References: <CADnVucA91aS83S46Ep+4fW+bYr6OTnVDosK7YAq-LntMt3O8FQ at mail dot gmail dot com>
On 25/11/13 11:33, Charles Baylis wrote:
> This bug reveals a long standing problem in the ARM ldm/stm patterns
> which allow the virtual hardware register 'afp' to be used. A similar
> problem may affect vfp_pop_multiple_with_writeback, so that is also
> addressed.
>
> I have not included a test case, as the original preprocessed source
> is rather bulky, and automated reduction seems to result in a file
> which does not robustly reproduce the problem across different gcc
> versions.
>
> PR target/59142
> gcc/
> * config/arm/predicates.md: New predicates
> arm_hard_general_register_operand, vfp_hard_register_operand.
This should read:
* arm/predicates.md (arm_hard_general_register_operand): New predicate.
(vfp_hard_register_operand): Likewise.
> * config/arm/arm-ldmstm.ml: Use
> arm_hard_general_register_operand for all patterns.
> * config/arm/ldmstm.md: Regenerate.
> * gcc/config/arm/arm.md: Use vfp_hard_register_operand in
> vfp_pop_multiple_with_writeback.
This needs to name the pattern being modified (in brackets before the colon.
You should delete the predicate arm_hard_register_operand if it's now
no-longer being used. Don't forget the ChangeLog entry for that as well.
>
>
> pr59142-v1.diff
>
>
> Index: gcc/config/arm/predicates.md
> ===================================================================
> --- gcc/config/arm/predicates.md (revision 205021)
> +++ gcc/config/arm/predicates.md (working copy)
> @@ -98,6 +105,15 @@
> && REGNO_REG_CLASS (REGNO (op)) == VFP_REGS)));
> })
>
> +(define_predicate "vfp_hard_register_operand"
> + (match_code "reg")
> +{
> + return (REGNO_REG_CLASS (REGNO (op)) == VFP_D0_D7_REGS
> + || REGNO_REG_CLASS (REGNO (op)) == VFP_LO_REGS
> + || (TARGET_VFPD32
> + && REGNO_REG_CLASS (REGNO (op)) == VFP_REGS));
> +})
No need to use REGNO_REG_CLASS, something like:
IS_VFP_REGNUM (REGNO (op))
Should be sufficient.
R.