On Fri, 9 Jan 2015 12:04:26, Richard Biener wrote: > >>> >>> There may be multiple VIEW_CONVERT_EXPRs in a reference chain >>> so simply stripping the outermost only doesn't work (the assert). >>> >> >> Hmm, that did not happen in any of the Ada tests in ada/acats nor in gnat.dg, >> but with Ada anything may be possible... >> >> Would you like it better if I do it this way: >> >> align = get_object_alignment (expr); >> if (align < BITS_PER_UNIT) >> return false; >> >> do >> { >> expr = TREE_OPERAND (expr, 0); >> } while (TREE_CODE (expr) == VIEW_CONVERT_EXPR); > > No, I mean the tree might look like > > COMPONENT_REF <VIEW_CONVERT_EXPR < COMPONENT_REF <VIEW_CONVERT_EXPR <.... > > thus VIEW_CONVERT_EXPR doesn't have to be outermost but it > can appear anywhere in the reference chain. >
Nice... Could some one give me a test case for that? >> should be equivalent to >> >> if (DECL_P (base) && !may_be_aliased (base)) >> return false; >> >> is that right? > > Yes, well, not exactly, but I wonder if its worth doing the extra check > if you only check decl accesses anyway and not indirect accesses. > I think Jakub, you wrote that initially, any comments on that? Thanks Bernd.