Skip to contentSkip to conversation

gcc: ARC Fix conditional move contstraint.

PATCH New Vlad Zakharov 2 participants 4 messages Aug 26, 2016 – Aug 30, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gcc: ARC Fix conditional move contstraint.

The patch solves one of the ARC internal compiler issues.

Fixes:
http://autobuild.buildroot.net/results/1c4/1c4493c6a18b7a93a0368420c8f79032f9330891//
http://autobuild.buildroot.net/results/510/51071b790866b0c7083de3a94ad2a427009096af//
http://autobuild.buildroot.net/results/09e/09e037c628ca2a27d8eb832dd070f50ec7ebb72a//

---
 .../950-ARC-Fix-conditional-move-contstraint.patch | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 package/gcc/arc-2016.09-eng008/950-ARC-Fix-conditional-move-contstraint.patch
package/gcc/arc-2016.09-eng008/950-ARC-Fix-conditional-move-contstraint.patch new file +34 -0
new file mode 100644
index 0000000..153af6d
@@ -0,0 +1,34 @@
+From e569e9c2ce2273f5175e0928efd6e45c3e71c45f Mon Sep 17 00:00:00 2001
+From: Claudiu Zissulescu <[email protected]>
+Date: Mon, 22 Aug 2016 19:58:25 +0200
+Subject: [PATCH] [ARC] Fix conditional move contstraint
+
+Move pattern (movsi_insn) allows predicated instructions to be
+instructions which can hold all registers.  However, the conditional
+variant doesn't.  This patch fixes this problem.
+
+2016-08-22  Claudiu Zissulescu  <[email protected]>
+
+	* config/arc/arc.md (movsi_cond_exec): Update constraint.
+
+Signed-off-by: Claudiu Zissulescu  <[email protected]>
+---
+ gcc/config/arc/arc.md | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md
+index d87174a..607c6e6 100644
+--- a/gcc/config/arc/arc.md
++++ b/gcc/config/arc/arc.md
+@@ -3603,7 +3603,7 @@
+      (match_operator 3 "proper_comparison_operator"
+        [(match_operand 2 "cc_register" "Rcc,Rcc") (const_int 0)])
+      (set (match_operand:SI 0 "dest_reg_operand" "=w,w")
+-	  (match_operand:SI 1 "nonmemory_operand" "Lc,?Cal")))]
++	  (match_operand:SI 1 "nonmemory_operand" "LRac,?Cal")))]
+   ""
+   "mov.%d3 %0,%S1"
+   [(set_attr "type" "cmove")
+-- 
+2.6.3
+
Signature · 1 line
2.6.3
#1 lore raw

PATCH 1/1 gcc: ARC Fix conditional move contstraint.

Hello,

Typo in the commit title: contstraint -> constraint

Quoted 6 lines · Vlad Zakharov

The patch solves one of the ARC internal compiler issues.

Fixes:
http://autobuild.buildroot.net/results/1c4/1c4493c6a18b7a93a0368420c8f79032f9330891//
http://autobuild.buildroot.net/results/510/51071b790866b0c7083de3a94ad2a427009096af//
http://autobuild.buildroot.net/results/09e/09e037c628ca2a27d8eb832dd070f50ec7ebb72a//

Trailing slash not really needed, and we also need an empty line between the commit log contents and the SoB line.

Quoted 1 line

I've fixed up those issues and applied to master!

package/gcc/arc-2016.09-eng008/950-ARC-Fix-conditional-move-contstraint.patch line 28

Quoted 10 lines
package/gcc/arc-2016.09-eng008/950-ARC-Fix-conditional-move-contstraint.patch new file +10 -0
+diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md
+index d87174a..607c6e6 100644
+--- a/gcc/config/arc/arc.md
++++ b/gcc/config/arc/arc.md
+@@ -3603,7 +3603,7 @@
+      (match_operator 3 "proper_comparison_operator"
+        [(match_operand 2 "cc_register" "Rcc,Rcc") (const_int 0)])
+      (set (match_operand:SI 0 "dest_reg_operand" "=w,w")
+-	  (match_operand:SI 1 "nonmemory_operand" "Lc,?Cal")))]
++	  (match_operand:SI 1 "nonmemory_operand" "LRac,?Cal")))]

I have to say the gcc .md files are pretty arcane stuff, especially when you see such patches :-)

Thanks for fixing this issue. I'll rebuild the ARC toolchain right away, and deploy it on the autobuilders.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 gcc: ARC Fix conditional move contstraint.

In reply to Vlad Zakharov

Vlad, Alexey, Eugeniy,

Quoted 6 lines · Vlad Zakharov

The patch solves one of the ARC internal compiler issues.

Fixes:
http://autobuild.buildroot.net/results/1c4/1c4493c6a18b7a93a0368420c8f79032f9330891//
http://autobuild.buildroot.net/results/510/51071b790866b0c7083de3a94ad2a427009096af//
http://autobuild.buildroot.net/results/09e/09e037c628ca2a27d8eb832dd070f50ec7ebb72a//

FWIW, this last build issue is *not* fixed by this patch. This last build failure is on mesa3d, with:

main/get.c: In function '_mesa_GetBooleani_v':
main/get.c:2320:1: error: insn does not satisfy its constraints:
}
^
(insn 79 72 80 7 (set (reg/f:SI 147 virtual-stack-vars)

        (reg:SI 2 r2)) main/get.c:2315 3 {*movsi_insn}
     (nil))

main/get.c:2320:1: internal compiler error: in extract_constrain_insn, at recog.c:2190 Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.buildroot.net/> for instructions.

And the build result
http://autobuild.buildroot.net/results/5cc/5ccb47e2af780982d71d924ef30008f16573ad73//build-end.log
is the *exact* same failure, but at commit
https://git.buildroot.net/buildroot/commit/?id=2567f6f2f34a1ecfc25604bf8bf93b8bc065fc63,
which is *after* I committed and pushed your ARC fix (and the configuration was using the internal toolchain backend, so the toolchain was built from scratch).

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#3 lore raw

PATCH 1/1 gcc: ARC Fix conditional move contstraint.

Hi Thomas,

Looks like I tried to build it in a slightly different conditions.? I reproduced that bug and hope our team will be able to fix the issue soon.

Thank you for your remarks.

Signature · 2 lines
Best regards,
Vlad Zakharov <[email protected]>
Quoted 36 lines · Thomas Petazzoni

Vlad, Alexey, Eugeniy,

Quoted 7 lines · Vlad Zakharov

The patch solves one of the ARC internal compiler issues.

Fixes:
http://autobuild.buildroot.net/results/1c4/1c4493c6a18b7a93a0368420c8f79032f9330891//
http://autobuild.buildroot.net/results/510/51071b790866b0c7083de3a94ad2a427009096af//
http://autobuild.buildroot.net/results/09e/09e037c628ca2a27d8eb832dd070f50ec7ebb72a//

FWIW, this last build issue is *not* fixed by this patch. This last build failure is on mesa3d, with:

main/get.c: In function '_mesa_GetBooleani_v':
main/get.c:2320:1: error: insn does not satisfy its constraints:
?}
?^
(insn 79 72 80 7 (set (reg/f:SI 147 virtual-stack-vars)
????????(reg:SI 2 r2)) main/get.c:2315 3 {*movsi_insn}
?????(nil))
main/get.c:2320:1: internal compiler error: in extract_constrain_insn, at recog.c:2190 Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.buildroot.net/> for instructions.

And the build result
http://autobuild.buildroot.net/results/5cc/5ccb47e2af780982d71d924ef30008f16573ad73//build-end.log
is the *exact* same failure, but at commit
https://git.buildroot.net/buildroot/commit/?id=2567f6f2f34a1ecfc25604bf8bf93b8bc065fc63,
which is *after* I committed and pushed your ARC fix (and the configuration was using the internal toolchain backend, so the toolchain was built from scratch).

Best regards,

Thomas