]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/69459 (wrong code with -O2 and vector arithmetics @ x86_64)
authorUros Bizjak <uros@gcc.gnu.org>
Thu, 28 Jan 2016 22:32:47 +0000 (23:32 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Thu, 28 Jan 2016 22:32:47 +0000 (23:32 +0100)
PR target/69459
* config/i386/constraints.md (C): Only accept constant zero operand.
(BC): New constraint.
* config/i386/sse.md (*mov<mode>_internal): Use BC constraint
instead of C constraint.
* doc/md.texi (Machine Constraints): Update description
of C constraint.

testsuite/ChangeLog:

PR target/69459
* gcc.target/i386/pr69459.c: New test.

From-SVN: r232955

gcc/ChangeLog
gcc/config/i386/constraints.md
gcc/config/i386/sse.md
gcc/doc/md.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr69459.c [new file with mode: 0644]

index 209bb0d0c209a0d045d29fca3dc8796bda8bf639..fb0fb88d60df2fbe5f07cd36fdf5c8150ef654c6 100644 (file)
@@ -1,3 +1,13 @@
+2016-01-28  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/69459
+       * config/i386/constraints.md (C): Only accept constant zero operand.
+       (BC): New constraint.
+       * config/i386/sse.md (*mov<mode>_internal): Use BC constraint
+       instead of C constraint.
+       * doc/md.texi (Machine Constraints): Update description
+       of C constraint.
+
 2016-01-28  Steve Ellcey  <sellcey@imgtec.com>
 
        PR target/68400
@@ -61,7 +71,8 @@
 
 2016-01-28  Sebastian Pop  <s.pop@samsung.com>
 
-       * graphite-isl-ast-to-gimple.c (binary_op_to_tree): Call codegen_error_p.
+       * graphite-isl-ast-to-gimple.c (binary_op_to_tree): Call
+       codegen_error_p.
        (ternary_op_to_tree): Same.
        (unary_op_to_tree): Same.
        (nary_op_to_tree): Same.
@@ -76,8 +87,8 @@
 
 2016-01-28  Sebastian Pop  <s.pop@samsung.com>
 
-       * graphite-isl-ast-to-gimple.c (get_rename_from_scev): Assert instead of
-       setting codegen_error to fail codegen.
+       * graphite-isl-ast-to-gimple.c (get_rename_from_scev): Assert
+       instead of setting codegen_error to fail codegen.
 
 2016-01-28  Jason Merrill  <jason@redhat.com>
 
 
 2016-01-27  Claudiu Zissulescu  <claziss@synopsys.com>
 
-        * config/arc/predicates.md (proper_comparison_operator): Reject
-        constant-constant comparison.
+       * config/arc/predicates.md (proper_comparison_operator): Reject
+       constant-constant comparison.
 
 2016-01-26  Tom de Vries  <tom@codesourcery.com>
 
        DR_NUM_DIMENSIONS == 0.
 
 2016-01-26  Abderrazek Zaafrani  <a.zaafrani@samsung.com>
-            Sebastian Pop  <s.pop@samsung.com>
+           Sebastian Pop  <s.pop@samsung.com>
 
        * graphite-isl-ast-to-gimple.c (ternary_op_to_tree): Handle
        isl_ast_op_cond and isl_ast_op_select.
        (compute_deps): Remove.
        * graphite-isl-ast-to-gimple.c (print_schedule_ast): New.
        (debug_schedule_ast): New.
-       (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option.
+       (translate_isl_ast_to_gimple::scop_to_isl_ast): Call
+       set_separate_option.
        (graphite_regenerate_ast_isl): Add dump.
        (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code
        from scop->transformed_schedule.
 
 2016-01-21  Richard Biener  <rguenther@suse.de>
 
-        PR tree-optimization/69378
+       PR tree-optimization/69378
        * tree-ssa-sccvn.c (dominated_by_p_w_unex): New function.
        (set_ssa_val_to): Use it for dominance checks taking into
        account not executable edges.
 2016-01-21  Aditya Kumar  <aditya.k7@samsung.com>
            Sebastian Pop  <s.pop@samsung.com>
 
-        * graphite-isl-ast-to-gimple.c: Fix comment.
-        * graphite-scop-detection.c (defined_in_loop_p): New.
-        (canonicalize_loop_closed_ssa): Do not add close phi nodes for SSA
-        names defined in loop.
+       * graphite-isl-ast-to-gimple.c: Fix comment.
+       * graphite-scop-detection.c (defined_in_loop_p): New.
+       (canonicalize_loop_closed_ssa): Do not add close phi nodes for SSA
+       names defined in loop.
 
 2016-01-21  Aditya Kumar  <aditya.k7@samsung.com>
            Sebastian Pop  <s.pop@samsung.com>
 2016-01-21  Aditya Kumar  <aditya.k7@samsung.com>
            Sebastian Pop  <s.pop@samsung.com>
 
-        * graphite-sese-to-poly.c (set_scop_parameter_dim): Remove.
-        (cleanup_loop_iter_dom): Remove.
-        (build_loop_iteration_domains): Remove.
-        (build_scop_context): Remove.
-        (build_scop_iteration_domain): Remove.
-        (add_loop_constraints): New.
-        (build_iteration_domains): New.
-        (build_poly_scop): Call build_iteration_domains.
+       * graphite-sese-to-poly.c (set_scop_parameter_dim): Remove.
+       (cleanup_loop_iter_dom): Remove.
+       (build_loop_iteration_domains): Remove.
+       (build_scop_context): Remove.
+       (build_scop_iteration_domain): Remove.
+       (add_loop_constraints): New.
+       (build_iteration_domains): New.
+       (build_poly_scop): Call build_iteration_domains.
 
 2016-01-21  Aditya Kumar  <aditya.k7@samsung.com>
            Sebastian Pop  <s.pop@samsung.com>
 
-        * graphite-scop-detection.c
-        (scop_detection::harmful_loop_in_region): Free dom and loops.
-        (scop_detection::loop_body_is_valid_scop): Free bbs.
+       * graphite-scop-detection.c
+       (scop_detection::harmful_loop_in_region): Free dom and loops.
+       (scop_detection::loop_body_is_valid_scop): Free bbs.
 
 2016-01-21  Aditya Kumar  <aditya.k7@samsung.com>
            Sebastian Pop  <s.pop@samsung.com>
 2016-01-21  Aditya Kumar  <aditya.k7@samsung.com>
            Sebastian Pop  <s.pop@samsung.com>
 
-       * graphite-scop-detection.c (loop_is_valid_scop): Renamed loop_is_valid_in_scop.
-       (scop_detection::harmful_stmt_in_region): Renamed harmful_loop_in_region.
+       * graphite-scop-detection.c (loop_is_valid_scop): Renamed
+       loop_is_valid_in_scop.
+       (scop_detection::harmful_stmt_in_region): Renamed
+       harmful_loop_in_region.
        Call loop_is_valid_in_scop.
 
 2016-01-21  Aditya Kumar  <aditya.k7@samsung.com>
 
        * graphite-poly.c (new_poly_bb): Remove use of PBB_IS_REDUCTION.
        * graphite.h (struct poly_bb): Remove field is_reduction.
-        (PBB_IS_REDUCTION): Remove.
+       (PBB_IS_REDUCTION): Remove.
 
 2016-01-21  Aditya Kumar  <aditya.k7@samsung.com>
            Sebastian Pop  <s.pop@samsung.com>
        * lto-section-in.c (lto_section_name): Add hsa section name.
        * lto-streamer.h (lto_section_type): Add hsa section.
        * timevar.def (TV_IPA_HSA): New.
-        * hsa-brig-format.h: New file.
+       * hsa-brig-format.h: New file.
        * hsa-brig.c: New file.
        * hsa-dump.c: Likewise.
        * hsa-gen.c: Likewise.
        * loop-doloop.c (record_reg_sets): New.
        (doloop_optimize): Reject the transform if the sequence
        clobbers registers live at the end of the loop block.
-       (doloop_optimize_loops): Enable df_live if needed. 
+       (doloop_optimize_loops): Enable df_live if needed.
 
 2016-01-14  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
 
        * config/i386/xm-djgpp.h (NATIVE_SYSTEM_HEADER_DIR): Define.
        (MD_EXEC_PREFIX): Define (moved from config/i386/djgpp.h).
-       (STANDARD_STARTFILE_PREFIX_1): Define (moved from MD_STARTFILE_PREFIX in config/i386/djgpp.h).
-       (STANDARD_STARTFILE_PREFIX_2): Define identical to STANDARD_STARTFILE_PREFIX_1.
+       (STANDARD_STARTFILE_PREFIX_1): Define (moved from MD_STARTFILE_PREFIX
+       in config/i386/djgpp.h).
+       (STANDARD_STARTFILE_PREFIX_2): Define identical to
+       STANDARD_STARTFILE_PREFIX_1.
        (LOCAL_INCLUDE_DIR): Define (moved from config/i386/djgpp.h).
-       (GCC_DRIVER_HOST_INITIALIZATION): Fix reporting fatal installation errors.
+       (GCC_DRIVER_HOST_INITIALIZATION): Fix reporting fatal
+       installation errors.
        (MAX_OFILE_ALIGNMENT): Define to 128.
        (HAVE_FTW_H): Undefine as DJGPP do not have nftw, but have ftw.h.
 
-       * config/i386/djgpp.c: New file. Add implementation of i386_djgpp_asm_named_section.
+       * config/i386/djgpp.c: New file. Add implementation of
+       i386_djgpp_asm_named_section.
 
        * config/i386/djgpp.opt: Remove obsolete option -mbnu210.
 
        PR middle-end/68743
        * match.pd: Require target has function_c99_misc before doing
        truncl(extend(x)) and trunc(extend(x)) -> extend(truncf(x)), etc.
-       
+
 2016-01-09  Gerald Pfeifer  <gerald@pfeifer.com>
 
-       * configure.ac (isl_options_set_schedule_serialize_sccs): Also 
+       * configure.ac (isl_options_set_schedule_serialize_sccs): Also
        use GMPINC.
        * configure: Regenerate.
 
index bac9d6668a8d09e25e3e715e82bd20e75fd07212..3b0b7c79dc11010219288fb48dcb3fbc938bb0ab 100644 (file)
 ;;  s  Sibcall memory operand, not valid for TARGET_X32
 ;;  w  Call memory operand, not valid for TARGET_X32
 ;;  z  Constant call address operand.
+;;  C  SSE constant operand.
 
 (define_constraint "Bf"
   "@internal Flags register operand."
   "@internal Constant call address operand."
   (match_operand 0 "constant_call_address_operand"))
 
+(define_constraint "BC"
+  "@internal SSE constant operand."
+  (match_test "standard_sse_constant_p (op)"))
+
 ;; Integer constant constraints.
 (define_constraint "I"
   "Integer constant in the range 0 @dots{} 31, for 32-bit shifts."
 
 ;; This can theoretically be any mode's CONST0_RTX.
 (define_constraint "C"
-  "Standard SSE floating point constant."
-  (match_test "standard_sse_constant_p (op)"))
+  "SSE constant zero operand."
+  (match_test "standard_sse_constant_p (op) == 1"))
 
 ;; Constant-or-symbol-reference constraints.
 
index 84d2b7af59b143990bfe1d6b06ab91ebd8878e38..3f53a0aa722114d348f71460ae464d3f85a1b757 100644 (file)
 
 (define_insn "*mov<mode>_internal"
   [(set (match_operand:VMOVE 0 "nonimmediate_operand"               "=v,v ,m")
-       (match_operand:VMOVE 1 "nonimmediate_or_sse_const_operand"  ",vm,v"))]
+       (match_operand:VMOVE 1 "nonimmediate_or_sse_const_operand"  "BC,vm,v"))]
   "TARGET_SSE
    && (register_operand (operands[0], <MODE>mode)
        || register_operand (operands[1], <MODE>mode))"
index 68321dc9b6518fad27857200e9d4b2b899a4cd2e..3c11d1944b8e212fb049381b8f11f42334fb80f9 100644 (file)
@@ -4100,7 +4100,7 @@ Integer constant in the range 0 @dots{} 127, for 128-bit shifts.
 Standard 80387 floating point constant.
 
 @item C
-Standard SSE floating point constant.
+SSE constant zero operand.
 
 @item e
 32-bit signed integer constant, or a symbolic reference known
index fc1e4ee183081509111e1cb31a77bca3ff4862f2..d8810beffe1f704bca8d955261995bac23f50c65 100644 (file)
@@ -1,3 +1,8 @@
+2016-01-28  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/69459
+       * gcc.target/i386/pr69459.c: New test.
+
 2016-01-28  Steve Ellcey  <sellcey@imgtec.com>
 
        PR target/68400
@@ -71,7 +76,7 @@
 2016-01-25  Jeff Law  <law@redhat.com>
 
        PR tree-optimization/68398
-        PR tree-optimization/69196
+       PR tree-optimization/69196
        * gcc.dg/tree-ssa/pr66752-3.c: Update expected output.
        * gcc.dg/tree-ssa/ssa-dom-thread-2c.c: Add extra statements on thread
        path to avoid new heuristic allowing more irreducible regions
diff --git a/gcc/testsuite/gcc.target/i386/pr69459.c b/gcc/testsuite/gcc.target/i386/pr69459.c
new file mode 100644 (file)
index 0000000..2d0bbbc
--- /dev/null
@@ -0,0 +1,42 @@
+/* PR target/69549 */
+/* { dg-do run { target sse2_runtime } } */
+/* { dg-options "-O2 -msse2" } */
+
+typedef unsigned char u8;
+typedef unsigned short u16;
+typedef unsigned int u32;
+typedef unsigned long long u64;
+typedef unsigned char v16u8 __attribute__ ((vector_size (16)));
+typedef unsigned short v16u16 __attribute__ ((vector_size (16)));
+typedef unsigned int v16u32 __attribute__ ((vector_size (16)));
+typedef unsigned long long v16u64 __attribute__ ((vector_size (16)));
+
+u64 __attribute__((noinline, noclone))
+foo (u8 u8_0, u16 u16_3, v16u8 v16u8_0, v16u16 v16u16_0, v16u32 v16u32_0, v16u64 v16u64_0, v16u8 v16u8_1, v16u16 v16u16_1, v16u32 v16u32_1, v16u64 v16u64_1, v16u8 v16u8_2, v16u16 v16u16_2, v16u32 v16u32_2, v16u64 v16u64_2, v16u8 v16u8_3, v16u16 v16u16_3, v16u32 v16u32_3, v16u64 v16u64_3)
+{
+  v16u64_0 /= (v16u64){u16_3, ((0))} | 1;
+  v16u64_1 += (v16u64)~v16u32_0;
+  v16u16_1 /= (v16u16){-v16u64_3[1]} | 1;
+  v16u64_3[1] -= 0x1fffffff;
+  v16u32_2 /= (v16u32)-v16u64_0 | 1;
+  v16u32_1 += ~v16u32_1;
+  v16u16_3 %= (v16u16){0xfff, v16u32_2[3], v16u8_0[14]} | 1;
+  v16u64_3 -= (v16u64)v16u32_2;
+  if (v16u64_1[1] >= 1) {
+    v16u64_0 %= (v16u64){v16u32_0[1]} | 1;
+    v16u32_1[1] %= 0x5fb856;
+    v16u64_1 |= -v16u64_0;
+  }
+  v16u8_0 *= (v16u8)v16u32_1;
+  return u8_0 + v16u8_0 [12] + v16u8_0 [13] + v16u8_0 [14] + v16u8_0 [15] + v16u16_0 [0] + v16u16_0 [1] + v16u32_0 [0] + v16u32_0 [1] + v16u32_0 [2] + v16u32_0 [3] + v16u64_0 [0] + v16u64_0 [1] + v16u8_1 [9] + v16u8_1 [10] + v16u8_1 [11] + v16u8_1 [15] + v16u16_1 [0] + v16u16_1 [1] + v16u16_1 [3] + v16u64_1 [0] + v16u64_1 [1] + v16u8_2 [3] + v16u8_2 [4] + v16u8_2 [5] + v16u8_2 [0] + v16u32_2 [1] + v16u32_2 [2] + v16u32_2 [3] + v16u64_2 [0] + v16u64_2 [1] + v16u8_3 [0] + v16u16_3 [6] + v16u16_3[7] + v16u32_3[1] + v16u32_3[2] + v16u64_3[0] + v16u64_3[1];
+}
+
+int
+main ()
+{
+  u64 x = foo(1, 1, (v16u8){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, (v16u16){1, 1}, (v16u32){1}, (v16u64){1}, (v16u8){1}, (v16u16){1, 1}, (v16u32){1}, (v16u64){1}, (v16u8){1, 1, 1, 1, 1}, (v16u16){1}, (v16u32){1}, (v16u64){1}, (v16u8){1}, (v16u16){1}, (v16u32){1}, (v16u64){1});
+
+  if (x != 0xffffffffe0000209)
+    __builtin_abort();
+  return 0;
+}