public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Fāng-ruì Sòng" <maskray@google.com>
To: Florian Weimer <fw@deneb.enyo.de>
Cc: Fangrui Song via Libc-alpha <libc-alpha@sourceware.org>,
	 Adhemerval Zanella <adhemerval.zanella@linaro.org>
Subject: Re: [PATCH] stdlib/longlong.h: Remove lvalue to rvalue conversion
Date: Tue, 12 Oct 2021 00:24:51 -0700	[thread overview]
Message-ID: <CAFP8O3+sLdOEF9fXayh1Q8NT6cncJBm7SZxCAbXWEuNG06kETA@mail.gmail.com> (raw)
In-Reply-To: <87wnmiycsc.fsf@mid.deneb.enyo.de>

On Mon, Oct 11, 2021 at 11:37 PM Florian Weimer <fw@deneb.enyo.de> wrote:
>
> * Fangrui Song via Libc-alpha:
>
> > An output constraint takes a lvalue. While GCC happily strips the
> > incorrect lvalue to rvalue conversion, Clang Clang rejects the code by
> > default:
> >
> >     error: invalid use of a cast in a inline asm context requiring an lvalue: remove the cast or build with -fheinous-gnu-extensions
>
> As I wrote on the gcc-patches list, these casts may be needed in a few
> cases.  Just removing them may not be entirely correct.

You meant https://gcc.gnu.org/pipermail/gcc-patches/2021-October/581265.html

"This seems to alter the meanining of existing programs if sh and sl do
not have the expected type.
I think you need to add a compound expression and temporaries of type
USItype if you want to avoid the cast."


I tested this on x86-64 and aarch64 and saw no new failure.
If the concern is with exotic architectures like arc which we don't
have a good story, I can drop changes to these exotic architectures.

In addition, using a compound statement sorta defeats the purpose to
simplify the code.

  reply	other threads:[~2021-10-12  7:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-10 22:14 Fangrui Song
2021-10-10 22:21 ` Andrew Pinski
2021-10-10 23:15   ` Fangrui Song
2021-10-11  8:55     ` Paul Zimmermann
2021-10-11 21:58     ` Joseph Myers
2021-10-12  6:35       ` Paul Zimmermann
2021-10-12 13:51         ` Joseph Myers
2021-10-12  6:31 ` Florian Weimer
2021-10-12  7:24   ` Fāng-ruì Sòng [this message]
2021-10-12  7:59     ` Florian Weimer

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=CAFP8O3+sLdOEF9fXayh1Q8NT6cncJBm7SZxCAbXWEuNG06kETA@mail.gmail.com \
    --to=maskray@google.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fw@deneb.enyo.de \
    --cc=libc-alpha@sourceware.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).