jrtc27 wrote:
> > But yes, the short answer is that the code as written should work on
> > Morello and CHERI-RISC-V.
>
> Great, thanks.
>
> > > > The std::launder may be unnecessary
> > >
> > >
> > > Formally I think it's correct and necessary for the pointer and integer
> > > case because
zygoloid wrote:
> But yes, the short answer is that the code as written should work on Morello
> and CHERI-RISC-V.
Great, thanks.
> > > The std::launder may be unnecessary
> >
> >
> > Formally I think it's correct and necessary for the pointer and integer
> > case because an array element a
jrtc27 wrote:
> > How about:
> > [...]
>
> Yeah, I think that fixes it. For me that looks a lot less simple than using a
> union, but it is nice to have only a single implementation. I'd be fine with
> going in that direction.
>
> For CHERI, can we assume that the least-significant byte of th
zygoloid wrote:
> How about:
> [...]
Yeah, I think that fixes it. For me that looks a lot less simple than using a
union, but it is nice to have only a single implementation. I'd be fine with
going in that direction.
For CHERI, can we assume that the least-significant byte of the pointer
rep
jrtc27 wrote:
> > > > #112806 should address this without narrowing the field to 32 bits.
> > >
> > >
> > > As does [#111995
> > > (comment)](https://github.com/llvm/llvm-project/pull/111995#discussion_r1805329590),
> > > with less code and more generality
> >
> >
> > I prefer this solution
zygoloid wrote:
> > > #112806 should address this without narrowing the field to 32 bits.
> >
> >
> > As does [#111995
> > (comment)](https://github.com/llvm/llvm-project/pull/111995#discussion_r1805329590),
> > with less code and more generality
>
> I prefer this solution too.
That solutio
ChuanqiXu9 wrote:
> > #112806 should address this without narrowing the field to 32 bits.
>
> As does [#111995
> (comment)](https://github.com/llvm/llvm-project/pull/111995#discussion_r1805329590),
> with less code and more generality
I prefer this solution too.
https://github.com/llvm/llvm-
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
jrtc27 wrote:
> #112806 should address this without narrowing the field to 32 bits.
As does
https://github.com/llvm/llvm-project/pull/111995#discussion_r1805329590, with
less code and more generality
https://github.com/llvm/llvm-project/pull/111995
zygoloid wrote:
#112806 should address this without narrowing the field to 32 bits.
https://github.com/llvm/llvm-project/pull/111995
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ernsteiswuerfel wrote:
This also fixes issue
[#86460](https://github.com/llvm/llvm-project/issues/86460)!
The patch applies cleanly on top of 19.1.2 (tested on ppc32-musl).
https://github.com/llvm/llvm-project/pull/111995
___
cfe-commits mailing list
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
https://github.com/jrtc27 edited
https://github.com/llvm/llvm-project/pull/111995
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
https://github.com/jrtc27 edited
https://github.com/llvm/llvm-project/pull/111995
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
https://github.com/rjmccall edited
https://github.com/llvm/llvm-project/pull/111995
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rjmccall edited
https://github.com/llvm/llvm-project/pull/111995
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/rjmccall edited
https://github.com/llvm/llvm-project/pull/111995
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
ChuanqiXu9 wrote:
> > > Can we remove `getAddressOfPointer` instead?. Where is it being used?
> >
> >
> > It is used in `VarDecl::getInitAddress()` in Decl.cpp. It looks like it is
> > used indirectly by the StmtIterator
>
> And that in turn is used in `StmtIterator`, and indeed we can end up
zygoloid wrote:
> > Can we remove `getAddressOfPointer` instead?. Where is it being used?
>
> It is used in `VarDecl::getInitAddress()` in Decl.cpp. It looks like it is
> used indirectly by the StmtIterator
And that in turn is used in `StmtIterator`, and indeed we can end up *storing
through*
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
awilfox wrote:
> Btw, if you submit a fix, it would be great if it could be backported to the
> 18 and 19 branches.
I think the 18 branch may already be closed. This is what we are shipping in
Adélie for 18:
[big-endian-32.patch](https://github.com/user-attachments/files/17404400/big-endian-
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
glaubitz wrote:
Btw, if you submit a fix, it would be great if it could be backported to the 18
and 19 branches.
https://github.com/llvm/llvm-project/pull/111995
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/ma
glaubitz wrote:
> cc @glaubitz (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113341)
I can confirm that the patch from this PR fixes the GCC bootstrap on 32-bit
PowerPC on Linux for me (GCC pr/target 113341).
https://github.com/llvm/llvm-project/pull/111995
ChuanqiXu9 wrote:
> Can we remove `getAddressOfPointer` instead?. Where is it being used?
It is used in `VarDecl::getInitAddress()` in Decl.cpp. It looks like it is used
indirectly by the StmtIterator
https://github.com/llvm/llvm-project/pull/111995
https://github.com/zygoloid commented:
Can we remove `getAddressOfPointer` instead?. Where is it being used?
https://github.com/llvm/llvm-project/pull/111995
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman
thesamesam wrote:
cc @glaubitz (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113341)
https://github.com/llvm/llvm-project/pull/111995
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -326,25 +326,25 @@ struct LazyOffsetPtr {
///
/// If the low bit is clear, a pointer to the AST node. If the low
/// bit is set, the upper 63 bits are the offset.
- mutable uint64_t Ptr = 0;
+ mutable uintptr_t Ptr = 0;
public:
LazyOffsetPtr() = default;
- exp
awilfox wrote:
I feel like the messages being highlighted in the CI formatter need work
anyway. I was hoping the community would have a suggestion on better wording.
However, I will be glad to reformat those lines in that manner if this wording
should stay.
https://github.com/llvm/llvm-proj
awilfox wrote:
This patch has been tested on 32-bit PowerPC, 64-bit PowerPC, and 64-bit x86_64
(ensuring it doesn't change any behaviour on LE systems) - the entire Clang
test suite passed on all three platforms.
https://github.com/llvm/llvm-project/pull/111995
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: A. Wilcox (awilfox)
Changes
On big-endian systems, narrow casting will read the higher bits of the value.
LazyOffsetPtr's `getAddressOfPointer` returns the address-of `Ptr` which was
unconditionally a 64-bit value. On 32-bit big endian
github-actions[bot] wrote:
Thank you for submitting a Pull Request (PR) to the LLVM Project!
This PR will be automatically labeled and the relevant teams will be notified.
If you wish to, you can add reviewers by using the "Reviewers" section on this
page.
If this is not working for you, it
https://github.com/awilfox created
https://github.com/llvm/llvm-project/pull/111995
On big-endian systems, narrow casting will read the higher bits of the value.
LazyOffsetPtr's `getAddressOfPointer` returns the address-of `Ptr` which was
unconditionally a 64-bit value. On 32-bit big endian
49 matches
Mail list logo