Thomas Koenig [Tue, 30 Aug 2011 21:36:48 +0000 (21:36 +0000)]
backport: re PR libfortran/50192 (Wrong character comparision with wide strings)
2011-08-30 Thomas Koenig <tkoenig@gcc.gnu.org>
Backport from trunk
PR libfortran/50192
* intrinsics/string_intrinsics.c (memcmp_char4): New function.
* intrinsics/string_intrinsics_inc.c: New macro MEMCMP, either
set to memcmp or memcmp_char4.
(compare_string): Use MEMCMP, with correct size for it.
* libgfortran.h: Add prototype for memcmp_char4.
2011-08-30 Thomas Koenig <tkoenig@gcc.gnu.org>
Backport from trunk
PR libfortran/50192
* gfortran.dg/widechar_compare_1.f90: New test.
Nick Clifton [Fri, 12 Aug 2011 16:27:23 +0000 (16:27 +0000)]
builtins.c (expand_builtin_memcmp): Do not use cmpstrnsi pattern.
* builtins.c (expand_builtin_memcmp): Do not use cmpstrnsi
pattern.
* doc/md.texi (cmpstrn): Note that the comparison stops if both
fetched bytes are zero.
(cmpstr): Likewise.
(cmpmem): Note that the comparison does not stop if both of the
fetched bytes are zero.
Kazuhiro Inaoka [Thu, 11 Aug 2011 12:19:49 +0000 (12:19 +0000)]
rx.md (movsicc): Allow register to register transfers.
* config/rx/rx.md (movsicc): Allow register to register
transfers.
(*movsicc): Likewise.
(*stcc): Restrict this pattern to EQ and NE compares.
(*stcc_reg): New pattern. Works for any comparison but only for
register transfers.
re PR target/49920 (unable to find a register to spill in class ‘DIREG’)
PR target/49920
* config/i386/i386.md (strset): Do not expand strset_singleop
when %eax or $edi are fixed.
(*strsetdi_rex_1): Disable when %eax or %edi are fixed.
(*strsetsi_1): Ditto.
(*strsetsi_rex_1): Ditto.
(*strsethi_1): Ditto.
(*strsethi_rex_1): Ditto.
(*strsetqi_1): Ditto.
(*strsetqi_rex_1): Ditto.
(*rep_stosdi_rex64): Disable when %eax, %ecx or %edi are fixed.
(*rep_stossi): Ditto.
(*rep_stossi_rex64): Ditto.
(*rep_stosqi): Ditto.
(*rep_stosqi_rex64): Ditto.
(*strlenqi_1): Ditto.
(*strlenqi_rex_1): Ditto.
(cmpstrnsi): Also fail when %ecx is fixed.
(*cmpstrnqi_nz_1): Disable when %ecx, %esi or %edi are fixed.
(*cmpstrnqi_nz_rex_1): Ditto.
(*cmpstrnqi_1): Ditto.
(*cmpstrnqi_rex_1): Ditto.
(*strmovdi_rex_1): Disable when %esi or %edi are fixed.
(*strmovsi_1): Ditto.
(*strmovsi_rex_1): Ditto.
(*strmovhi_1): Ditto.
(*strmovhi_rex_1): Ditto.
(*strmovqi_1): Ditto.
(*strmovqi_rex_1): Ditto.
(*rep_movdi_rex64): Disable when %ecx, %esi or %edi are fixed.
(*rep_movsi): Ditto.
(*rep_movsi_rex64): Ditto.
(*rep_movqi): Ditto.
(*rep_movqi_rex64): Ditto.
testsuite/ChangeLog:
PR target/49920
* gcc.target/i386/pr49920.c: New test.
* gcc.target/i386/avx-os-support.h: New.
* gcc.target/i386/avx-check.h: Include avx-os-support.h
(main): Check avx_os_support before the test is run.
* gcc.target/i386/aes-avx-check.h: Ditto.
* gcc.target/i386/pclmul-avx-check.h: Ditto.
Jakub Jelinek [Tue, 19 Jul 2011 13:09:48 +0000 (15:09 +0200)]
backport: re PR target/49621 (ICE in trunc_int_for_mode, at explow.c:57)
Backport from mainline
2011-07-08 Jakub Jelinek <jakub@redhat.com>
PR target/49621
* config/rs6000/rs6000.c (rs6000_emit_vector_cond_expr): Use
CONST0_RTX (dest_mode) instead of const0_rtx as second operand
of NE.
* config/rs6000/vector.md (vector_select_<mode>,
vector_select_<mode>_uns): Change second operand of NE to
CONST0_RTX (<MODE>mode) instead of const0_rtx.
* config/rs6000/altivec.md (*altivec_vsel<mode>,
*altivec_vsel<mode>_uns): Expect second operand of NE to be
zero_constant of the corresponding vector mode.
* config/rs6000/vsx.md (*vsx_xxsel<mode>, *vsx_xxsel<mode>_uns):
Likewise.
Jakub Jelinek [Tue, 19 Jul 2011 13:08:33 +0000 (15:08 +0200)]
backport: re PR c/49644 (post-increment of promoted operand is incorrect.)
Backport from mainline
2011-07-07 Jakub Jelinek <jakub@redhat.com>
PR c/49644
* typeck.c (cp_build_binary_op): For MULT_EXPR and TRUNC_DIV_EXPR with
one non-complex and one complex argument, call save_expr on both
operands.
Jakub Jelinek [Tue, 19 Jul 2011 13:07:23 +0000 (15:07 +0200)]
backport: re PR c/49644 (post-increment of promoted operand is incorrect.)
Backport from mainline
2011-07-07 Jakub Jelinek <jakub@redhat.com>
PR c/49644
* c-typeck.c (build_binary_op): For MULT_EXPR and TRUNC_DIV_EXPR with
one non-complex and one complex argument, call c_save_expr on both
operands.
Jakub Jelinek [Tue, 19 Jul 2011 13:06:00 +0000 (15:06 +0200)]
backport: re PR middle-end/49640 (Internal compiler in C99 code (using variable-length arrays) and OpenMP)
Backport from mainline
2011-07-07 Jakub Jelinek <jakub@redhat.com>
PR middle-end/49640
* gimplify.c (gimplify_compound_lval): For last 2 ARRAY_*REF
operands and last COMPONENT_REF operand call gimplify_expr on it
if non-NULL.
Jakub Jelinek [Tue, 19 Jul 2011 12:51:29 +0000 (14:51 +0200)]
backport: re PR tree-optimization/49161 (Fix VRP on switch stmts)
Backport from mainline
2011-05-26 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/49161
* tree-vrp.c (struct case_info): New type.
(compare_case_labels): Sort case_info structs instead of
trees, and not primarily by CASE_LABEL uids but by
label_for_block indexes.
(find_switch_asserts): Put case labels into struct case_info
array instead of TREE_VEC, adjust sorting, compare label_for_block
values instead of CASE_LABELs.
Jakub Jelinek [Tue, 19 Jul 2011 12:46:39 +0000 (14:46 +0200)]
backport: re PR middle-end/48973 (Inliner bug with one-bit (1-bit) bitfield)
Backport from mainline
2011-05-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/48973
* expr.c (expand_expr_real_2) <case LT_EXPR>: If do_store_flag
failed and the comparison has a single bit signed type, use
constm1_rtx instead of const1_rtx for true value.
(do_store_flag): If ops->type is single bit signed type, disable
signel bit test optimization and pass -1 instead of 1 as last
parameter to emit_store_flag_force.
* gcc.c-torture/execute/pr48973-1.c: New test.
* gcc.c-torture/execute/pr48973-2.c: New test.