public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "anlauf at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/107721] New: Lost typespec with constant expressions using array constructors and parentheses
Date: Wed, 16 Nov 2022 19:06:25 +0000	[thread overview]
Message-ID: <bug-107721-4@http.gcc.gnu.org/bugzilla/> (raw)

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	other threads:[~2022-11-16 19:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16 19:06 anlauf at gcc dot gnu.org [this message]
2023-01-30  0:26 ` [Bug fortran/107721] " jvdelisle at gcc dot gnu.org
2023-01-30  0:28 ` jvdelisle at gcc dot gnu.org
2023-01-30  0:29 ` jvdelisle at gcc dot gnu.org
2023-02-03  2:34 ` jvdelisle at gcc dot gnu.org
2023-02-03  3:54 ` jvdelisle at gcc dot gnu.org
2023-02-03  7:07 ` kargl at gcc dot gnu.org
2023-02-04  4:08 ` jvdelisle at gcc dot gnu.org
2023-02-04 16:45 ` jvdelisle at gcc dot gnu.org
2023-02-20 23:46 ` jvdelisle at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-107721-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).