From: Andreas Krebbel Date: Fri, 7 Feb 2014 14:22:41 +0000 (+0000) Subject: 2014-02-07 Andreas Krebbel X-Git-Tag: releases/gcc-4.9.0~1018 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=75cc21e2b7153b7561a7636fd668ba66f10b72eb;p=thirdparty%2Fgcc.git 2014-02-07 Andreas Krebbel * config/s390/s390.md ("atomic_load", "atomic_store") ("atomic_compare_and_swap", "atomic_fetch_"): Reject misaligned operands. From-SVN: r207601 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 106a30d39bc2..13fac243bb40 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-02-07 Andreas Krebbel + + * config/s390/s390.md ("atomic_load", "atomic_store") + ("atomic_compare_and_swap", "atomic_fetch_"): + Reject misaligned operands. + 2014-02-07 Andreas Krebbel * optabs.c (expand_atomic_compare_and_swap): Allow expander to diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index bccc159abc72..3f863048ef95 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -9108,6 +9108,9 @@ (match_operand:SI 2 "const_int_operand")] ;; model "" { + if (MEM_ALIGN (operands[1]) < GET_MODE_BITSIZE (GET_MODE (operands[1]))) + FAIL; + if (mode == TImode) emit_insn (gen_atomic_loadti_1 (operands[0], operands[1])); else if (mode == DImode && !TARGET_ZARCH) @@ -9149,6 +9152,9 @@ { enum memmodel model = (enum memmodel) INTVAL (operands[2]); + if (MEM_ALIGN (operands[0]) < GET_MODE_BITSIZE (GET_MODE (operands[0]))) + FAIL; + if (mode == TImode) emit_insn (gen_atomic_storeti_1 (operands[0], operands[1])); else if (mode == DImode && !TARGET_ZARCH) @@ -9203,6 +9209,9 @@ if (!register_operand (output, mode)) output = gen_reg_rtx (mode); + if (MEM_ALIGN (operands[2]) < GET_MODE_BITSIZE (GET_MODE (operands[2]))) + FAIL; + emit_insn (gen_atomic_compare_and_swap_internal (output, operands[2], operands[3], operands[4])); @@ -9319,6 +9328,9 @@ (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__iaf (operands[0], operands[1], operands[2])); DONE;