This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: fold_single_bit_test problems with 3.4.1
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: Dmitry <diwil at spec dot ru>
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Sat, 17 Jul 2004 11:47:02 +0100
- Subject: Re: fold_single_bit_test problems with 3.4.1
- References: <200407162219.30486.diwil@spec.ru>
Dmitry <diwil@spec.ru> writes:
> Is it possible to avoid single bit test folding during code generation, cause
> in my target shift costs lot more than bittest?
>
> for operation:
> if (a &4) g();
> gcc does:
>
> a >>= 2;
> C = a&1
> if(c)
> g();
>
> Do I have to define something extra to avoid it?
> This problem also persits in mips target.
This was a problem in 3.4, but it should already be fixed in CVS mainline,
provided you define your rtx_costs properly. See the thread starting at
<http://gcc.gnu.org/ml/gcc-patches/2004-03.o/msg01456.html> if you need
to backport the fix to 3.4.
Richard