Re: [committed] Fix UB in gfc_trans_omp_clauses (PR fortran/93162)

2020-01-08 Thread Tobias Burnus
On 1/8/20 9:22 AM, Jakub Jelinek wrote: With mixed REF_COMPONENT and REF_ARRAY, one can have var(:), or var2%comp(:) or var3(:)%comp, or var3%comp(:)%comp2 etc. Technically, one can also have var3(4)%comp(:)%comp2(1) – with one nonelement/AR_FULL reference and two element references. (At least a

Re: [committed] Fix UB in gfc_trans_omp_clauses (PR fortran/93162)

2020-01-08 Thread Jakub Jelinek
On Wed, Jan 08, 2020 at 09:14:10AM +0100, Tobias Burnus wrote: > Especially in light of the OpenMP 4.5's structure element mapping (for C/C++ > since GCC 7, for Fortran still unsupported), I had preferred some > consolidation like taking the last reference in that check instead of just > checking t

Re: [committed] Fix UB in gfc_trans_omp_clauses (PR fortran/93162)

2020-01-08 Thread Tobias Burnus
Hi Thomas, I had a quick look at the patch – I thought that it is only a band aid and should be handled more properly, but after having a closer look, I believe the latter is more work than I expected and Jakub's patch makes perfectly sense for Stage 3/4. (Hence, I also did not reply.) On 1/

Re: [committed] Fix UB in gfc_trans_omp_clauses (PR fortran/93162)

2020-01-07 Thread Thomas Schwinge
Hi! On 2020-01-07T08:20:44+0100, Jakub Jelinek wrote: > When I wrote the code, for map clause the arguments couldn't contain any > REF_COMPONENT (nor REF_UNQUIRY nor REF_SUBSTRING) and therefore it was > ok (although unclean) to just look at u.ar.type Jakub, thanks for fixing this. > but now th

[committed] Fix UB in gfc_trans_omp_clauses (PR fortran/93162)

2020-01-06 Thread Jakub Jelinek
Hi! When I wrote the code, for map clause the arguments couldn't contain any REF_COMPONENT (nor REF_UNQUIRY nor REF_SUBSTRING) and therefore it was ok (although unclean) to just look at u.ar.type, but now that REF_COMPONENT can appear there (so far for OpenACC only, although OpenMP 5.0 also allows