Re: Code generation problem with optimizations enabled

2009-05-13 Thread Jamie Prescott
- Original Message > From: Jim Wilson > To: Jamie Prescott > Cc: Paolo Bonzini ; gcc@gcc.gnu.org > Sent: Wednesday, May 13, 2009 6:15:07 PM > Subject: Re: Code generation problem with optimizations enabled > > Jamie Prescott wrote: > > Thank you Paolo, I&#

Re: Code generation problem with optimizations enabled

2009-05-13 Thread Jim Wilson
Jamie Prescott wrote: Thank you Paolo, I'll take a look at it. Is there a reason why the fcmp insn was dropped with such implementation? The code that optimizes away redundant cc0 compares is in final.c, in final_scan_insn(). It is about line 2310 in my tree, near the comment "Check for redu

Re: Code generation problem with optimizations enabled

2009-05-12 Thread Jamie Prescott
- Original Message > From: Paolo Bonzini > To: Jamie Prescott > Cc: gcc@gcc.gnu.org > Sent: Tuesday, May 12, 2009 1:31:53 AM > Subject: Re: Code generation problem with optimizations enabled > > > What I noticed is that if I CC_STATUS_INIT (in xxx_notice_updat

Re: Code generation problem with optimizations enabled

2009-05-12 Thread Jamie Prescott
Re: Code generation problem with optimizations enabled > > > What I noticed is that if I CC_STATUS_INIT (in xxx_notice_update_cc()) even > for insn that > > do not require it (that are almost all of them - being only cmp/fcmp/test > > that > modify cc0), > > cmp

Re: Code generation problem with optimizations enabled

2009-05-12 Thread Paolo Bonzini
> What I noticed is that if I CC_STATUS_INIT (in xxx_notice_update_cc()) even > for insn that > do not require it (that are almost all of them - being only cmp/fcmp/test > that modify cc0), > cmpdf gets emitted regularly. If so, you should not be using cc0, but a CCmode register instead. See fo

Re: Code generation problem with optimizations enabled

2009-05-12 Thread Jamie Prescott
- Original Message > From: Jamie Prescott > To: gcc@gcc.gnu.org > Sent: Monday, May 11, 2009 11:59:23 PM > Subject: Code generation problem with optimizations enabled > If I disable the optimizations, everything is fine and the 'fcmp' is there. > Even wit

Code generation problem with optimizations enabled

2009-05-11 Thread Jamie Prescott
Hi! I have this little code that drives me crazy about the code generation (GCC 4.3.3). extern double tle_mk_inf(int); double tle_exp(double dval) { if (dval == 0.0) return 0.0; if (dval > 1) return tle_mk_inf(1); return -1.2; } If