]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2014-02-07 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
authorAndreas Krebbel <Andreas.Krebbel@de.ibm.com>
Fri, 7 Feb 2014 14:22:41 +0000 (14:22 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Fri, 7 Feb 2014 14:22:41 +0000 (14:22 +0000)
* config/s390/s390.md ("atomic_load<mode>", "atomic_store<mode>")
("atomic_compare_and_swap<mode>", "atomic_fetch_<atomic><mode>"):
Reject misaligned operands.

From-SVN: r207601

gcc/ChangeLog
gcc/config/s390/s390.md

index 106a30d39bc2195c17e697005e7ac7419612ea91..13fac243bb4033dabec3ef9fa62b3a35decc6e02 100644 (file)
@@ -1,3 +1,9 @@
+2014-02-07  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
+
+       * config/s390/s390.md ("atomic_load<mode>", "atomic_store<mode>")
+       ("atomic_compare_and_swap<mode>", "atomic_fetch_<atomic><mode>"):
+       Reject misaligned operands.
+
 2014-02-07  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
        * optabs.c (expand_atomic_compare_and_swap): Allow expander to
index bccc159abc72875f15c8b5ed6273db901d83bd09..3f863048ef95c214730c2045335c34dafbe7b355 100644 (file)
    (match_operand:SI 2 "const_int_operand")]   ;; model
   ""
 {
+  if (MEM_ALIGN (operands[1]) < GET_MODE_BITSIZE (GET_MODE (operands[1])))
+    FAIL;
+
   if (<MODE>mode == TImode)
     emit_insn (gen_atomic_loadti_1 (operands[0], operands[1]));
   else if (<MODE>mode == DImode && !TARGET_ZARCH)
 {
   enum memmodel model = (enum memmodel) INTVAL (operands[2]);
 
+  if (MEM_ALIGN (operands[0]) < GET_MODE_BITSIZE (GET_MODE (operands[0])))
+    FAIL;
+
   if (<MODE>mode == TImode)
     emit_insn (gen_atomic_storeti_1 (operands[0], operands[1]));
   else if (<MODE>mode == DImode && !TARGET_ZARCH)
   if (!register_operand (output, <MODE>mode))
     output = gen_reg_rtx (<MODE>mode);
 
+  if (MEM_ALIGN (operands[2]) < GET_MODE_BITSIZE (GET_MODE (operands[2])))
+    FAIL;
+
   emit_insn (gen_atomic_compare_and_swap<mode>_internal
             (output, operands[2], operands[3], operands[4]));
 
    (match_operand:SI 3 "const_int_operand")]           ;; model
   "TARGET_Z196"
 {
+  if (MEM_ALIGN (operands[1]) < GET_MODE_BITSIZE (GET_MODE (operands[1])))
+    FAIL;
+
   emit_insn (gen_atomic_fetch_<atomic><mode>_iaf
             (operands[0], operands[1], operands[2]));
   DONE;