> > > BTW: I have never seen any VAR_DECL here, at least not in my test case, do > you have test cases for that? If you call virtual method of undefined variable: struct A { virtual void foo (); };
void t() { struct A *a; a->foo (); } It will make GCC to drop the virtual table lookup and directly call __builtin_unreachable > > The condition here was if TREE_CODE(..) != PARM_DECL, and I extended it to be > TREE_CODE (..) == PARM_DECL ||| TREE_CODE (..) == RESULT_DECL. > > That was purely by heuristic, the intention was to change as little as > possible, so > refining that to TREE_CODE (...) == PARM_DECL || (TREE_CODE (...) == > RESULT_DECL && !(DECL_BY_REFERENCE (...))) > would be fully consistent with my heuristic. > > I don't have much more than the example where this RESULT_DECL showed up here. > If this extra condition does not make the test case fail, it would be OK for > me. Actually trying to play with a testcase, for scalar return values, we never put RESULT_DECL there, only for values returned by reference. So I guess no extra condition is needed. So I guess the patch is fine as it is. Honza > > But why is a RESULT_DECL per se undefined? > > Do you have a test case, where this extra condition would make a difference? > > > Thanks, > Bernd. >