Re: may_be_unaligned_p bug?

2010-04-13 Thread Eric Botcazou
I tested trunk and an old 4.2.1 internal branch, and found the bug on both, so anything in between would be affected too. It goes back at least to this patch, which mostly fixed the bug: 2008-02-19 Christian Bruel christian.br...@st.com Zdenek Dvorak o...@ucw.cz *

Re: may_be_unaligned_p bug?

2010-04-12 Thread DJ Delorie
I can confirm this fixes my test case. Had I known about highest_pow2_factor() I might have come up with this myself ;-) Index: tree-ssa-loop-ivopts.c === --- tree-ssa-loop-ivopts.c(revision 158148) +++

Re: may_be_unaligned_p bug?

2010-04-12 Thread Eric Botcazou
I can confirm this fixes my test case. Had I known about highest_pow2_factor() I might have come up with this myself ;-) OK, I'll do some testing with it tomorrow. Which GCC versions are affected? -- Eric Botcazou

Re: may_be_unaligned_p bug?

2010-04-12 Thread DJ Delorie
OK, I'll do some testing with it tomorrow. Which GCC versions are affected? I tested trunk and an old 4.2.1 internal branch, and found the bug on both, so anything in between would be affected too. It goes back at least to this patch, which mostly fixed the bug: 2008-02-19 Christian Bruel

Re: may_be_unaligned_p bug?

2010-04-10 Thread Eric Botcazou
As a workaround, I had may_be_unaligned_p() return true if toffset is set, but there's likely times when that results in suboptimal code. Wouldn't this be sufficient? Index: tree-ssa-loop-ivopts.c === --- tree-ssa-loop-ivopts.c

Re: may_be_unaligned_p bug?

2010-04-10 Thread Eric Botcazou
Index: tree-ssa-loop-ivopts.c === --- tree-ssa-loop-ivopts.c(revision 158148) +++ tree-ssa-loop-ivopts.c(working copy) @@ -1546,6 +1546,9 @@ may_be_unaligned_p (tree ref, tree step) || bitpos % BITS_PER_UNIT !=

may_be_unaligned_p bug?

2010-04-09 Thread DJ Delorie
In tree-ssa-loop-ivopts.c:may_be_unaligned_p(), we call get_inner_reference to figure out bitpos, but we don't take into account toffset - which may make the reference less aligned than we expect. Is this supposed to be accounted for by STEP ? It doesn't always work with nested arrays - STEP is