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] Fix reg-stack error-recovery on pr84828 testcase (PR target/84828)


On Mon, 23 Apr 2018, Jakub Jelinek wrote:

> Hi!
> 
> My earlier attempts to replace bogus inline asm with something that
> reg-stack.c would be happy about failed, so this is just a quick hack to
> help the error-recovery on the pr84828.C testcase with -m32.
> 
> I bet bunch of other spots will need any_malformed_asm tweaks, just don't
> have testcases for those.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, fixes:
> -FAIL: g++.dg/ext/pr84828.C  -std=gnu++11 (internal compiler error)
> -FAIL: g++.dg/ext/pr84828.C  -std=gnu++11 (test for excess errors)
> -FAIL: g++.dg/ext/pr84828.C  -std=gnu++14 (internal compiler error)
> -FAIL: g++.dg/ext/pr84828.C  -std=gnu++14 (test for excess errors)
> -FAIL: g++.dg/ext/pr84828.C  -std=gnu++98 (internal compiler error)
> -FAIL: g++.dg/ext/pr84828.C  -std=gnu++98 (test for excess errors)
> on i686-linux, ok for trunk?

OK.

Thanks,
Richard.

> 2018-04-23  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR target/84828
> 	* reg-stack.c (move_for_stack_reg): Don't fail assertion about dead
> 	destination if any_malformed_asm.
> 
> --- gcc/reg-stack.c.jj	2018-03-16 13:42:37.118852524 +0100
> +++ gcc/reg-stack.c	2018-04-23 17:16:41.085198214 +0200
> @@ -1105,13 +1105,16 @@ move_for_stack_reg (rtx_insn *insn, stac
>  	}
>  
>        /* The destination ought to be dead.  */
> -      gcc_assert (get_hard_regnum (regstack, dest) < FIRST_STACK_REG);
> +      if (get_hard_regnum (regstack, dest) >= FIRST_STACK_REG)
> +	gcc_assert (any_malformed_asm);
> +      else
> +	{
> +	  replace_reg (psrc, get_hard_regnum (regstack, src));
>  
> -      replace_reg (psrc, get_hard_regnum (regstack, src));
> -
> -      regstack->reg[++regstack->top] = REGNO (dest);
> -      SET_HARD_REG_BIT (regstack->reg_set, REGNO (dest));
> -      replace_reg (pdest, FIRST_STACK_REG);
> +	  regstack->reg[++regstack->top] = REGNO (dest);
> +	  SET_HARD_REG_BIT (regstack->reg_set, REGNO (dest));
> +	  replace_reg (pdest, FIRST_STACK_REG);
> +	}
>      }
>    else if (STACK_REG_P (src))
>      {
> 
> 	Jakub
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)


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