public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "js-gcc at webkeks dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug objc/103639] [REGRESSION] GCC 11.2 (or even earlier) breaks switch case with break in fast enumeration loop
Date: Thu, 09 Dec 2021 21:44:47 +0000	[thread overview]
Message-ID: <bug-103639-4-1qLerRgs92@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103639-4@http.gcc.gnu.org/bugzilla/>

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

js-gcc at webkeks dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|wrong-code                  |

--- Comment #4 from js-gcc at webkeks dot org ---
Sure:

#import <ObjFW/ObjFW.h>

int
main()
{
        OFArray *array = [OFArray arrayWithObjects: @"a", @"b", nil];
        int someVar = 0;
        for (id object in array) {
                switch (someVar) {
                case 0:
                        OFLog(@"%@", object);
                        break;
                }
                OFLog(@"foo");
        }

        return 0;
}

Sorry, but something free-standing isn't possible as you need a collection
object. The same code should work with GNUstep by just replacing OF with NS.

  parent reply	other threads:[~2021-12-09 21:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09 20:59 [Bug objc/103639] New: " js-gcc at webkeks dot org
2021-12-09 21:05 ` [Bug objc/103639] " js-gcc at webkeks dot org
2021-12-09 21:11 ` js-gcc at webkeks dot org
2021-12-09 21:42 ` pinskia at gcc dot gnu.org
2021-12-09 21:44 ` js-gcc at webkeks dot org [this message]
2021-12-10  1:40 ` egallager at gcc dot gnu.org
2021-12-10  8:17 ` iains at gcc dot gnu.org
2021-12-10  8:41 ` [Bug objc/103639] [11/12 Regression] switch case with break in fast enumeration loop generates wrong code iains at gcc dot gnu.org
2021-12-10  9:52 ` iains at gcc dot gnu.org
2021-12-10 20:43 ` pinskia at gcc dot gnu.org
2021-12-29 15:19 ` jakub at gcc dot gnu.org
2021-12-29 15:31 ` jakub at gcc dot gnu.org
2021-12-29 15:36 ` iains at gcc dot gnu.org
2021-12-29 16:22 ` jakub at gcc dot gnu.org
2021-12-29 19:59 ` iains at gcc dot gnu.org
2021-12-29 20:29 ` iains at gcc dot gnu.org
2021-12-29 20:30 ` jakub at gcc dot gnu.org
2021-12-29 20:35 ` iains at gcc dot gnu.org
2022-01-01  5:32 ` cvs-commit at gcc dot gnu.org
2022-01-04  9:11 ` [Bug objc/103639] [11 " rguenth at gcc dot gnu.org
2022-01-24  9:21 ` cvs-commit at gcc dot gnu.org
2022-01-24  9:29 ` jakub at gcc dot gnu.org
2022-01-24  9:31 ` jakub 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-103639-4-1qLerRgs92@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).