On Fri, Apr 27, 2012 at 5:06 AM, Jan Hubicka <hubi...@ucw.cz> wrote: >> On Fri, Apr 27, 2012 at 12:50 PM, Eric Botcazou <ebotca...@adacore.com> >> wrote: >> >> We do not depend on the block structure any more when dealing with >> >> stack layout for variables in GCC 4.7.0 and above. I am not saying >> >> your patch is incorrect or not needed. Just it will not have an >> >> effect on variable stack layout. >> > >> > It might be worth backporting to the 4.6 branch though, these stack layout >> > issues are very nasty. >> >> What about not setting a BLOCK on the call stmt? That said, I can't see > > I recall that not seetting the block did lead to ICE... > >> how outlining a SESE region that starts at the beginning of the function >> is not conservatively using the outermost BLOCK ... so, is the bug not >> elsewhere? > > ... so I made the exactly same conclussion. > The problem is with stack vars allocated in header that survive till the > tail part?
A SESE region does not necessary at the beginning of the function. They can be anywhere. In the example I attached, it is at the end of function. Even if the outlined region is at the beginning the function. setting the call_stmt as the outermost block is also incorrect. For c++ programs, the block for function level local variables is not DECL_INITIAL(current_function_decl). It is the subblock of DECL_INITIAL(current_function_decl). This is different from c programs. -Rong > > Honza >> >> Richard. >> >> > -- >> > Eric Botcazou