public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/103778] New: [10/11/12 Regression] ICE: Invalid expression in gfc_element_size
@ 2021-12-20 17:54 gscfq@t-online.de
  2021-12-20 20:33 ` [Bug fortran/103778] " anlauf at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gscfq@t-online.de @ 2021-12-20 17:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103778
           Summary: [10/11/12 Regression] ICE: Invalid expression in
                    gfc_element_size
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Another remnant from pr103412 :


$ cat z1.f90
program p
   use iso_c_binding, only : c_sizeof
   integer, parameter :: a = c_sizeof(z'1')
end


$ gfortran-12-20211219 -c z1.f90
f951: internal compiler error: Invalid expression in gfc_element_size.
0x79b469 gfc_report_diagnostic
        ../../gcc/fortran/error.c:874
0x79cfd7 gfc_internal_error(char const*, ...)
        ../../gcc/fortran/error.c:1494
0x841212 gfc_element_size(gfc_expr*, unsigned long*)
        ../../gcc/fortran/target-memory.c:137
0x841273 gfc_target_expr_size(gfc_expr*, unsigned long*)
        ../../gcc/fortran/target-memory.c:165
0x83513b gfc_simplify_sizeof(gfc_expr*)
        ../../gcc/fortran/simplify.c:7627
0x7b12c2 do_simplify
        ../../gcc/fortran/intrinsic.c:4641
0x7bc3ca gfc_intrinsic_func_interface(gfc_expr*, int)
        ../../gcc/fortran/intrinsic.c:5034
0x81001c resolve_unknown_f
        ../../gcc/fortran/resolve.c:2972
0x81001c resolve_function
        ../../gcc/fortran/resolve.c:3329
0x81001c gfc_resolve_expr(gfc_expr*)
        ../../gcc/fortran/resolve.c:7166
0x7a1344 gfc_reduce_init_expr(gfc_expr*)
        ../../gcc/fortran/expr.c:3155
0x7a42b0 gfc_match_init_expr(gfc_expr**)
        ../../gcc/fortran/expr.c:3203
0x78e6c4 variable_decl
        ../../gcc/fortran/decl.c:3004
0x78e6c4 gfc_match_data_decl()
        ../../gcc/fortran/decl.c:6297
0x7f86b3 match_word
        ../../gcc/fortran/parse.c:67
0x7f86b3 decode_statement
        ../../gcc/fortran/parse.c:378
0x7fa0fa next_free
        ../../gcc/fortran/parse.c:1397
0x7fa0fa next_statement
        ../../gcc/fortran/parse.c:1629
0x7fb68b parse_spec
        ../../gcc/fortran/parse.c:4168
0x7fe7dc parse_progunit
        ../../gcc/fortran/parse.c:6192

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/103778] [10/11/12 Regression] ICE: Invalid expression in gfc_element_size
  2021-12-20 17:54 [Bug fortran/103778] New: [10/11/12 Regression] ICE: Invalid expression in gfc_element_size gscfq@t-online.de
@ 2021-12-20 20:33 ` anlauf at gcc dot gnu.org
  2021-12-20 21:19 ` anlauf at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-12-20 20:33 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-12-20
                 CC|                            |anlauf at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from anlauf at gcc dot gnu.org ---
A BOZ is not interoperable.  Testing:

diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 625473c90d1..b4db9337e9f 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -5185,6 +5185,12 @@ is_c_interoperable (gfc_expr *expr, const char **msg,
bool c_loc, bool c_f_ptr)
       return false;
     }

+  if (expr->ts.type == BT_BOZ)
+    {
+      *msg = "BOZ literal constant";
+      return false;
+    }
+
   if (expr->ts.type == BT_CLASS)
     {
       *msg = "Expression is polymorphic";

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/103778] [10/11/12 Regression] ICE: Invalid expression in gfc_element_size
  2021-12-20 17:54 [Bug fortran/103778] New: [10/11/12 Regression] ICE: Invalid expression in gfc_element_size gscfq@t-online.de
  2021-12-20 20:33 ` [Bug fortran/103778] " anlauf at gcc dot gnu.org
@ 2021-12-20 21:19 ` anlauf at gcc dot gnu.org
  2021-12-22 19:09 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-12-20 21:19 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |anlauf at gcc dot gnu.org

--- Comment #2 from anlauf at gcc dot gnu.org ---
Submitted: https://gcc.gnu.org/pipermail/fortran/2021-December/057214.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/103778] [10/11/12 Regression] ICE: Invalid expression in gfc_element_size
  2021-12-20 17:54 [Bug fortran/103778] New: [10/11/12 Regression] ICE: Invalid expression in gfc_element_size gscfq@t-online.de
  2021-12-20 20:33 ` [Bug fortran/103778] " anlauf at gcc dot gnu.org
  2021-12-20 21:19 ` anlauf at gcc dot gnu.org
@ 2021-12-22 19:09 ` cvs-commit at gcc dot gnu.org
  2021-12-27 19:51 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-22 19:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:ff0ad4b5e16b8828a6147ae2d5fec8068ef0778e

commit r12-6101-gff0ad4b5e16b8828a6147ae2d5fec8068ef0778e
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Mon Dec 20 22:12:33 2021 +0100

    Fortran: BOZ literal constants are not interoperable

    gcc/fortran/ChangeLog:

            PR fortran/103778
            * check.c (is_c_interoperable): A BOZ literal constant is not
            interoperable.

    gcc/testsuite/ChangeLog:

            PR fortran/103778
            * gfortran.dg/illegal_boz_arg_3.f90: New test.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/103778] [10/11/12 Regression] ICE: Invalid expression in gfc_element_size
  2021-12-20 17:54 [Bug fortran/103778] New: [10/11/12 Regression] ICE: Invalid expression in gfc_element_size gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2021-12-22 19:09 ` cvs-commit at gcc dot gnu.org
@ 2021-12-27 19:51 ` cvs-commit at gcc dot gnu.org
  2021-12-27 20:04 ` cvs-commit at gcc dot gnu.org
  2021-12-27 20:06 ` anlauf at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-27 19:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:e6dcc14640105d2daf9c7f279980543470be7866

commit r11-9418-ge6dcc14640105d2daf9c7f279980543470be7866
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Mon Dec 20 22:12:33 2021 +0100

    Fortran: BOZ literal constants are not interoperable

    gcc/fortran/ChangeLog:

            PR fortran/103778
            * check.c (is_c_interoperable): A BOZ literal constant is not
            interoperable.

    gcc/testsuite/ChangeLog:

            PR fortran/103778
            * gfortran.dg/illegal_boz_arg_3.f90: New test.

    (cherry picked from commit ff0ad4b5e16b8828a6147ae2d5fec8068ef0778e)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/103778] [10/11/12 Regression] ICE: Invalid expression in gfc_element_size
  2021-12-20 17:54 [Bug fortran/103778] New: [10/11/12 Regression] ICE: Invalid expression in gfc_element_size gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2021-12-27 19:51 ` cvs-commit at gcc dot gnu.org
@ 2021-12-27 20:04 ` cvs-commit at gcc dot gnu.org
  2021-12-27 20:06 ` anlauf at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-27 20:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:715842b02f8828f28affdbb5e164013c172a3fb9

commit r10-10362-g715842b02f8828f28affdbb5e164013c172a3fb9
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Mon Dec 20 22:12:33 2021 +0100

    Fortran: BOZ literal constants are not interoperable

    gcc/fortran/ChangeLog:

            PR fortran/103778
            * check.c (is_c_interoperable): A BOZ literal constant is not
            interoperable.

    gcc/testsuite/ChangeLog:

            PR fortran/103778
            * gfortran.dg/illegal_boz_arg_3.f90: New test.

    (cherry picked from commit ff0ad4b5e16b8828a6147ae2d5fec8068ef0778e)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/103778] [10/11/12 Regression] ICE: Invalid expression in gfc_element_size
  2021-12-20 17:54 [Bug fortran/103778] New: [10/11/12 Regression] ICE: Invalid expression in gfc_element_size gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2021-12-27 20:04 ` cvs-commit at gcc dot gnu.org
@ 2021-12-27 20:06 ` anlauf at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-12-27 20:06 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED
   Target Milestone|---                         |10.4
           Priority|P3                          |P4

--- Comment #6 from anlauf at gcc dot gnu.org ---
Fixed on affected branches.  Closing.

Thanks for the report!

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-12-27 20:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-20 17:54 [Bug fortran/103778] New: [10/11/12 Regression] ICE: Invalid expression in gfc_element_size gscfq@t-online.de
2021-12-20 20:33 ` [Bug fortran/103778] " anlauf at gcc dot gnu.org
2021-12-20 21:19 ` anlauf at gcc dot gnu.org
2021-12-22 19:09 ` cvs-commit at gcc dot gnu.org
2021-12-27 19:51 ` cvs-commit at gcc dot gnu.org
2021-12-27 20:04 ` cvs-commit at gcc dot gnu.org
2021-12-27 20:06 ` anlauf at gcc dot gnu.org

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).