[Bug fortran/39772] -fcheck=bounds could check for overflow of size intrinsic.

2015-12-06 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39772

--- Comment #14 from Dominique d'Humieres  ---
> > If yes, the summary should probably changed to be less misleading (I had to
> > read the thread twice to understand).
>
> done

You missed my main point. As shown by the number of comments in this PR, I
think the use of "bounds" in this context is misleading: i.e., there is no
access to an array outside its bounds. This is why I proposed to use
-fcheck=, with suitable name for : intrinsic_range, range, overflow,
undefined, ... . Indeed I cannot tell what is the right choice: intrinsic_range
is probably the best description, but is quite long for my taste, with the
other choices the user may expect too much for the check, ... .

Is the following list of intrinsics exhaustive?

C_SIZEOF, COUNT, LBOUND, LEN, LEN_TRIM, SHAPE, SIZE, SIZEOF, STORAGE_SIZE, and
UBOUND

Note that C_SIZEOF and SIZEOF are not supposed to accept KIND=8 as an optional
argument.

Also AFAIU pr31243, the string length is limited to HUGE(0).

[Bug fortran/39772] -fcheck=bounds could check for overflow of size intrinsic.

2015-12-05 Thread Joost.VandeVondele at mat dot ethz.ch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39772

Joost VandeVondele  changed:

   What|Removed |Added

 Status|WAITING |NEW
Summary|add a correctness check for |-fcheck=bounds could check
   |the size intrinsic to   |for overflow of size
   |-fbounds-check  |intrinsic.

--- Comment #13 from Joost VandeVondele  
---
(In reply to Dominique d'Humieres from comment #11)
> Am I correct that you are asking for something like -fcheck=undefined
> (overflow, range, ... what ever is deemed suitable) for intrinsics returning
> by default an INTEGER(4)?

yes.

> 
> If yes, the summary should probably changed to be less misleading (I had to
> read the thread twice to understand).

done