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] for PR 23361


On 2/8/07, Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> wrote:
Hello,

> >one of the reasons for this PR is that we fail to fold expressions like
> >a + 10 > MIN_INT + 2, that are always true (assuming that the
> >arithmetics in the considered type does not overflow).  Such expressions
> >are fairly often produced by number of iterations analysis.
> >This patch implements such simplifications.
> >
> >Bootstrapped & regtested on i686 and x86_64.
>
> Hmm, this looks overly complicated.  But maybe I'm missing something
> obvious - the
> attached also works for your testcase, but I dind't yet bootstrap & test it.

well, it seems to work (*).  I think you should also extend the comment
explaining how the code works -- it took me about half an hour before I
understood it.  Also please include the compare-3 testcase (it took me
longer time to write than the fold-const code :-)

Yeah - you are right ;)


I'm now bootstrapping and testing the following.

Thanks!
Richard.


2007-02-08 Zdenek Dvorak <dvorakz@suse.cz> Richard Guenther <rguenther@suse.de>

       PR middle-end/23361
       * fold-const.c (fold_comparison): Handle obfuscated comparisons
       against INT_MIN/INT_MAX.
       * tree-ssa-loop-ivcanon.c (remove_empty_loop): Print to dump
       file if a loop is removed.

       * gcc.dg/fold-compare-3.c: New testcase.
       * gcc.dg/tree-ssa/loop-24.c: Likewise.

Attachment: p.txt
Description: Text document


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