bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Sam James <sam@gentoo.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: arnold@skeeve.com, Gnulib bugs <bug-gnulib@gnu.org>,
	concord@gentoo.org, bug-gawk@gnu.org
Subject: Re: Clang-built Gawk 5.2.1 regex oddity
Date: Tue, 3 Jan 2023 02:43:14 +0000	[thread overview]
Message-ID: <928FEE7D-2F32-4952-A6F8-681BBE8DA914@gentoo.org> (raw)
In-Reply-To: <F4F78F36-49A9-4FB0-BF95-1984AF1FB6D1@gentoo.org>

[-- Attachment #1: Type: text/plain, Size: 1598 bytes --]



> On 3 Jan 2023, at 02:14, Sam James <sam@gentoo.org> wrote:
> 
> 
> 
>> On 2 Jan 2023, at 06:10, Paul Eggert <eggert@cs.ucla.edu> wrote:
>> 
>> This is a serious bug in Clang: it generates incorrect machine code.
>> 
>> [snip]
>> 
>> My guess is that Clang got confused because dfaerror is declared _Noreturn, so Clang mistakenly assumed that dfawarn is also _Noreturn, which it is not.
>> 
>> I worked around the Clang bug by installed the attached patch into Gnulib. Please give it a try with Gawk.
> 
> Confirmed this mitigates the problem. I had to apply it manually to support/ as I couldn't immediately see how to sync gnulib myself, but that's no big deal.
> 
>> 
>> Incorrect code generation is a serious bug in Clang; can you please report it to the Clang folks? I am considering using a bigger hammer, and doing this:
>> 
> 
> Kenton's done this at https://github.com/llvm/llvm-project/issues/59792 now.
> 
>>  #define _Noreturn /*empty*/
>> 
>> whenever Clang is used, until the bug is fixed.
>> 
> 
> maskray's analysis so far at https://github.com/llvm/llvm-project/issues/59792#issuecomment-1369314436 agrees with yours, which would mean
> this is likely a good idea.
> 

By the way, when I ran gnulib's test suite following https://sourceware.org/glibc/wiki/Testing/Gnulib, I didn't get any failures
with Clang. I was expecting to get one (before your commit) for DFA.

Maybe we should shoehorn a similar ternary expression into tests/test-dfa-match-aux.c so we're guaranteed
a test failure with bad compilers if someone uses the DFA module?

[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 358 bytes --]

  reply	other threads:[~2023-01-03  2:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20221230000119.hyui6umnspuyzqum@bubbles>
     [not found] ` <202212300913.2BU9DV6V030160@freefriends.org>
     [not found]   ` <6DADB0FC-87EE-4028-91DF-C93A968A8982@gentoo.org>
2023-01-01 19:06     ` Clang-built Gawk 5.2.1 regex oddity arnold
2023-01-02  6:10       ` Paul Eggert
2023-01-03  2:14         ` Sam James
2023-01-03  2:43           ` Sam James [this message]
2023-01-05 23:06         ` Arsen Arsenović
2023-01-06 12:21           ` arnold
2023-01-13  7:03           ` Sam James

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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to=928FEE7D-2F32-4952-A6F8-681BBE8DA914@gentoo.org \
    --to=sam@gentoo.org \
    --cc=arnold@skeeve.com \
    --cc=bug-gawk@gnu.org \
    --cc=bug-gnulib@gnu.org \
    --cc=concord@gentoo.org \
    --cc=eggert@cs.ucla.edu \
    /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).