Re: [PATCH] Do not set nothrow flag on recursive function with stack checking

2018-04-30 Thread Jan Hubicka
> > Honza, do you have any suggestions here for the issue of detecting possible > recursion as opposted to just direct recursion? Well, you can look for strongly connected components but you must assume that every call out of the current unit that is not leaf may call any function that is externa

Re: [PATCH] Do not set nothrow flag on recursive function with stack checking

2018-04-30 Thread Richard Biener
On Sat, Apr 28, 2018 at 11:20 AM, Eric Botcazou wrote: >> This looks not a generic enough fix to me - consider >> >> void foo(void) { int a[10]; a[0] = 1; a[9] = 1; } >> int main() { try { foo (); } catch (...) {} } >> >> with -fnon-call-exceptions. If we'd like to catch the SEGV from sta

Re: [PATCH] Do not set nothrow flag on recursive function with stack checking

2018-04-28 Thread Eric Botcazou
> This looks not a generic enough fix to me - consider > > void foo(void) { int a[10]; a[0] = 1; a[9] = 1; } > int main() { try { foo (); } catch (...) {} } > > with -fnon-call-exceptions. If we'd like to catch the SEGV from stack > overflows then your fix doesn't handle the non-recursiv

Re: [PATCH] Do not set nothrow flag on recursive function with stack checking

2018-04-27 Thread Richard Biener
On Thu, Apr 26, 2018 at 4:29 PM, Eric Botcazou wrote: > Hi, > > when stack checking is enabled in Ada, it is supposed to be able to handle the > case of a recursive function that does essentially nothing. But in this case > the IPA machinery will compute that the function is nothrow, which means

[PATCH] Do not set nothrow flag on recursive function with stack checking

2018-04-26 Thread Eric Botcazou
Hi, when stack checking is enabled in Ada, it is supposed to be able to handle the case of a recursive function that does essentially nothing. But in this case the IPA machinery will compute that the function is nothrow, which means that the Storage_Error exception cannot be caught by the call