This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/50037] Unroll factor exceeds max trip count
- From: "matz at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 10 Aug 2011 16:56:47 +0000
- Subject: [Bug rtl-optimization/50037] Unroll factor exceeds max trip count
- Auto-submitted: auto-generated
- References: <bug-50037-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50037
Michael Matz <matz at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |matz at gcc dot gnu.org
--- Comment #4 from Michael Matz <matz at gcc dot gnu.org> 2011-08-10 16:56:47 UTC ---
(In reply to comment #3)
> Using
>
> int foo (int n, int *addr)
> {
> int count, sum;
> for ( count = n & 0x3; count >= 0; count--, addr++ )
> sum += *addr;
> return sum;
> }
>
> it works.
Not for me. It's still unrolled by 7.
> neither works with
>
> int foo (int n, int *addr)
> {
> int count, sum;
> for ( count = 0; count < n & 0x3; count++, addr++ )
Careful. Operator precedence. count < (n & 3)
Doesn't work with those examples either, though.