public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug modula2/114296] ICE when attempting to create a constant set with a variable element Date: Sun, 17 Mar 2024 14:50:52 +0000 [thread overview] Message-ID: <bug-114296-4-eUWfrNYRvE@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-114296-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114296 --- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Gaius Mulley <gaius@gcc.gnu.org>: https://gcc.gnu.org/g:f065c582d9c8e0a4fee7ee563c584ee3b1975bea commit r14-9506-gf065c582d9c8e0a4fee7ee563c584ee3b1975bea Author: Gaius Mulley <gaiusmod2@gmail.com> Date: Sun Mar 17 14:49:23 2024 +0000 PR modula2/114296 ICE when attempting to create a constant set with a variable element This patch corrects the virtual token creation for the aggregate constant and also corrects tokens for constructor components. gcc/m2/ChangeLog: PR modula2/114296 * gm2-compiler/M2ALU.mod (ElementsSolved): Add tokenno parameter. Add constant checks and generate error messages. (EvalSetValues): Pass tokenno parameter to ElementsSolved. * gm2-compiler/M2LexBuf.mod (stop): New procedure. (MakeVirtualTok): Call stop if caret = BadTokenNo. * gm2-compiler/M2Quads.def (BuildNulExpression): Add tokpos parameter. (BuildSetStart): Ditto. (BuildEmptySet): Ditto. (BuildConstructorEnd): Add startpos parameter. (BuildTypeForConstructor): Add tokpos parameter. * gm2-compiler/M2Quads.mod (BuildNulExpression): Add tokpos parameter and push tokpos to the quad stack. (BuildSetStart): Add tokpos parameter and push tokpos. (BuildSetEnd): Rewrite. (BuildEmptySet): Add tokpos parameter and push tokpos with the set type. (BuildConstructorStart): Pop typepos. (BuildConstructorEnd): Add startpos parameter. Create valtok from startpos and cbratokpos. (BuildTypeForConstructor): Add tokpos parameter. * gm2-compiler/M2Range.def (InitAssignmentRangeCheck): Rename d to des and e to expr. Add destok and exprtok parameters. * gm2-compiler/M2Range.mod (InitAssignmentRangeCheck): Rename d to des and e to expr. Add destok and exprtok parameters. Save destok and exprtok into range record. (FoldAssignment): Pass exprtok to TryDeclareConstant. * gm2-compiler/P3Build.bnf (ComponentValue): Rewrite. (Constructor): Rewrite. (ConstSetOrQualidentOrFunction): Rewrite. (SetOrQualidentOrFunction): Rewrite. * gm2-compiler/PCBuild.bnf (ConstSetOrQualidentOrFunction): Rewrite. (SetOrQualidentOrFunction): Rewrite. * gm2-compiler/PHBuild.bnf (Constructor): Rewrite. (ConstSetOrQualidentOrFunction): Rewrite. gcc/testsuite/ChangeLog: PR modula2/114296 * gm2/pim/fail/badtype2.mod: New test. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
next prev parent reply other threads:[~2024-03-17 14:50 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-03-10 11:14 [Bug modula2/114296] New: " gaius at gcc dot gnu.org 2024-03-10 11:14 ` [Bug modula2/114296] " gaius at gcc dot gnu.org 2024-03-16 18:00 ` gaius at gcc dot gnu.org 2024-03-17 14:50 ` cvs-commit at gcc dot gnu.org [this message] 2024-03-17 14:55 ` gaius 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-114296-4-eUWfrNYRvE@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: linkBe 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).