public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug modula2/112946] New: Assignment of string to enumeration or set crashes
@ 2023-12-10 20:09 juriad at gmail dot com
  2023-12-12 11:23 ` [Bug modula2/112946] " gaius at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: juriad at gmail dot com @ 2023-12-10 20:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112946
           Summary: Assignment of string to enumeration or set crashes
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: juriad at gmail dot com
  Target Milestone: ---

Created attachment 56846
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56846&action=edit
reproducer + gcc crash output + crash report

I am playing with Modula-2 (due to Advent of Code). I compiled GCC from master
branch (fbfe43daec6443978df65530dc5f7f3f8a4e6f9e).

The attached program crashes when compiling (the error differs between strings
of length 1 and 2):

gm2 -freport-bug -fiso -static-libgm2 -o prg bug.mod

The full output is attached as well as the referenced report from /tmp/:

cc1gm2: internal compiler error: tree check: expected integer_cst, have
string_cst in get_len, at tree.h:6473

The expected behavior would be to show the error as usual with highlighted line
and explanation.

Apart from this crash, I encountered one more issue which may not be an error
(no idea; I have less than 1 day of experience with Modula) but would deserve
at least a warning. Arithmetic between set and enumeration does not produce
what I would expect.

DIRS := Dirs{Left, Right};
DIRS := DIRS + Up;
IF NOT (Up IN DIRS) THEN
        HALT
END;

On the other hand:

DIRS := Dirs{Left, Right} + Up;

leads to another crash:

cc1gm2: internal compiler error: expecting type of constant to be a set

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

end of thread, other threads:[~2024-01-11  0:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-10 20:09 [Bug modula2/112946] New: Assignment of string to enumeration or set crashes juriad at gmail dot com
2023-12-12 11:23 ` [Bug modula2/112946] " gaius at gcc dot gnu.org
2023-12-15 15:14 ` gaius at gcc dot gnu.org
2023-12-15 15:27 ` cvs-commit at gcc dot gnu.org
2023-12-15 15:28 ` gaius at gcc dot gnu.org
2023-12-15 15:42 ` gaiusmod2 at gmail dot com
2023-12-16  7:27 ` gaius at gcc dot gnu.org
2024-01-10 20:01 ` gaius at gcc dot gnu.org
2024-01-11  0:54 ` cvs-commit at gcc dot gnu.org
2024-01-11  0:56 ` gaius 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).