@@ -419,10 +419,11 @@
; CLOB means that the condition codes are altered in an undefined manner, if
; they are altered at all
;
-; UNCONDITIONAL means the instions can not be conditionally executed.
+; UNCONDITIONAL means the instruction can not be conditionally executed and
+; that the instruction does not use or alter the condition codes.
;
-; NOCOND means that the condition codes are neither altered nor affect the
-; output of this insn
+; NOCOND means that the instruction does not use or alter the condition
+; codes but can be converted into a conditionally exectuted instruction.
(define_attr "conds" "use,set,clob,unconditional,nocond"
(if_then_else
@@ -300,7 +300,7 @@
(set_attr "sync_new_value" "3")
(set_attr "sync_t1" "0")
(set_attr "sync_t2" "4")
- (set_attr "conds" "nocond")
+ (set_attr "conds" "clob")
(set_attr "predicable" "no")])
(define_insn "arm_sync_compare_and_swap<mode>"
@@ -327,7 +327,7 @@
(set_attr "sync_new_value" "3")
(set_attr "sync_t1" "0")
(set_attr "sync_t2" "4")
- (set_attr "conds" "nocond")
+ (set_attr "conds" "clob")
(set_attr "predicable" "no")])
(define_insn "arm_sync_lock_test_and_setsi"
@@ -348,7 +348,7 @@
(set_attr "sync_new_value" "2")
(set_attr "sync_t1" "0")
(set_attr "sync_t2" "3")
- (set_attr "conds" "nocond")
+ (set_attr "conds" "clob")
(set_attr "predicable" "no")])
(define_insn "arm_sync_lock_test_and_set<mode>"
@@ -369,7 +369,7 @@
(set_attr "sync_new_value" "2")
(set_attr "sync_t1" "0")
(set_attr "sync_t2" "3")
- (set_attr "conds" "nocond")
+ (set_attr "conds" "clob")
(set_attr "predicable" "no")])
(define_insn "arm_sync_new_<sync_optab>si"
@@ -394,7 +394,7 @@
(set_attr "sync_t1" "0")
(set_attr "sync_t2" "3")
(set_attr "sync_op" "<sync_optab>")
- (set_attr "conds" "nocond")
+ (set_attr "conds" "clob")
(set_attr "predicable" "no")])
(define_insn "arm_sync_new_nandsi"
@@ -419,7 +419,7 @@
(set_attr "sync_t1" "0")
(set_attr "sync_t2" "3")
(set_attr "sync_op" "nand")
- (set_attr "conds" "nocond")
+ (set_attr "conds" "clob")
(set_attr "predicable" "no")])
(define_insn "arm_sync_new_<sync_optab><mode>"
@@ -445,7 +445,7 @@
(set_attr "sync_t1" "0")
(set_attr "sync_t2" "3")
(set_attr "sync_op" "<sync_optab>")
- (set_attr "conds" "nocond")
+ (set_attr "conds" "clob")
(set_attr "predicable" "no")])
(define_insn "arm_sync_new_nand<mode>"
@@ -472,7 +472,7 @@
(set_attr "sync_t1" "0")
(set_attr "sync_t2" "3")
(set_attr "sync_op" "nand")
- (set_attr "conds" "nocond")
+ (set_attr "conds" "clob")
(set_attr "predicable" "no")])
(define_insn "arm_sync_old_<sync_optab>si"
@@ -498,7 +498,7 @@
(set_attr "sync_t1" "3")
(set_attr "sync_t2" "4")
(set_attr "sync_op" "<sync_optab>")
- (set_attr "conds" "nocond")
+ (set_attr "conds" "clob")
(set_attr "predicable" "no")])
(define_insn "arm_sync_old_nandsi"
@@ -524,7 +524,7 @@
(set_attr "sync_t1" "3")
(set_attr "sync_t2" "4")
(set_attr "sync_op" "nand")
- (set_attr "conds" "nocond")
+ (set_attr "conds" "clob")
(set_attr "predicable" "no")])
(define_insn "arm_sync_old_<sync_optab><mode>"
@@ -551,7 +551,7 @@
(set_attr "sync_t1" "3")
(set_attr "sync_t2" "4")
(set_attr "sync_op" "<sync_optab>")
- (set_attr "conds" "nocond")
+ (set_attr "conds" "clob")
(set_attr "predicable" "no")])
(define_insn "arm_sync_old_nand<mode>"
@@ -578,7 +578,7 @@
(set_attr "sync_t1" "3")
(set_attr "sync_t2" "4")
(set_attr "sync_op" "nand")
- (set_attr "conds" "nocond")
+ (set_attr "conds" "clob")
(set_attr "predicable" "no")])
(define_insn "*memory_barrier"
new file mode 100644
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -march=armv7-a" } */
+
+volatile int mem;
+
+int
+bar (int x, int y)
+{
+ if (x)
+ __sync_fetch_and_add(&mem, y);
+ return 0;
+}
+
+extern void abort (void);
+
+int
+main (int argc, char *argv[])
+{
+ mem = 0;
+ bar (0, 1);
+ bar (1, 1);
+ if (mem != 1)
+ abort ();
+ return 0;
+}