Re: Fix for PR79987

2017-06-09 Thread Ilya Enkovich
2017-06-09 15:21 GMT+03:00 Alexander Ivchenko : > Hi Ilya, > > I tried changing builtin call so it gets address of a decl instead of > a decl, but it looked very unnatural and I hit some other problems What is unnatural in passing a pointer to a function to get its bounds? Please show your patch a

Re: Fix for PR79987

2017-06-09 Thread Alexander Ivchenko
Hi Ilya, I tried changing builtin call so it gets address of a decl instead of a decl, but it looked very unnatural and I hit some other problems implementing that. Keeping in mind the exposure of this problem, I think it is not worth it. I propose to reconsider the first and the simplest patch in

Re: Fix for PR79987

2017-05-11 Thread Ilya Enkovich
2017-05-11 0:05 GMT+03:00 Alexander Ivchenko : > Didn't quite get your point. I though that the idea is to hit this code: > > bounds = chkp_generate_extern_var_bounds (decl); > ... to get the builtin_sizeof call on this variable and hence to get > the size relocation. What exactly do you mean

Re: Fix for PR79987

2017-05-09 Thread Alexander Ivchenko
If we use chkp_generate_extern_var_bounds for void variable just as for arrays with unknown size, we will create the following gimple seq: # VUSE <.MEM> __size_tmp.0 = __builtin_ia32_sizeof (foo); __size_tmp.1_3 = __size_tmp.0; However, this will fail in verify_gimple_call: tree arg = gimple_cal

Re: Fix for PR79987

2017-04-08 Thread Ilya Enkovich
2017-04-04 18:34 GMT+03:00 Jeff Law : > On 04/04/2017 09:07 AM, Alexander Ivchenko wrote: >> >> Hi, >> >> When creating static bounds for foo below we end up with: >> >> *((unsigned long *) &__chkp_bounds_of_foo + 8) = >> ~(__builtin_ia32_sizeof (foo) + ((long unsigned int) &foo + >> 18446744073709

Re: Fix for PR79987

2017-04-04 Thread Jeff Law
On 04/04/2017 09:07 AM, Alexander Ivchenko wrote: Hi, When creating static bounds for foo below we end up with: *((unsigned long *) &__chkp_bounds_of_foo + 8) = ~(__builtin_ia32_sizeof (foo) + ((long unsigned int) &foo + 18446744073709551615)); This fails in gimplify_function_tree with gcc_ass

Fix for PR79987

2017-04-04 Thread Alexander Ivchenko
Hi, When creating static bounds for foo below we end up with: *((unsigned long *) &__chkp_bounds_of_foo + 8) = ~(__builtin_ia32_sizeof (foo) + ((long unsigned int) &foo + 18446744073709551615)); This fails in gimplify_function_tree with gcc_assert (!VOID_TYPE_P (TREE_TYPE (*expr_p))); Is it OK?