From: Segher Boessenkool <segher@kernel.crashing.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
Uros Bizjak <ubizjak@gmail.com>,
GCC Development <gcc@gcc.gnu.org>, X86 ML <x86@kernel.org>,
Jakub Jelinek <jakub@redhat.com>,
Andy Lutomirski <luto@amacapital.net>,
linux-toolchains@vger.kernel.org,
Christian Borntraeger <borntraeger@de.ibm.com>,
Will Deacon <will@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: typeof and operands in named address spaces
Date: Wed, 11 Nov 2020 18:47:59 -0600 [thread overview]
Message-ID: <20201112004759.GO2672@gate.crashing.org> (raw)
In-Reply-To: <20201110075742.GT2594@hirez.programming.kicks-ass.net>
On Tue, Nov 10, 2020 at 08:57:42AM +0100, Peter Zijlstra wrote:
> On Mon, Nov 09, 2020 at 11:50:15AM -0800, Nick Desaulniers wrote:
> > On Mon, Nov 9, 2020 at 11:46 AM Segher Boessenkool
> > <segher@kernel.crashing.org> wrote:
> > > On Mon, Nov 09, 2020 at 01:47:13PM +0100, Peter Zijlstra wrote:
> > > > C in general does not provide means to strip qualifiers.
> > >
> > > Most ways you can try to use the result are undefined behaviour, even.
> >
> > Yes, removing `const` from a `const` declared variable (via cast) then
> > expecting to use the result is a great way to have clang omit the use
> > from the final program. This has bitten us in the past getting MIPS
> > support up and running, and one of the MTK gfx drivers.
>
> Stripping const to delcare another variable is useful though. Sure C has
> sharp edges, esp. if you cast stuff, but since when did that stop anyone
> ;-)
My point is that removing most qualifiers usually is a problem, so
before doing this, we should think if it is such a good plan, whether
there is a safer / saner solution, etc.
Segher
next prev parent reply other threads:[~2020-11-12 1:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAFULd4aOca3k-AZ+ocMBqDRpH_kNisBQwfK0F4Jf7znsPxsrBw@mail.gmail.com>
2020-11-09 12:47 ` typeof and operands in named address spaces Peter Zijlstra
2020-11-09 19:38 ` Segher Boessenkool
2020-11-09 19:50 ` Nick Desaulniers
2020-11-10 7:57 ` Peter Zijlstra
2020-11-10 18:42 ` Nick Desaulniers
2020-11-10 20:11 ` Peter Zijlstra
2020-11-12 0:40 ` Segher Boessenkool
2025-05-29 6:29 ` Uros Bizjak
2020-11-12 0:47 ` Segher Boessenkool [this message]
2020-11-10 7:52 ` Peter Zijlstra
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=20201112004759.GO2672@gate.crashing.org \
--to=segher@kernel.crashing.org \
--cc=borntraeger@de.ibm.com \
--cc=gcc@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=linux-toolchains@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mpe@ellerman.id.au \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.org \
--cc=torvalds@linux-foundation.org \
--cc=ubizjak@gmail.com \
--cc=will@kernel.org \
--cc=x86@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.