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

--- Comment #8 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Sun, Jun 16, 2013 at 07:57:23AM +0000, furue at hawaii dot edu wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57628
> 
> --- Comment #2 from Ryo Furue <furue at hawaii dot edu> ---
> 
> Of course.  I agree with all your statements.
> 
> And your entirely entirely miss the point!
> 

No, I did not miss your point.

> This is a "quality of implementation" issue.  

So, the compiler should just arbitrarily chose to evaluate
some expression and ignore others?

> The question is "Is refusing to compile it the best way to deal with this
> error?"  My answer is no.  Since,
> 
>   real, parameter:: a = 0
>   If (a > 0) then

So, the compiler should evaluate "a > 0", but it should

>     write(*,*) 1/a !! this part

not evaluate "1/a".

>   end if
> 
> the contents of the IF statement is unreachable, the compiler more
> appropriately would issue an "unreachable statements" warning
> and disregard the contents of the unreachable code.

DCE will take care of unreachable code in the middle-end.

Just remove the PARAMETER attribute in your code, it it will
do what you.

real :: a = 0
if (a > 0) then
   print *, 1/a
else
   print *, 'doh!'
end if
end

Reply via email to