fix opt/8634

Zdenek Dvorak rakdver@atrey.karlin.mff.cuni.cz
Tue Apr 29 20:52:00 GMT 2003


Hello,

> On Tue, 8 Apr 2003, Zdenek Dvorak wrote:
> 
> > 	* function.c (postponed_insns): New.
> > 	(purge_addressof_1): Postpone processing of insns if addressofs
> > 	are not put into stack.
> > 	(purge_addressof): Process postponed insns.
> 
> This change introduce a testsuite failure
> 
>    FAIL: gcc.dg/20010912-1.c execution test
> 
> for i386-unknown-netbsdelf1.6 (and by looking at gcc-testresults, this
> seems to be the case for many other targes too...)

this patch fixes it by postponing the processing in fewer cases (in the
omited cases it did not help anyway, so it does not matter).

There is still the latent bug in cse uncovered by the current version;
I will try to have a look at it if I find a time for it.

Zdenek

Changelog:
	* function.c (purge_addressof_1): Postpone insn in fewer cases.

Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.421
diff -c -3 -p -r1.421 function.c
*** function.c	22 Apr 2003 12:09:09 -0000	1.421
--- function.c	29 Apr 2003 20:44:19 -0000
*************** purge_addressof_1 (loc, insn, force, sto
*** 3075,3087 ****
      {
        rtx sub = XEXP (XEXP (x, 0), 0);
  
-       if (may_postpone)
- 	{
- 	  if (!postponed_insns || XEXP (postponed_insns, 0) != insn)
- 	    postponed_insns = alloc_INSN_LIST (insn, postponed_insns);
- 	  return true;
- 	}
- 
        if (GET_CODE (sub) == MEM)
  	sub = adjust_address_nv (sub, GET_MODE (x), 0);
        else if (GET_CODE (sub) == REG
--- 3075,3080 ----
*************** purge_addressof_1 (loc, insn, force, sto
*** 3090,3095 ****
--- 3083,3097 ----
        else if (GET_CODE (sub) == REG && GET_MODE (x) != GET_MODE (sub))
  	{
  	  int size_x, size_sub;
+ 
+ 	  if (may_postpone)
+ 	    {
+ 	      /* Postpone for now, so that we do not emit bitfield arithmetics
+ 		 unless there is some benefit from it.  */
+ 	      if (!postponed_insns || XEXP (postponed_insns, 0) != insn)
+ 		postponed_insns = alloc_INSN_LIST (insn, postponed_insns);
+ 	      return true;
+ 	    }
  
  	  if (!insn)
  	    {



More information about the Gcc-patches mailing list