diff mbox

[ARM] Fix offset_ok_for_ldrd_strd in Thumb1

Message ID 000001cdb136$bc565fe0$35031fa0$@yorsh@arm.com
State New
Headers show

Commit Message

Greta Yorsh Oct. 23, 2012, 3:54 p.m. UTC
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.

Comments

Ramana Radhakrishnan Oct. 23, 2012, 4:03 p.m. UTC | #1
> Ok for trunk?

Ok.

ramana
Richard Earnshaw Oct. 23, 2012, 4:11 p.m. UTC | #2
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));
>   }
>
diff mbox

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));
 }