[Bug fortran/113254] Option -fallow-invalid-boz does not help with sample code

2024-01-06 Thread xecej4 at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113254

--- Comment #2 from mecej4  ---
Created attachment 57001
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57001=edit
Program source that is handled correctly when -fallow-invalid-boz is specified

[Bug fortran/113254] New: Option -fallow-invalid-boz does not help with sample code

2024-01-06 Thread xecej4 at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113254

Bug ID: 113254
   Summary: Option -fallow-invalid-boz does not help with sample
code
   Product: gcc
   Version: 11.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: xecej4 at outlook dot com
  Target Milestone: ---

Created attachment 56999
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56999=edit
Fortran program to illustrate no benefit from -fallow-invalid-boz

The -fallow-invalid-boz option is described to have this purpose: "... allows a
BOZ literal constant to appear where the Fortran standard would otherwise
prohibit its use". 

The option appears to have no effect on the attached test program, and the
error message is the same with or without -fallow-invalid-boz. (I am also using
-fmax-errors=1.)

[Bug fortran/113165] Code containing more than one type declaration for a variable results in confusing error messages from compiler

2023-12-29 Thread xecej4 at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113165

--- Comment #3 from mecej4  ---
Thanks for the prompt response and the rapid fix.

[Bug fortran/113165] New: Code containing more than one type declaration for a variable results in confusing error messages from compiler

2023-12-28 Thread xecej4 at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113165

Bug ID: 113165
   Summary: Code containing more than one type declaration for a
variable results in confusing error messages from
compiler
   Product: gcc
   Version: 11.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: xecej4 at outlook dot com
  Target Milestone: ---

Created attachment 56960
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56960=edit
Fixed form Fortran77 source file that causes compiler to issue confusing
messages

Some old Fortran codes (e.g., www.netlib.org/ode/epsode.f ) may contain
duplicate declarations of some variables. Lines 1239-1241 of epsode.f:

  double precision eps, epsj, h, hmax, hmin, pw, save1, save2,
 1 ss, t, uround, ymax
  double precision d, r, r0, t, yj

The variable t is declared twice, albeit with the same type and kind.

Gfortran correctly flags this error, but seems to go farther and mark the
variable t as implicitly typed single precision REAL, causing the issuing a
number of misleading error messages when the concerned variable is used in
expressions later on in the program unit.

I enclose a short program to illustrate. Please compile the program with (a) no
options, (b) with -Wall and (c) with -fimplicit-none. Case (c) results in:

muldecl.f:4:24:

4 |   double precision d,q,r  ! 'd' was already declared as double
prec.
  |1
Error: Symbol 'd' at (1) already has basic type of REAL
muldecl.f:7:7:

7 |   r = sqrt(d)
  |   1
Error: Symbol 'r' at (1) has no IMPLICIT type

I suspect that the multiple declaration of d has caused even the unrepeated
declaration of r to be tainted.

[Bug fortran/105691] Incorrect calculation of INDEX(str1,str2) at compile time

2022-05-22 Thread xecej4 at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105691

--- Comment #1 from mecej4  ---
When a program contains an expression that involves the INDEX intrinsic
function, and it is possible to calculate its result value at compile time, the
computed value is sometimes incorrect.

program main
   i = index("fortran.f90", "fortran", back=.true.) ! It should get '1'
   call prnt(i)
contains
   subroutine prnt(i)
   integer i
   print *,'i = ',i
   end subroutine
end program

The program prints '0' instead of '1'. Looking at the assembly code generated
shows that the argument value in the argument I passed to PRNT() is zero.

[Bug fortran/105691] New: Incorrect calculation of INDEX(str1,str2) at compile time

2022-05-22 Thread xecej4 at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105691

Bug ID: 105691
   Summary: Incorrect calculation of INDEX(str1,str2) at compile
time
   Product: gcc
   Version: 11.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: xecej4 at outlook dot com
  Target Milestone: ---