diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 44 | ||||
-rw-r--r-- | gcc/DATESTAMP | 2 | ||||
-rw-r--r-- | gcc/aclocal.m4 | 1 | ||||
-rw-r--r-- | gcc/ada/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/Makefile.in | 12 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 6 | ||||
-rw-r--r-- | gcc/config/mips/mips.h | 16 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 16 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.md | 24 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 72 | ||||
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/ioparm.def | 1 | ||||
-rw-r--r-- | gcc/fortran/trans-io.c | 2 | ||||
-rw-r--r-- | gcc/opts.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 21 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/compat/struct-layout-1_x1.h | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect.exp | 6 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/specs/static_initializer3.ads | 2 | ||||
-rw-r--r-- | gcc/tree-vect-transform.c | 77 | ||||
-rw-r--r-- | gcc/tree-vectorizer.c | 4 |
20 files changed, 267 insertions, 60 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 66031cc705f..456daf82f1d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,47 @@ +2008-09-26 Adam Nemet <anemet@caviumnetworks.com> + + * config/mips/mips.h (ISA_HAS_DMUL3, ISA_HAS_BADDU, ISA_HAS_BBIT, + ISA_HAS_CINS, ISA_HAS_EXTS, ISA_HAS_SEQ_SNE, ISA_HAS_POP): Change + them to yield false with MIPS16. + +2008-09-26 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/37275 + * dwarf2out.c (tls_mem_loc_descriptor): New function. + (mem_loc_descriptor): Use it for MEM. For PLUS fail if second + mem_loc_descriptor failed. Accept UNSPEC. + (loc_descriptor): Use tls_mem_loc_descriptor for MEM. For PARALLEL + fail if one of the loc_descriptor calls for pieces failed. + (loc_descriptor_from_tree_1): Handle even DECL_EXTERNAL __thread vars, + as long as they bind locally. For COMPONENT_REF, ARRAY_REF etc. fail + if loc_descriptor_from_tree_1 on offset failed. + + PR middle-end/37576 + * opts.c (common_handle_option): Don't call print_specific_help with + CL_SAVE as first argument. + +2008-09-26 Peter O'Gorman <pogma@thewrittenword.com> + Steve Ellcey <sje@cup.hp.com> + + * configure: Regenerate for new libtool. + * aclocal.m4: Ditto. + +2008-09-26 Pat Haugen <pthaugen@us.ibm.com> + + * config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Use correct + alias set on MEM when saving stack pointer. + * config/rs6000/rs6000.md (allocate_stack): Likewise + +2008-09-26 Dorit Nuzman <dorit@il.ibm.com> + + PR tree-optimization/37574 + * tree-vectorizer.c (vect_is_simple_use): Fix indentation. + * tree-vect-transform.c (vect_get_constant_vectors): Use vectype + instead of vector_type for constants. Take computation out of loop. + (vect_get_vec_def_for_operand): Use only vectype for constant case, + and use only vector_type for invariant case. + (get_initial_def_for_reduction): Use vectype instead of vector_type. + 2008-09-25 Jakub Jelinek <jakub@redhat.com> PR c/37645 diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 5da311d663b..2c5f3009471 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20080926 +20080927 diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4 index 5efd4a7beea..9576f2c3e0d 100644 --- a/gcc/aclocal.m4 +++ b/gcc/aclocal.m4 @@ -108,4 +108,5 @@ m4_include([../libtool.m4]) m4_include([../ltoptions.m4]) m4_include([../ltsugar.m4]) m4_include([../ltversion.m4]) +m4_include([../lt~obsolete.m4]) m4_include([acinclude.m4]) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index e5a43b294e8..3aa6f4d069a 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,13 @@ +2008-09-26 Eric Botcazou <ebotcazou@adacore.com> + + * decl.c (gnat_to_gnu_entity) <object>: Cap the alignment promotion + to that of ptr_mode instead of word_mode. + +2008-09-26 Eric Botcazou <ebotcazou@adacore.com> + + PR ada/5911 + * gcc-interface/Makefile.in (SPARC/Solaris): Add multilib support. + 2008-09-25 Samuel Tardieu <sam@rfc1149.net> PR ada/37641 diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in index 59803ca1ed2..dc43f48a133 100644 --- a/gcc/ada/gcc-interface/Makefile.in +++ b/gcc/ada/gcc-interface/Makefile.in @@ -763,9 +763,17 @@ ifeq ($(strip $(filter-out sparc% sun solaris%,$(targ))),) system.ads<system-solaris-sparcv9.ads ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),) - LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_32) + ifeq ($(strip $(MULTISUBDIR)),/sparcv9) + LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64) + else + LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_32) + endif else - LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64) + ifeq ($(strip $(MULTISUBDIR)),/sparcv7) + LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_32) + else + LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64) + endif endif TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-solaris.adb diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index d343b144996..b0dfc7d33e4 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -734,10 +734,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) && TREE_CODE (TYPE_SIZE (gnu_type)) == INTEGER_CST) { /* No point in jumping through all the hoops needed in order - to support BIGGEST_ALIGNMENT if we don't really have to. */ + to support BIGGEST_ALIGNMENT if we don't really have to. + So we cap to the smallest alignment that corresponds to + a known efficient memory access pattern of the target. */ unsigned int align_cap = Is_Atomic (gnat_entity) ? BIGGEST_ALIGNMENT - : get_mode_alignment (word_mode); + : get_mode_alignment (ptr_mode); if (!host_integerp (TYPE_SIZE (gnu_type), 1) || compare_tree_int (TYPE_SIZE (gnu_type), align_cap) >= 0) diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 55e240e5217..dc390dfe745 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -783,7 +783,9 @@ enum mips_code_readable_setting { && !TARGET_MIPS16) /* ISA has a three-operand multiplication instruction. */ -#define ISA_HAS_DMUL3 (TARGET_64BIT && TARGET_OCTEON) +#define ISA_HAS_DMUL3 (TARGET_64BIT \ + && TARGET_OCTEON \ + && !TARGET_MIPS16) /* ISA has the floating-point conditional move instructions introduced in mips4. */ @@ -1011,22 +1013,22 @@ enum mips_code_readable_setting { : ISA_HAS_LL_SC) /* ISA includes the baddu instruction. */ -#define ISA_HAS_BADDU TARGET_OCTEON +#define ISA_HAS_BADDU (TARGET_OCTEON && !TARGET_MIPS16) /* ISA includes the bbit* instructions. */ -#define ISA_HAS_BBIT TARGET_OCTEON +#define ISA_HAS_BBIT (TARGET_OCTEON && !TARGET_MIPS16) /* ISA includes the cins instruction. */ -#define ISA_HAS_CINS TARGET_OCTEON +#define ISA_HAS_CINS (TARGET_OCTEON && !TARGET_MIPS16) /* ISA includes the exts instruction. */ -#define ISA_HAS_EXTS TARGET_OCTEON +#define ISA_HAS_EXTS (TARGET_OCTEON && !TARGET_MIPS16) /* ISA includes the seq and sne instructions. */ -#define ISA_HAS_SEQ_SNE TARGET_OCTEON +#define ISA_HAS_SEQ_SNE (TARGET_OCTEON && !TARGET_MIPS16) /* ISA includes the pop instruction. */ -#define ISA_HAS_POP TARGET_OCTEON +#define ISA_HAS_POP (TARGET_OCTEON && !TARGET_MIPS16) /* The CACHE instruction is available in non-MIPS16 code. */ #define TARGET_CACHE_BUILTIN (mips_isa >= 3) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index cdeb1c9c500..924fa9e5954 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -15438,6 +15438,8 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12, int copy_r11) if (TARGET_UPDATE) { + rtx par, set, mem; + if (size > 32767) { /* Need a note here so that try_split doesn't get confused. */ @@ -15453,13 +15455,25 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12, int copy_r11) todec, stack_reg) : gen_movdi_di_update (stack_reg, stack_reg, todec, stack_reg)); + /* Since we didn't use gen_frame_mem to generate the MEM, grab + it now and set the alias set/attributes. The above gen_*_update + calls will generate a PARALLEL with the MEM set being the first + operation. */ + par = PATTERN (insn); + gcc_assert (GET_CODE (par) == PARALLEL); + set = XVECEXP (par, 0, 0); + gcc_assert (GET_CODE (set) == SET); + mem = SET_DEST (set); + gcc_assert (MEM_P (mem)); + MEM_NOTRAP_P (mem) = 1; + set_mem_alias_set (mem, get_frame_alias_set ()); } else { insn = emit_insn (TARGET_32BIT ? gen_addsi3 (stack_reg, stack_reg, todec) : gen_adddi3 (stack_reg, stack_reg, todec)); - emit_move_insn (gen_rtx_MEM (Pmode, stack_reg), + emit_move_insn (gen_frame_mem (Pmode, stack_reg), copy_r11 ? gen_rtx_REG (Pmode, 11) : gen_rtx_REG (Pmode, 12)); diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index d35e9d4eac2..fb55fc00962 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -10340,14 +10340,32 @@ neg_op0 = GEN_INT (- INTVAL (operands[1])); if (TARGET_UPDATE) - emit_insn ((* ((TARGET_32BIT) ? gen_movsi_update : gen_movdi_di_update)) - (stack_pointer_rtx, stack_pointer_rtx, neg_op0, chain)); + { + rtx insn, par, set, mem; + + insn = emit_insn ((* ((TARGET_32BIT) ? gen_movsi_update + : gen_movdi_di_update)) + (stack_pointer_rtx, stack_pointer_rtx, neg_op0, + chain)); + /* Since we didn't use gen_frame_mem to generate the MEM, grab + it now and set the alias set/attributes. The above gen_*_update + calls will generate a PARALLEL with the MEM set being the first + operation. */ + par = PATTERN (insn); + gcc_assert (GET_CODE (par) == PARALLEL); + set = XVECEXP (par, 0, 0); + gcc_assert (GET_CODE (set) == SET); + mem = SET_DEST (set); + gcc_assert (MEM_P (mem)); + MEM_NOTRAP_P (mem) = 1; + set_mem_alias_set (mem, get_frame_alias_set ()); + } else { emit_insn ((* ((TARGET_32BIT) ? gen_addsi3 : gen_adddi3)) (stack_pointer_rtx, stack_pointer_rtx, neg_op0)); - emit_move_insn (gen_rtx_MEM (Pmode, stack_pointer_rtx), chain); + emit_move_insn (gen_frame_mem (Pmode, stack_pointer_rtx), chain); } emit_move_insn (operands[0], virtual_stack_dynamic_rtx); diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 27b2ca1960c..98b98a80802 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -9890,6 +9890,48 @@ concatn_mem_loc_descriptor (rtx concatn, enum machine_mode mode, return cc_loc_result; } +/* Try to handle TLS MEMs, for which mem_loc_descriptor on XEXP (mem, 0) + failed. */ + +static dw_loc_descr_ref +tls_mem_loc_descriptor (rtx mem) +{ + tree base; + dw_loc_descr_ref loc_result, loc_result2; + + if (MEM_EXPR (mem) == NULL_TREE || MEM_OFFSET (mem) == NULL_RTX) + return NULL; + + base = get_base_address (MEM_EXPR (mem)); + if (base == NULL + || TREE_CODE (base) != VAR_DECL + || !DECL_THREAD_LOCAL_P (base)) + return NULL; + + loc_result = loc_descriptor_from_tree_1 (MEM_EXPR (mem), 2); + if (loc_result == NULL) + return NULL; + + if (INTVAL (MEM_OFFSET (mem))) + { + if (INTVAL (MEM_OFFSET (mem)) >= 0) + add_loc_descr (&loc_result, + new_loc_descr (DW_OP_plus_uconst, + INTVAL (MEM_OFFSET (mem)), 0)); + else + { + loc_result2 = mem_loc_descriptor (MEM_OFFSET (mem), GET_MODE (mem), + VAR_INIT_STATUS_INITIALIZED); + if (loc_result2 == 0) + return NULL; + add_loc_descr (&loc_result, loc_result2); + add_loc_descr (&loc_result, new_loc_descr (DW_OP_plus, 0, 0)); + } + } + + return loc_result; +} + /* The following routine converts the RTL for a variable or parameter (resident in memory) into an equivalent Dwarf representation of a mechanism for getting the address of that same variable onto the top of a @@ -9963,6 +10005,8 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode, case MEM: mem_loc_result = mem_loc_descriptor (XEXP (rtl, 0), GET_MODE (rtl), VAR_INIT_STATUS_INITIALIZED); + if (mem_loc_result == NULL) + mem_loc_result = tls_mem_loc_descriptor (rtl); if (mem_loc_result != 0) add_loc_descr (&mem_loc_result, new_loc_descr (DW_OP_deref, 0, 0)); break; @@ -10045,9 +10089,12 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode, INTVAL (XEXP (rtl, 1)), 0)); else { - add_loc_descr (&mem_loc_result, - mem_loc_descriptor (XEXP (rtl, 1), mode, - VAR_INIT_STATUS_INITIALIZED)); + dw_loc_descr_ref mem_loc_result2 + = mem_loc_descriptor (XEXP (rtl, 1), mode, + VAR_INIT_STATUS_INITIALIZED); + if (mem_loc_result2 == 0) + break; + add_loc_descr (&mem_loc_result, mem_loc_result2); add_loc_descr (&mem_loc_result, new_loc_descr (DW_OP_plus, 0, 0)); } @@ -10097,6 +10144,12 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode, VAR_INIT_STATUS_INITIALIZED); break; + case UNSPEC: + /* If delegitimize_address couldn't do anything with the UNSPEC, we + can't express it in the debug info. This can happen e.g. with some + TLS UNSPECs. */ + break; + default: gcc_unreachable (); } @@ -10193,6 +10246,8 @@ loc_descriptor (rtx rtl, enum var_init_status initialized) case MEM: loc_result = mem_loc_descriptor (XEXP (rtl, 0), GET_MODE (rtl), initialized); + if (loc_result == NULL) + loc_result = tls_mem_loc_descriptor (rtl); break; case CONCAT: @@ -10225,6 +10280,8 @@ loc_descriptor (rtx rtl, enum var_init_status initialized) /* Create the first one, so we have something to add to. */ loc_result = loc_descriptor (XEXP (RTVEC_ELT (par_elems, 0), 0), initialized); + if (loc_result == NULL) + return NULL; mode = GET_MODE (XEXP (RTVEC_ELT (par_elems, 0), 0)); add_loc_descr_op_piece (&loc_result, GET_MODE_SIZE (mode)); for (i = 1; i < num_elem; i++) @@ -10233,6 +10290,8 @@ loc_descriptor (rtx rtl, enum var_init_status initialized) temp = loc_descriptor (XEXP (RTVEC_ELT (par_elems, i), 0), initialized); + if (temp == NULL) + return NULL; add_loc_descr (&loc_result, temp); mode = GET_MODE (XEXP (RTVEC_ELT (par_elems, i), 0)); add_loc_descr_op_piece (&loc_result, GET_MODE_SIZE (mode)); @@ -10311,7 +10370,7 @@ loc_descriptor_from_tree_1 (tree loc, int want_address) /* The way DW_OP_GNU_push_tls_address is specified, we can only look up addresses of objects in the current module. */ - if (DECL_EXTERNAL (loc)) + if (DECL_EXTERNAL (loc) && !targetm.binds_local_p (loc)) return 0; first_op = INTERNAL_DW_OP_tls_addr; second_op = DW_OP_GNU_push_tls_address; @@ -10433,7 +10492,10 @@ loc_descriptor_from_tree_1 (tree loc, int want_address) if (offset != NULL_TREE) { /* Variable offset. */ - add_loc_descr (&ret, loc_descriptor_from_tree_1 (offset, 0)); + ret1 = loc_descriptor_from_tree_1 (offset, 0); + if (ret1 == 0) + return 0; + add_loc_descr (&ret, ret1); add_loc_descr (&ret, new_loc_descr (DW_OP_plus, 0, 0)); } diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 16ed9e9d68b..389f8faa09e 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2008-09-25 Jerry DeLisle <jvdelisle@gcc.gnu.org + + PR fortran/37498 + * trans-io.c (build_dt): Revert previous patch.. + * ioparm.def: Delete IOPARM_dt_f2003. + 2008-09-25 Tobias Burnus <burnus@net-b.de> PR fortran/37504 diff --git a/gcc/fortran/ioparm.def b/gcc/fortran/ioparm.def index ee3f6b21910..deb1b98389c 100644 --- a/gcc/fortran/ioparm.def +++ b/gcc/fortran/ioparm.def @@ -93,4 +93,3 @@ IOPARM (dt, pad, 1 << 22, char1) IOPARM (dt, round, 1 << 23, char2) IOPARM (dt, sign, 1 << 24, char1) IOPARM (dt, u, 0, pad) -#define IOPARM_dt_f2003 (1 << 25) diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c index fdc517abe97..af46ea2d65a 100644 --- a/gcc/fortran/trans-io.c +++ b/gcc/fortran/trans-io.c @@ -1641,7 +1641,7 @@ build_dt (tree function, gfc_code * code) tree tmp, var; gfc_expr *nmlname; gfc_namelist *nml; - unsigned int mask = IOPARM_dt_f2003; + unsigned int mask = 0; gfc_start_block (&block); gfc_init_block (&post_block); diff --git a/gcc/opts.c b/gcc/opts.c index 6e210ea7ceb..bac50b0925f 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -1459,7 +1459,8 @@ common_handle_option (size_t scode, const char *arg, int value, print_specific_help (0, undoc_mask, all_langs_mask); /* Then display any remaining, non-language options. */ for (i = CL_MIN_OPTION_CLASS; i <= CL_MAX_OPTION_CLASS; i <<= 1) - print_specific_help (i, undoc_mask, 0); + if (i != CL_SAVE) + print_specific_help (i, undoc_mask, 0); exit_after_options = true; break; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 959ab49ff8a..cc430ac8559 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,24 @@ +2008-09-26 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/37275 + * gcc.target/i386/pr37275.c: New test. + +2008-09-26 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/specs/static_initializer4.ads: New test. + * gnat.dg/specs/static_initializer3.ads: Add missing marker. + +2008-09-26 Kai Tietz <kai.tietz@onevision.com> + + * g++.dg/compat/struct-layout-1_x1.h: Add __SIZE_TYPE__ cast + to avoid pointer truncation warning. + +2008-09-26 Dorit Nuzman <dorit@il.ibm.com> + + PR tree-optimization/37574 + * gcc.dg/vect/ggc-pr37574.c: New test. + * gcc.dg/vect/vect.exp: Compile some tests with ggc flags. + 2008-09-25 Jakub Jelinek <jakub@redhat.com> PR c/37645 diff --git a/gcc/testsuite/g++.dg/compat/struct-layout-1_x1.h b/gcc/testsuite/g++.dg/compat/struct-layout-1_x1.h index 0c7696fa7db..e14433e0326 100644 --- a/gcc/testsuite/g++.dg/compat/struct-layout-1_x1.h +++ b/gcc/testsuite/g++.dg/compat/struct-layout-1_x1.h @@ -56,7 +56,7 @@ void test##n (void) \ info.als = __alignof__ (s##n); \ info.ala0 = __alignof__ (a##n[0]); \ info.ala3 = __alignof__ (a##n[3]); \ - if (((long) &a##n[3]) & (info.als - 1)) \ + if (((long) (__SIZE_TYPE__) &a##n[3]) & (info.als - 1)) \ FAIL (n, 1); \ i = 0; j = 0; \ ops \ diff --git a/gcc/testsuite/gcc.dg/vect/vect.exp b/gcc/testsuite/gcc.dg/vect/vect.exp index e67b2e4b467..f7253c66c13 100644 --- a/gcc/testsuite/gcc.dg/vect/vect.exp +++ b/gcc/testsuite/gcc.dg/vect/vect.exp @@ -242,6 +242,12 @@ lappend DEFAULT_VECTCFLAGS "-Os" dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/Os-vect-*.\[cS\]]] \ "" $DEFAULT_VECTCFLAGS +# With --param ggc-min-expand=0 --param ggc-min-heapsize=0 +set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS +lappend DEFAULT_VECTCFLAGS "--param" "ggc-min-expand=0" "--param" "ggc-min-heapsize=0" +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/ggc-*.\[cS\]]] \ + "" $DEFAULT_VECTCFLAGS + # With -O3 set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-O3" diff --git a/gcc/testsuite/gnat.dg/specs/static_initializer3.ads b/gcc/testsuite/gnat.dg/specs/static_initializer3.ads index 42994f2e1c5..2dc8be1e5be 100644 --- a/gcc/testsuite/gnat.dg/specs/static_initializer3.ads +++ b/gcc/testsuite/gnat.dg/specs/static_initializer3.ads @@ -1,3 +1,5 @@ +-- { dg-do compile } + with Unchecked_Conversion; package Static_Initializer3 is diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c index d004aadee7b..3ce30157f71 100644 --- a/gcc/tree-vect-transform.c +++ b/gcc/tree-vect-transform.c @@ -1401,7 +1401,7 @@ vect_get_constant_vectors (slp_tree slp_node, VEC(tree,heap) **vec_oprnds, gimple stmt = VEC_index (gimple, stmts, 0); stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt); tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo); - int nunits = TYPE_VECTOR_SUBPARTS (vectype); + int nunits; tree vec_cst; tree t = NULL_TREE; int j, number_of_places_left_in_vector; @@ -1410,12 +1410,33 @@ vect_get_constant_vectors (slp_tree slp_node, VEC(tree,heap) **vec_oprnds, int group_size = VEC_length (gimple, stmts); unsigned int vec_num, i; int number_of_copies = 1; - bool is_store = false; VEC (tree, heap) *voprnds = VEC_alloc (tree, heap, number_of_vectors); - bool constant_p; + bool constant_p, is_store; if (STMT_VINFO_DATA_REF (stmt_vinfo)) - is_store = true; + { + is_store = true; + op = gimple_assign_rhs1 (stmt); + } + else + { + is_store = false; + op = gimple_op (stmt, op_num + 1); + } + + if (CONSTANT_CLASS_P (op)) + { + vector_type = vectype; + constant_p = true; + } + else + { + vector_type = get_vectype_for_scalar_type (TREE_TYPE (op)); + gcc_assert (vector_type); + constant_p = false; + } + + nunits = TYPE_VECTOR_SUBPARTS (vector_type); /* NUMBER_OF_COPIES is the number of times we need to use the same values in created vectors. It is greater than 1 if unrolling is performed. @@ -1436,18 +1457,15 @@ vect_get_constant_vectors (slp_tree slp_node, VEC(tree,heap) **vec_oprnds, number_of_copies = least_common_multiple (nunits, group_size) / group_size; number_of_places_left_in_vector = nunits; - constant_p = true; for (j = 0; j < number_of_copies; j++) { for (i = group_size - 1; VEC_iterate (gimple, stmts, i, stmt); i--) { - if (is_store) - op = gimple_assign_rhs1 (stmt); - else - op = gimple_op (stmt, op_num + 1); - if (!CONSTANT_CLASS_P (op)) - constant_p = false; - + if (is_store) + op = gimple_assign_rhs1 (stmt); + else + op = gimple_op (stmt, op_num + 1); + /* Create 'vect_ = {op0,op1,...,opn}'. */ t = tree_cons (NULL_TREE, op, t); @@ -1457,16 +1475,12 @@ vect_get_constant_vectors (slp_tree slp_node, VEC(tree,heap) **vec_oprnds, { number_of_places_left_in_vector = nunits; - vector_type = get_vectype_for_scalar_type (TREE_TYPE (op)); - gcc_assert (vector_type); if (constant_p) vec_cst = build_vector (vector_type, t); else vec_cst = build_constructor_from_list (vector_type, t); - constant_p = true; VEC_quick_push (tree, voprnds, - vect_init_vector (stmt, vec_cst, vector_type, - NULL)); + vect_init_vector (stmt, vec_cst, vector_type, NULL)); t = NULL_TREE; } } @@ -1886,7 +1900,7 @@ vect_get_vec_def_for_operand (tree op, gimple stmt, tree *scalar_def) stmt_vec_info def_stmt_info = NULL; stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt); tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo); - int nunits = TYPE_VECTOR_SUBPARTS (vectype); + unsigned int nunits = TYPE_VECTOR_SUBPARTS (vectype); loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo); tree vec_inv; tree vec_cst; @@ -1935,16 +1949,17 @@ vect_get_vec_def_for_operand (tree op, gimple stmt, tree *scalar_def) { t = tree_cons (NULL_TREE, op, t); } - vector_type = get_vectype_for_scalar_type (TREE_TYPE (op)); - gcc_assert (vector_type); - vec_cst = build_vector (vector_type, t); - - return vect_init_vector (stmt, vec_cst, vector_type, NULL); + vec_cst = build_vector (vectype, t); + return vect_init_vector (stmt, vec_cst, vectype, NULL); } /* Case 2: operand is defined outside the loop - loop invariant. */ case vect_invariant_def: { + vector_type = get_vectype_for_scalar_type (TREE_TYPE (def)); + gcc_assert (vector_type); + nunits = TYPE_VECTOR_SUBPARTS (vector_type); + if (scalar_def) *scalar_def = def; @@ -1958,8 +1973,6 @@ vect_get_vec_def_for_operand (tree op, gimple stmt, tree *scalar_def) } /* FIXME: use build_constructor directly. */ - vector_type = get_vectype_for_scalar_type (TREE_TYPE (def)); - gcc_assert (vector_type); vec_inv = build_constructor_from_list (vector_type, t); return vect_init_vector (stmt, vec_inv, vector_type, NULL); } @@ -2222,6 +2235,7 @@ get_initial_def_for_reduction (gimple stmt, tree init_val, tree *adjustment_def) struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo); tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo); int nunits = TYPE_VECTOR_SUBPARTS (vectype); + tree scalar_type = TREE_TYPE (vectype); enum tree_code code = gimple_assign_rhs_code (stmt); tree type = TREE_TYPE (init_val); tree vecdef; @@ -2229,7 +2243,6 @@ get_initial_def_for_reduction (gimple stmt, tree init_val, tree *adjustment_def) tree init_def; tree t = NULL_TREE; int i; - tree vector_type; bool nested_in_vect_loop = false; gcc_assert (POINTER_TYPE_P (type) || INTEGRAL_TYPE_P (type) || SCALAR_FLOAT_TYPE_P (type)); @@ -2250,15 +2263,14 @@ get_initial_def_for_reduction (gimple stmt, tree init_val, tree *adjustment_def) else *adjustment_def = init_val; /* Create a vector of zeros for init_def. */ - if (SCALAR_FLOAT_TYPE_P (type)) - def_for_init = build_real (type, dconst0); + if (SCALAR_FLOAT_TYPE_P (scalar_type)) + def_for_init = build_real (scalar_type, dconst0); else - def_for_init = build_int_cst (type, 0); + def_for_init = build_int_cst (scalar_type, 0); + for (i = nunits - 1; i >= 0; --i) t = tree_cons (NULL_TREE, def_for_init, t); - vector_type = get_vectype_for_scalar_type (TREE_TYPE (def_for_init)); - gcc_assert (vector_type); - init_def = build_vector (vector_type, t); + init_def = build_vector (vectype, t); break; case MIN_EXPR: @@ -6008,7 +6020,6 @@ vect_create_mask_and_perm (gimple stmt, gimple next_scalar_stmt, for (i = mask_nunits - 1; i >= 0; --i) t = tree_cons (NULL_TREE, build_int_cst (mask_element_type, mask_array[i]), t); - mask_vec = build_vector (mask_type, t); mask = vect_init_vector (stmt, mask_vec, mask_type, NULL); diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index 47821e89a9e..9a3a9f3c8a7 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -2036,11 +2036,11 @@ vect_is_simple_use (tree operand, loop_vec_info loop_vinfo, gimple *def_stmt, return true; } if (is_gimple_min_invariant (operand)) - { + { *def = operand; *dt = vect_invariant_def; return true; - } + } if (TREE_CODE (operand) == PAREN_EXPR) { |