https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107721

            Bug ID: 107721
           Summary: Lost typespec with constant expressions using array
                    constructors and parentheses
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anlauf at gcc dot gnu.org
  Target Milestone: ---

While working on pr107680, I noticed the following issue:

program p
  print *, "*** Expect integer:"
  print *, [integer ::  [1.0] ] **  2
  print *, [integer :: ([1.0])] **  2
  print *, "*** Expect real:"
  print *, [real    ::  [2] ]   **  2
  print *, [real    :: ([2])]   **  2
  print *, "*** Expect complex:"
  print *, [complex ::  [3] ]   **  2
  print *, [complex :: ([3])]   **  2
end

There should be no effect by the parentheses here, but with 11-branch onwards
I get:

 *** Expect integer:
           1
   1.00000000    
 *** Expect real:
   4.00000000    
           4
 *** Expect complex:
             (9.00000000,0.00000000)
           9


Intel correctly prints:

 *** Expect integer:
           1
           1
 *** Expect real:
   4.000000    
   4.000000    
 *** Expect complex:
 (9.000000,0.0000000E+00)
 (9.000000,0.0000000E+00)


Note that 10-branch and older ICE on this code...

Reply via email to