http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55501



--- Comment #11 from janus at gcc dot gnu.org 2012-11-28 12:22:02 UTC ---

(In reply to comment #10)

> The first two are runtime checks, which are basically identical. Here is a

> reduced test case for these:

> 

>   implicit none

>   integer :: i(-1:1) = 0

> 

>   print *, lbound(merge(i,i,.true.))

>   print *, ubound(merge(i,i,.true.))

> 

> end

> 

> Without the patch, this prints:

>            1

>            3

> And with the patch:

>           -1

>            1

> 

> The output with the patch does look more reasonable to me. Or is there any

> reason why the standard would demand the MERGE expression to have bounds of 
> 1:3

> instead of -1:1 ?



At least all of ifort, sunf95 and g95 agree with the first variant (1:3).



[Btw, the bound_{2,7} test cases come from PR 29391.]

Reply via email to