[llvm-dev] Proposed patches for Android Build errors

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] Proposed patches for Android Build errors

Sam McCall via llvm-dev
Hi,
I'm sending two proposed patches to avoid building errors in llvm70 master

With you compiler/buildchain you may not see these errors,
but they are happening with Android Build System (oreo-x86 based on 8.1.0_r18)

Please review and correct them if needed

Mauro Rossi
android-x86 team

[PATCH 1/2] AMDGPU/SIInsertWaitcnts: Fix comparison of integers of diff signs
[PATCH 2/2] Object/WasmObjectFile: Fix comparison of different signs

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] [PATCH 1/2] AMDGPU/SIInsertWaitcnts: Fix comparison of integers of different signs

Sam McCall via llvm-dev
Fixes the following building error:

external/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp:1903:61:
error: comparison of integers of different signs:
'typename iterator_traits<__wrap_iter<MachineBasicBlock **> >::difference_type'
(aka 'int') and 'unsigned int' [-Werror,-Wsign-compare]
                      BlockWaitcntProcessedSet.end(), &MBB) < Count)) {
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~
1 error generated.

Fixes: 4f520606fc ("[AMDGPU] Do not only rely on BB number when finding bottom loop")
---
 lib/Target/AMDGPU/SIInsertWaitcnts.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Target/AMDGPU/SIInsertWaitcnts.cpp b/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
index fb24d528c33..c3c93cc85e2 100644
--- a/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+++ b/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
@@ -1900,7 +1900,7 @@ bool SIInsertWaitcnts::runOnMachineFunction(MachineFunction &MF) {
       // If the loop has multiple back-edges, and so more than one "bottom"
       // basic block, we have to guarantee a re-walk over every blocks.
       if ((std::count(BlockWaitcntProcessedSet.begin(),
-                      BlockWaitcntProcessedSet.end(), &MBB) < Count)) {
+                      BlockWaitcntProcessedSet.end(), &MBB) < (int) Count)) {
         BlockWaitcntBracketsMap[&MBB]->setRevisitLoop(true);
         LLVM_DEBUG(dbgs() << "set-revisit1: Block"
                           << ContainingLoop->getHeader()->getNumber() << '\n';);
--
2.17.1

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] [PATCH 2/2] Object/WasmObjectFile: Fix comparison of different signs

Sam McCall via llvm-dev
In reply to this post by Sam McCall via llvm-dev
Fixes the following building error:

external/llvm/lib/Object/WasmObjectFile.cpp:978:14:
error: comparison of integers of different signs:
'uint32_t' (aka 'unsigned int') and 'int' [-Werror,-Wsign-compare]
    if (Size > Ctx.End - Ctx.Ptr)
        ~~~~ ^ ~~~~~~~~~~~~~~~~~
1 error generated.

Fixes: 50617cfe72 ("[WebAssembly] Add more error checking to object file parsing")
---
 lib/Object/WasmObjectFile.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Object/WasmObjectFile.cpp b/lib/Object/WasmObjectFile.cpp
index 2f91a973dda..ba5e6ac4cb3 100644
--- a/lib/Object/WasmObjectFile.cpp
+++ b/lib/Object/WasmObjectFile.cpp
@@ -975,7 +975,7 @@ Error WasmObjectFile::parseDataSection(ReadContext &Ctx) {
     if (Error Err = readInitExpr(Segment.Data.Offset, Ctx))
       return Err;
     uint32_t Size = readVaruint32(Ctx);
-    if (Size > Ctx.End - Ctx.Ptr)
+    if (Size > (uint32_t) (Ctx.End - Ctx.Ptr))
       return make_error<GenericBinaryError>("Invalid segment size",
                                             object_error::parse_failed);
     Segment.Data.Content = ArrayRef<uint8_t>(Ctx.Ptr, Size);
--
2.17.1

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Proposed patches for Android Build errors

Sam McCall via llvm-dev
In reply to this post by Sam McCall via llvm-dev
Hi Mauro,

the more common process is to do reviews via Phabricator. In any case,
patch #1 looks good to me. Do you have commit access?

Cheers,
Nicolai

On 10.06.2018 15:34, Mauro Rossi via llvm-dev wrote:

> Hi,
> I'm sending two proposed patches to avoid building errors in llvm70 master
>
> With you compiler/buildchain you may not see these errors,
> but they are happening with Android Build System (oreo-x86 based on 8.1.0_r18)
>
> Please review and correct them if needed
>
> Mauro Rossi
> android-x86 team
>
> [PATCH 1/2] AMDGPU/SIInsertWaitcnts: Fix comparison of integers of diff signs
> [PATCH 2/2] Object/WasmObjectFile: Fix comparison of different signs
>
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>


--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev