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: [cond-optab, trunk] fold &f != 0 better


On Thu, Apr 9, 2009 at 1:56 AM, Paolo Bonzini <bonzini@gnu.org> wrote:
> I noticed that a common failure on cond-optab (e500, m32r, mcore) was on
> pr27150-1.c. ?This is a failure to optimize
>
> int g(int f)
> {
> ?return (&f)!=0;
> }
>
> The reason is that there is more straight-line coding on cond-optab and
> this confuses combine, which is no longer able to optimize it. ?But I
> decided to treat it as a missed tree optimization, fixing it with the
> following patch.
>
> I tested that the modified testcase fails on cond-optab without the
> patch, and passes with it.
>
> Bootstrap/regtest in progress, ok for trunk when it finishes?
>
> Paolo
>
> 2009-04-09 ?Paolo Bonzini ?<bonzini@gnu.org>
>
> ? ? ? ?* fold-const.c (tree_single_nonzero_warnv_p): Always treat decls
> ? ? ? ?for things others than variables or functions as nonzero.
>
> 2009-04-09 ?Paolo Bonzini ?<bonzini@gnu.org>
>
> ? ? ? ?* gcc.dg/pr27150-1.c: Change to a link test.
>

This caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39701

You may need to enable checking to reproduce it.


-- 
H.J.


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