public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* PR/4706
@ 2001-11-21 19:18 Dave Cladingboel
  0 siblings, 0 replies; only message in thread
From: Dave Cladingboel @ 2001-11-21 19:18 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR optimization/4706; it has been noted by GNATS.

From: Dave Cladingboel <dave@clad.fsnet.co.uk>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, CGLeggett@lbl.gov,
	pcarlini@unitus.it, gcc-bugs@gcc.gnu.org
Cc:  
Subject: PR/4706
Date: Wed, 28 Nov 2001 20:49:32 +0000

 I isolated this a bit more.  Specifically it's related to this
 optimization, in combination with loop unrolling:
 
 combine_simplify_rtx (x, op0_mode, last, in_dest):
 
       /* Try simplify a*(b/c) as (a*b)/c.  */
       if (FLOAT_MODE_P (mode) && flag_unsafe_math_optimizations
 	  && GET_CODE (XEXP (x, 0)) == DIV)
 	{
 	  rtx tem = simplify_binary_operation (MULT, mode,
 					       XEXP (XEXP (x, 0), 0),
 					       XEXP (x, 1));
 	  if (tem)
 	    return gen_binary (DIV, mode, tem, XEXP (XEXP (x, 0), 1));
 	}
       break;
 
 expand_expr (exp, target, tmode, modifier):
 
     case RDIV_EXPR:
       /* Emit a/b as a*(1/b).  Later we may manage CSE the reciprocal saving
          expensive divide.  If not, combine will rebuild the original
          computation.  */
       if (flag_unsafe_math_optimizations && optimize && !optimize_size
 	  && !real_onep (TREE_OPERAND (exp, 0)))
         return expand_expr (build (MULT_EXPR, type, TREE_OPERAND (exp, 0),
 				   build (RDIV_EXPR, type,
 					  build_real (type, dconst1),
 					  TREE_OPERAND (exp, 1))),
 			    target, tmode, unsignedp);
       this_optab = sdiv_optab;
       goto binop;
 
 Tested by changing all flag_unsafe_math_optimizations into
 flag_unsafe_math_optimizations_N and finding what broke.
 
 The reg stack pass cores due to it using a reg that is unused:
 
 (from sched2 pass)
 
 (insn:TI 172 176 177 (set (mem/f:DF (plus:SI (reg/f:SI 7 esp)
                 (const_int 4 [0x4])) [0 S8 A64])
         (reg:DF 9 st(1))) 95 {*movdf_integer} (insn_list 1014 (insn_list 1129 (insn_list 46 (insn_list:REG_DEP_OUTPUT 59 (insn_list:REG_DEP_OUTPUT 792 (insn_list:REG_DEP_OUTPUT 826 (insn_list:REG_DEP_OUTPUT 860 (insn_list:REG_DEP_ANTI 51 (insn_list:REG_DEP_ANTI 53 (insn_list:REG_DEP_ANTI 56 (insn_list:REG_DEP_ANTI 770 (insn_list:REG_DEP_ANTI 778 (insn_list:REG_DEP_ANTI 790 (insn_list:REG_DEP_ANTI 812 (insn_list:REG_DEP_ANTI 846 (nil))))))))))))))))
     (expr_list:REG_DEAD (reg:DF 9 st(1))
         (nil)))
 
 .
 .
 (no other uses of st(1))
 .
 .
 
 (insn:TI 715 230 716 (set (reg:DF 9 st(1))
         (minus:DF (reg:DF 9 st(1))
             (mem:DF (plus:SI (reg/v/f:SI 4 esi [60])
                     (const_int 8 [0x8])) [3 S8 A64]))) 535 {*fop_df_1} (insn_list 10 (insn_list 230 (insn_list 177 (insn_list 1014 (insn_list:REG_DEP_ANTI 172 (nil))))))
     (nil))
 
 Dave.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-11-28 20:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-21 19:18 PR/4706 Dave Cladingboel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).