Patchwork [ARM] Fix offset_ok_for_ldrd_strd in Thumb1

login
register
mail settings
Submitter Greta Yorsh
Date Oct. 23, 2012, 3:54 p.m.
Message ID <000001cdb136$bc565fe0$35031fa0$@yorsh@arm.com>
Download mbox | patch
Permalink /patch/193520/
State New
Headers show

Comments

Greta Yorsh - Oct. 23, 2012, 3:54 p.m.
The function offset_ok_for_ldrd_strd should return false for Thumb1, because
TARGET_LDRD and Thumb1 can be both enabled (for example, the default for
cortex-m0).

This patch fixes ICE that is caused by gcc r192678 and occurs when building
gcc with newlib for arm-none-eabi cortex-m0.

Ok for trunk?

Thanks,
Greta

ChangeLog

gcc/


2012-10-23  Greta Yorsh  <Greta.Yorsh@arm.com>

	* config/arm/arm.c (offset_ok_for_ldrd_strd): Return false for
Thumb1.
Ramana Radhakrishnan - Oct. 23, 2012, 4:03 p.m.
> Ok for trunk?

Ok.

ramana
Richard Earnshaw - Oct. 23, 2012, 4:11 p.m.
On 23/10/12 16:54, Greta Yorsh wrote:
> The function offset_ok_for_ldrd_strd should return false for Thumb1, because
> TARGET_LDRD and Thumb1 can be both enabled (for example, the default for
> cortex-m0).
>
> This patch fixes ICE that is caused by gcc r192678 and occurs when building
> gcc with newlib for arm-none-eabi cortex-m0.
>
> Ok for trunk?
>
> Thanks,
> Greta
>
> ChangeLog
>
> gcc/
>
>
> 2012-10-23  Greta Yorsh  <Greta.Yorsh@arm.com>
>
> 	* config/arm/arm.c (offset_ok_for_ldrd_strd): Return false for
> Thumb1.
>

I think we should fix TARGET_LDRD to reject Thumb1.

R.

>
> m0-ice.v2.patch.txt
>
>
> diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
> index e9b9463..a94e537 100644
> --- a/gcc/config/arm/arm.c
> +++ b/gcc/config/arm/arm.c
> @@ -12209,7 +12209,7 @@ offset_ok_for_ldrd_strd (HOST_WIDE_INT offset)
>     else if (TARGET_ARM)
>       max_offset = 255;
>     else
> -    gcc_unreachable ();
> +    return false;
>
>     return ((offset <= max_offset) && (offset >= -max_offset));
>   }
>

Patch

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index e9b9463..a94e537 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -12209,7 +12209,7 @@  offset_ok_for_ldrd_strd (HOST_WIDE_INT offset)
   else if (TARGET_ARM)
     max_offset = 255;
   else
-    gcc_unreachable ();
+    return false;
 
   return ((offset <= max_offset) && (offset >= -max_offset));
 }