]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorJeff Law <law@gcc.gnu.org>
Thu, 24 Apr 2014 20:45:10 +0000 (14:45 -0600)
committerJeff Law <law@gcc.gnu.org>
Thu, 24 Apr 2014 20:45:10 +0000 (14:45 -0600)
2014-04-24  Segher Boessenkool  <segher@kernel.crashing.org>

PR target/60822
* config/m68k/m68k.md (extendplussidi): Don't allow memory for
operand 1.

2014-04-24  Jeff Law  <law@redhat.com>

PR target/60822
* gcc.c-torture/pr60822.c: New test.
* gcc.c-torture/pr60822.x: New test.

From-SVN: r209759

gcc/ChangeLog
gcc/config/m68k/m68k.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr60822.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/pr60822.x [new file with mode: 0644]

index a29383083b3759d9a038e14e8b3cbaca1f58d166..6100b75683bb3d5cc6ae97578324312fcc818f5c 100644 (file)
@@ -1,3 +1,9 @@
+2014-04-24  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       PR target/60822
+       * config/m68k/m68k.md (extendplussidi): Don't allow memory for
+       operand 1.
+
 2014-04-24  Dimitris Papavasiliou  <dpapavas@gmail.com>
 
        * flag-types.h (enum ivar_visibility): Add.
index e61048b4d0b6c32b24264975e966e20af664d76c..72c11f592db8b2c49a8dcb192f1907df8a8f6c3b 100644 (file)
 ;; Maybe there is a way to make that the general case, by forcing the
 ;; result of the SI tree to be in the lower register of the DI target
 
+;; Don't allow memory for operand 1 as that would require an earlyclobber
+;; which results in worse code
 (define_insn "extendplussidi"
   [(set (match_operand:DI 0 "register_operand" "=d")
-    (sign_extend:DI (plus:SI (match_operand:SI 1 "general_operand" "%rmn")
+    (sign_extend:DI (plus:SI (match_operand:SI 1 "general_operand" "%rn")
             (match_operand:SI 2 "general_operand" "rmn"))))]
   ""
 {
index 32cccf27185aa1003e2807b9bbe4c27efbf0e4c0..413d6ce8615e67bcdc14454d277379b90b5072a2 100644 (file)
@@ -1,3 +1,9 @@
+2014-04-24  Jeff Law  <law@redhat.com>
+
+       PR target/60822
+       * gcc.c-torture/pr60822.c: New test.
+       * gcc.c-torture/pr60822.x: New test.
+
 2014-04-24  Dinar Temirbulatov  <dtemirbulatov@gmail.com>
 
        PR c++/57958
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr60822.c b/gcc/testsuite/gcc.c-torture/execute/pr60822.c
new file mode 100644 (file)
index 0000000..d225331
--- /dev/null
@@ -0,0 +1,24 @@
+struct X {
+    char fill0[800000];
+    int a;
+    char fill1[900000];
+    int b;
+};
+
+int __attribute__((noinline,noclone))
+Avg(struct X *p, int s)
+{
+    return (s * (long long)(p->a + p->b)) >> 17;
+}
+
+struct X x;
+
+int main()
+{
+    x.a = 1 << 17;
+    x.b = 2 << 17;
+    if (Avg(&x, 1) != 3)
+       __builtin_abort();
+    return 0;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr60822.x b/gcc/testsuite/gcc.c-torture/execute/pr60822.x
new file mode 100644 (file)
index 0000000..4efed4c
--- /dev/null
@@ -0,0 +1,7 @@
+load_lib target-supports.exp
+
+if { [check_effective_target_int32plus] } {
+       return 0
+}
+
+return 1;