diff mbox

PR rtl-optimization/61712

Message ID 20140704045915.GA1654@ubuntu
State New
Headers show

Commit Message

林作健 July 4, 2014, 4:59 a.m. UTC
Hi,
    This crash is due to fail to consider the exception situation that
    the insn variable may not be a insn at all.

arm.c (thumb1_reorg): if the
 selected insn is not a insn, continue to next bb.

---
 gcc/config/arm/arm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Richard Earnshaw July 4, 2014, 9:48 a.m. UTC | #1
On 04/07/14 05:59, lin zuojian wrote:
> Hi,
>     This crash is due to fail to consider the exception situation that
>     the insn variable may not be a insn at all.
> 
> arm.c (thumb1_reorg): if the
>  selected insn is not a insn, continue to next bb.
> 
> ---
>  gcc/config/arm/arm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
> index 89684bb..50ae64b 100644
> --- a/gcc/config/arm/arm.c
> +++ b/gcc/config/arm/arm.c
> @@ -16720,7 +16720,7 @@ thumb1_reorg (void)
>  	insn = PREV_INSN (insn);
>  
>        /* Find the last cbranchsi4_insn in basic block BB.  */
> -      if (INSN_CODE (insn) != CODE_FOR_cbranchsi4_insn)
> +      if (!INSN_P (insn) || (INSN_CODE (insn) != CODE_FOR_cbranchsi4_insn))
>  	continue;
>  
>        /* Get the register with which we are comparing.  */
> 

This should be fixed the same way as it was on trunk.  Bin's taking care
of that.

R.
林作健 July 4, 2014, 9:51 a.m. UTC | #2
Thanks Richard,
    I didn't aware that patch.
--
Lin Zuojian
diff mbox

Patch

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 89684bb..50ae64b 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -16720,7 +16720,7 @@  thumb1_reorg (void)
 	insn = PREV_INSN (insn);
 
       /* Find the last cbranchsi4_insn in basic block BB.  */
-      if (INSN_CODE (insn) != CODE_FOR_cbranchsi4_insn)
+      if (!INSN_P (insn) || (INSN_CODE (insn) != CODE_FOR_cbranchsi4_insn))
 	continue;
 
       /* Get the register with which we are comparing.  */