Pointer semantics in GIMPLE

2025-04-05 Thread Krister Walfridsson via Gcc
I'm working on ensuring that the GIMPLE semantics used by smtgcc are correct, and I have a lot of questions about the details. I'll be sending a series of emails with these questions. This first one is about pointers in general. Each section starts with a description of the semantics I've impl

Re: Pointer semantics in GIMPLE

2025-03-22 Thread Krister Walfridsson via Gcc
On Thu, 20 Mar 2025, Richard Biener wrote: Pointer arithmetic -- POINTER_DIFF_EXPR --- Subtracting a pointer q from a pointer p is done using POINTER_DIFF_EXPR. * It is UB if the difference does not fit in a signed integer with the same precision as the

Re: Pointer semantics in GIMPLE

2025-03-21 Thread Krister Walfridsson via Gcc
On Fri, 21 Mar 2025, Richard Biener wrote: Issues -- The semantics I've described above result in many reports of miscompilations that I haven't reported yet. As mentioned earlier, the vectorizer can use POINTER_PLUS_EXPR to generate pointers that extend up to a vector length past the objec

Re: Pointer semantics in GIMPLE

2025-03-21 Thread Richard Biener via Gcc
On Fri, Mar 21, 2025 at 12:27 AM Krister Walfridsson wrote: > > On Thu, 20 Mar 2025, Richard Biener wrote: > > >> Pointer arithmetic -- POINTER_DIFF_EXPR > >> --- > >> Subtracting a pointer q from a pointer p is done using POINTER_DIFF_EXPR. > >> * It is UB if

Re: Pointer semantics in GIMPLE

2025-03-20 Thread Richard Biener via Gcc
On Thu, Mar 20, 2025 at 2:05 AM Krister Walfridsson via Gcc wrote: > > I'm working on ensuring that the GIMPLE semantics used by smtgcc are > correct, and I have a lot of questions about the details. I'll be sending > a series of emails with these questions. This first one is about pointers > in g