aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-01-30 12:58:20 +0100
committerJakub Jelinek <jakub@redhat.com>2020-01-30 12:58:20 +0100
commitefd26bbc81e94a324b3d3331a32eac089af8db1d (patch)
tree0f1b91c863f79e09ff6cd981aa16a98a5e4ae530 /gcc
parent5ab5d81b364ba500b288d9bcc1232ce7953a3b3f (diff)
downloadgcc-efd26bbc81e94a324b3d3331a32eac089af8db1d.zip
gcc-efd26bbc81e94a324b3d3331a32eac089af8db1d.tar.gz
gcc-efd26bbc81e94a324b3d3331a32eac089af8db1d.tar.bz2
arm: Fix uaddvdi4 expander [PR93494]
uaddvdi4 expander has an optimization for the low 32-bits of the 2nd input operand known to be 0. Unfortunately, in that case it only emits copying of the low 32 bits to the low 32 bits of the destination, but doesn't emit the addition with overflow detection for the high 64 bits. Well, to be precise, it emits it, but into an RTL sequence returned by gen_uaddvsi4, but that sequence isn't emitted anywhere. 2020-01-30 Jakub Jelinek <jakub@redhat.com> PR target/93494 * config/arm/arm.md (uaddvdi4): Actually emit what gen_uaddvsi4 returned. * gcc.c-torture/execute/pr93494.c: New test.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/arm/arm.md2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr93494.c13
4 files changed, 23 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4beb639..a141e06 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2020-01-30 Jakub Jelinek <jakub@redhat.com>
+ PR target/93494
+ * config/arm/arm.md (uaddvdi4): Actually emit what gen_uaddvsi4
+ returned.
+
PR target/91824
* config/i386/sse.md
(*<sse>_movmsk<ssemodesuffix><avxsizesuffix>_zext): Renamed to ...
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 0454908..dd73263 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -721,7 +721,7 @@
if (!arm_add_operand (hi_op2, SImode))
hi_op2 = force_reg (SImode, hi_op2);
- gen_uaddvsi4 (hi_result, hi_op1, hi_op2, operands[3]);
+ emit_insn (gen_uaddvsi4 (hi_result, hi_op1, hi_op2, operands[3]));
}
else
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 597788a..ab61b48 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-01-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/93494
+ * gcc.c-torture/execute/pr93494.c: New test.
+
2020-01-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/90338
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr93494.c b/gcc/testsuite/gcc.c-torture/execute/pr93494.c
new file mode 100644
index 0000000..ef70403
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr93494.c
@@ -0,0 +1,13 @@
+/* PR target/93494 */
+
+unsigned short a;
+
+int
+main ()
+{
+ register unsigned long long y = 0;
+ int x = __builtin_add_overflow (y, 0ULL, &a);
+ if (x || a)
+ __builtin_abort ();
+ return 0;
+}