From c62b365920ac525ceabcfe7eb9cd6a9f9539d78c Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Fri, 16 May 2008 20:34:04 +0200 Subject: [PATCH] re PR target/36246 (Reload chooses too wide mode for reg->mem->xmmreg reload) PR target/36246 * config/i386/i386.h (SECONDARY_MEMORY_NEEDED_MODE): New define. testsuite/ChangeLog: PR target/36246 * gcc.target/i386/pr36246.c: New test. From-SVN: r135437 --- gcc/ChangeLog | 36 ++++++++++++------------- gcc/config/i386/i386.h | 8 ++++++ gcc/testsuite/ChangeLog | 11 +++++--- gcc/testsuite/gcc.target/i386/pr36246.c | 14 ++++++++++ 4 files changed, 47 insertions(+), 22 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr36246.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9f9af8b20c5..59c00bbc322 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-05-16 Uros Bizjak + + PR target/36246 + * config/i386/i386.h (SECONDARY_MEMORY_NEEDED_MODE): New define. + 2008-05-16 Kenneth Zadeck * ifcvt.c (dead_or_predicable): Rename @@ -58,8 +63,8 @@ 2008-05-16 Kenneth Zadeck - * cfg.c (init_flow): Add argument THE_FUN. Use it - instead of cfun. Update all users. + * cfg.c (init_flow): Add argument THE_FUN. Use it instead of cfun. + Update all users. 2008-05-16 Kenneth Zadeck @@ -68,10 +73,9 @@ * tree-pretty-print.c (dump_phi_nodes, dump_generic_bb_buff): Add verbose dump. * tree-pass.h (TDF_VERBOSE): New dump flag. - * print-tree.c (print_node): Added code to be able to print - PHI_NODES. + * print-tree.c (print_node): Added code to be able to print PHI_NODES. (tree-flow.h): Added include. - Makefile.in (print-tree.o): Added TREE_FLOW_H. + * Makefile.in (print-tree.o): Added TREE_FLOW_H. 2008-05-16 Bernd Schmidt @@ -87,8 +91,7 @@ MULTILIB_MATCHES, MULTILIB_EXCEPTIONS): Likewise. * config/bfin/bfin-protos.h (enum bfin_cpu_type): Add BFIN_CPU_UNKNOWN. - * config/bfin/elf.h (STARTFILE_SPEC): Use specific CRT for - BF561. + * config/bfin/elf.h (STARTFILE_SPEC): Use specific CRT for BF561. (LIB_SPEC): Use proper linker script for bf561. Error if no mcpu option. * config/bfin/bfin.c (bfin_cpu_type): Set to BFIN_CPU_UNKNOWN. @@ -123,8 +126,7 @@ * ipa-inline.c (compute_inline_parameters): Made public and added node parameter. (compute_inline_parameters_for_current): New function. - (pass_inline_param): Now calls - compute_inline_parameters_for_current. + (pass_inline_param): Now calls compute_inline_parameters_for_current. (inline_generate_summary): Removed parameter and made to loop over all cgraph nodes. (pass_ipa_inline): Updated for new IPA_PASS structure. @@ -147,20 +149,18 @@ 2008-05-15 Diego Novillo - * config/arm/arm.c (arm_return_in_memory): Fix return - type. + * config/arm/arm.c (arm_return_in_memory): Fix return type. * config/arm/arm-protos.h (arm_return_in_memory): Likewise. 2008-05-15 Adam Nemet PR middle-end/36194 - * combine.c (check_conversion): Rename back to check_promoted_subreg. - Don't call record_truncated_value from here. - (record_truncated_value): Turn it into a for_each_rtx callback. - (record_truncated_values): New function. - (combine_instructions): Call note_uses with - record_truncated_values. Change name of check_conversion to - check_promoted_subreg. + * combine.c (check_conversion): Rename back to check_promoted_subreg. + Don't call record_truncated_value from here. + (record_truncated_value): Turn it into a for_each_rtx callback. + (record_truncated_values): New function. + (combine_instructions): Call note_uses with record_truncated_values. + Change name of check_conversion to check_promoted_subreg. 2008-05-15 Janis Johnson diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 87815edaf72..8516e53b41d 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -1516,6 +1516,14 @@ enum reg_class #define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \ ix86_secondary_memory_needed ((CLASS1), (CLASS2), (MODE), 1) +/* Get_secondary_mem widens integral modes to BITS_PER_WORD. + There is no need to emit full 64 bit move on 64 bit targets + for integral modes that can be moved using 32 bit move. */ +#define SECONDARY_MEMORY_NEEDED_MODE(MODE) \ + (GET_MODE_BITSIZE (MODE) < 32 && INTEGRAL_MODE_P (MODE) \ + ? mode_for_size (32, GET_MODE_CLASS (MODE), 0) \ + : MODE) + /* QImode spills from non-QI registers need a scratch. This does not happen often -- the only example so far requires an uninitialized pseudo. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 862439d6488..88c26192c04 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-05-16 Uros Bizjak + + PR target/36246 + * gcc.target/i386/pr36246.c: New test. + 2008-05-16 Sebastian Pop Jan Sjodin @@ -58,16 +63,14 @@ 2008-05-15 Janis Johnson * lib/torture-options.exp: New support for torture options. - * lib/gfortran-dg.exp (gfortran-dg-runtest): Use new torture - procs. + * lib/gfortran-dg.exp (gfortran-dg-runtest): Use new torture procs. * lib/c-torture.exp: Define C_TORTURE_OPTIONS instead of TORTURE_OPTIONS; don't define torture_with_loops and torture_without_loops. * lib/gcc-dg.exp: Define DG_TORTURE_OPTIONS instead of TORTURE_OPTIONS; don't define torture_with_loops and torture_without_loops. - (gcc-dg-runtest): Use new torture procs if no torture options - defined. + (gcc-dg-runtest): Use new torture procs if no torture options defined. * lib/fortran-torture.exp: Define FORTRAN_TORTURE_OPTIONS instead of TORTURE_OPTIONS. (fortran-torture-execute): Use torture_with_loops instead of diff --git a/gcc/testsuite/gcc.target/i386/pr36246.c b/gcc/testsuite/gcc.target/i386/pr36246.c new file mode 100644 index 00000000000..5ef573213ab --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr36246.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -mtune=generic" } */ + +typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__)); +typedef int __v4si __attribute__ ((__vector_size__ (16))); + +__m128i +_mm_set_epi32 (int __q3, int __q2, int __q1, int __q0) +{ + return (__m128i)(__v4si){ __q0, __q1, __q2, __q3 }; +} + +/* { dg-final { scan-assembler-not "movq" } } */ -- 2.30.2