diff options
Diffstat (limited to 'gcc')
72 files changed, 1727 insertions, 131 deletions
diff --git a/gcc/BASE-VER b/gcc/BASE-VER index cbe06cdbfc2..fa1ba0458a1 100644 --- a/gcc/BASE-VER +++ b/gcc/BASE-VER @@ -1 +1 @@ -4.4.4 +4.4.5 diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cf06d7737cb..ebb48d554eb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,209 @@ +2010-05-17 Alan Modra <amodra@gmail.com> + + * config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Delete + unnecessary prototype. Replace copy_r12 and copy_r11 flag params + with copy_reg rtx param. + (rs6000_emit_prologue): Update rs6000_emit_allocate_stack calls. + Correct cases where code for ABI_V4 did not initialise the reg + used to access frame. Also leave frame_reg_rtx as sp for large + frames that save no regs. + +2010-05-12 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/44085 + * gimplify.c (enum omp_region_type): Add ORT_UNTIED_TASK, + change value of ORT_TASK. + (new_omp_context): Handle ORT_UNTIED_TASK like ORT_TASK. + (omp_notice_threadprivate_variable): New function. + (omp_notice_variable): Call it for threadprivate variables. + If enclosing ctx is a task, print enclosing task rather than + enclosing parallel. Handle ORT_UNTIED_TASK like ORT_TASK. + (gimplify_omp_task): Pass ORT_UNTIED_TASK instead of ORT_TASK + if task has untied clause. + +2010-05-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> + + PR documentation/44016 + * doc/standards.texi (Standards): Link to unversioned + cxx0x_status.html page. + +2010-05-05 Kaz Kojima <kkojima@gcc.gnu.org> + + Backport from mainline: + 2010-04-22 Kaz Kojima <kkojima@gcc.gnu.org> + + PR target/43744 + * config/sh/sh.c (find_barrier): Don't emit a constant pool + in the middle of insns for casesi_worker_2. + +2010-05-05 Jason Merrill <jason@redhat.com> + + PR debug/43370 + * c-common.c (handle_aligned_attribute): Respect + ATTR_FLAG_TYPE_IN_PLACE. + +2010-05-04 H.J. Lu <hongjiu.lu@intel.com> + + Backport from mainline + 2010-05-04 H.J. Lu <hongjiu.lu@intel.com> + + PR middle-end/43671 + * alias.c (true_dependence): Handle the same VALUE in x and mem. + (canon_true_dependence): Likewise. + (write_dependence_p): Likewise. + +2010-05-02 Uros Bizjak <ubizjak@gmail.com> + + * config/i386/i386.c (ix86_target_string): Output 'flags', not 'isa', + when processing flag options. + +2010-04-30 Eric Botcazou <ebotcazou@adacore.com> + + * tree-ssa-loop-ivopts.c (may_be_unaligned_p): Check the alignment of + the variable part of the offset as well. Use highest_pow2_factor for + all alignment checks. + +2010-04-30 Jakub Jelinek <jakub@redhat.com> + + PR c/43893 + * c-omp.c (c_finish_omp_for): Handle also EQ_EXPR. + +2010-04-29 Jakub Jelinek <jakub@redhat.com> + + * BASE-VER: Set to 4.4.5. + * DEV-PHASE: Set to prerelease. + +2010-04-29 Release Manager + + * GCC 4.4.4 released. + +2010-04-21 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/43570 + * omp-low.c (scan_sharing_clauses): Don't scan_omp_op + OMP_CLAUSE_DECL for OMP_CLAUSE_COPYPRIVATE. + (lower_copyprivate_clauses): Use private var in outer + context instead of original var. Make sure the types + are correct for VLAs. + +2010-04-20 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/43337 + * tree-nested.c (convert_nonlocal_omp_clauses): OMP_CLAUSE_PRIVATE + with non-local decl doesn't need chain. + +2010-04-19 Jie Zhang <jie@codesourcery.com> + + PR target/43662 + * reginfo.c (reinit_regs): Set caller_save_initialized_p + to false. + +2010-04-19 Ira Rosen <irar@il.ibm.com> + + PR tree-optimization/43771 + * tree-vect-analyze.c (vect_supported_load_permutation_p): Check + that load permutation doesn't have gaps. + +2010-04-18 Eric Botcazou <ebotcazou@adacore.com> + + PR tree-optimization/43769 + * tree-sra.c (bitfield_overlaps_p): If the length of the element is + self-referential, try to compute an upper bound. + +2010-04-08 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> + + Backport from mainline: + 2009-12-05 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> + + PR ada/41912 + * pa/linux-unwind.h (pa32_fallback_frame_state): Set fs->signal_frame + for signal frames. + * pa/hpux-unwind.h (pa32_fallback_frame_state): Likewise. + +2010-04-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + PR target/43643 + * config/i386/gmon-sol2.c [__x86_64__]: Properly restore %rcx. + +2010-04-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + Backport from mainline: + 2010-03-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + PR target/38085 + * config/i386/i386.c (x86_function_profiler) + [!NO_PROFILE_COUNTERS]: Fix typo. + * config/i386/gmon-sol2.c (_mcleanup) [__x86_64__]: Use call + instead of callq. + +2010-04-08 Richard Guenther <rguenther@suse.de> + + PR middle-end/42956 + * gimplify.c (gimple_fold_indirect_ref): Avoid generating + new ARRAY_REFs on variable size element or minimal index arrays. + * tree-ssa-loop-ivopts.c (find_interesting_uses_address): Use + gimple_fold_indirect_ref. + +2010-04-08 Wolfgang Gellerich <gellerich@de.ibm.com> + + * config/s390/s390.c (override_options): Adjust the z10 + defaults for max-unroll-times, max-completely-peeled-insns + and max-completely-peel-times. + +2010-04-08 Wolfgang Gellerich <gellerich@de.ibm.com> + + * config/s390/s390.c (override_options): Set + default of max-pending-list-length to 256 + +2010-04-08 Jakub Jelinek <jakub@redhat.com> + + Backport from mainline: + 2010-03-29 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/43560 + * tree-ssa-loop-im.c (ref_always_accessed_p): Add store_p + parameter. + (can_sm_ref_p): Treat stores to readonly locations as + trapping. + + 2010-04-01 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/43607 + * ipa-type-escape.c (check_call): Do not access non-existing + arguments. + + 2010-04-01 Richard Guenther <rguenther@suse.de> + + PR middle-end/43614 + * tree-ssa-address.c (copy_mem_ref_info): Copy TREE_SIDE_EFFECTS + and TREE_THIS_VOLATILE. + (copy_ref_info): Likewise. + * tree-ssa-operands.c (get_tmr_operands): Check TREE_THIS_VOLATILE. + * tree.c (build7_stat): Ignore side-effects of all but arg5 + for TARGET_MEM_REF. Set TREE_THIS_VOLATILE from arg5 of + TARGET_MEM_REF. + +2010-04-08 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/43186 + * params.def (PARAM_MAX_UNROLL_ITERATIONS): New param. + * doc/invoke.texi (max-completely-peel-loop-nest-depth): Document. + * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely): Limit + unroller iterations. + +2010-04-07 H.J. Lu <hongjiu.lu@intel.com> + + PR target/43668 + * config/i386/i386.c (setup_incoming_varargs_64): Align stack to + 16byte for FP register save area. + +2010-04-07 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/43629 + * tree-ssa-ccp.c (likely_value): Properly look for constant + values. Reset all_undefined_operands if we have seen a + constant value. + 2010-04-06 Jakub Jelinek <jakub@redhat.com> PR target/43638 diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index aa7db7710b9..761d57aedd2 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20100407 +20100517 diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index aa8baacd138..0ff5fb6d611 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2010-04-29 Release Manager + + * GCC 4.4.4 released. + 2010-02-27 Eric Botcazou <ebotcazou@adacore.com> PR ada/42253 diff --git a/gcc/alias.c b/gcc/alias.c index 69c8aa984c1..61ccc3db33e 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -2249,8 +2249,18 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x, if (mem_mode == VOIDmode) mem_mode = GET_MODE (mem); - x_addr = get_addr (XEXP (x, 0)); - mem_addr = get_addr (XEXP (mem, 0)); + x_addr = XEXP (x, 0); + mem_addr = XEXP (mem, 0); + if (!((GET_CODE (x_addr) == VALUE + && GET_CODE (mem_addr) != VALUE + && reg_mentioned_p (x_addr, mem_addr)) + || (GET_CODE (x_addr) != VALUE + && GET_CODE (mem_addr) == VALUE + && reg_mentioned_p (mem_addr, x_addr)))) + { + x_addr = get_addr (x_addr); + mem_addr = get_addr (mem_addr); + } base = find_base_term (x_addr); if (base && (GET_CODE (base) == LABEL_REF @@ -2328,7 +2338,16 @@ canon_true_dependence (const_rtx mem, enum machine_mode mem_mode, rtx mem_addr, return 1; if (! x_addr) - x_addr = get_addr (XEXP (x, 0)); + { + x_addr = XEXP (x, 0); + if (!((GET_CODE (x_addr) == VALUE + && GET_CODE (mem_addr) != VALUE + && reg_mentioned_p (x_addr, mem_addr)) + || (GET_CODE (x_addr) != VALUE + && GET_CODE (mem_addr) == VALUE + && reg_mentioned_p (mem_addr, x_addr)))) + x_addr = get_addr (x_addr); + } if (! base_alias_check (x_addr, mem_addr, GET_MODE (x), mem_mode)) return 0; @@ -2394,8 +2413,18 @@ write_dependence_p (const_rtx mem, const_rtx x, int writep) if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x)) return 1; - x_addr = get_addr (XEXP (x, 0)); - mem_addr = get_addr (XEXP (mem, 0)); + x_addr = XEXP (x, 0); + mem_addr = XEXP (mem, 0); + if (!((GET_CODE (x_addr) == VALUE + && GET_CODE (mem_addr) != VALUE + && reg_mentioned_p (x_addr, mem_addr)) + || (GET_CODE (x_addr) != VALUE + && GET_CODE (mem_addr) == VALUE + && reg_mentioned_p (mem_addr, x_addr)))) + { + x_addr = get_addr (x_addr); + mem_addr = get_addr (mem_addr); + } if (! writep) { diff --git a/gcc/c-common.c b/gcc/c-common.c index 2482cab85b7..2ec98cd7744 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -5976,10 +5976,12 @@ handle_aligned_attribute (tree *node, tree ARG_UNUSED (name), tree args, } else if (is_type) { + if ((flags & (int) ATTR_FLAG_TYPE_IN_PLACE)) + /* OK, modify the type in place. */; /* If we have a TYPE_DECL, then copy the type, so that we don't accidentally modify a builtin type. See pushdecl. */ - if (decl && TREE_TYPE (decl) != error_mark_node - && DECL_ORIGINAL_TYPE (decl) == NULL_TREE) + else if (decl && TREE_TYPE (decl) != error_mark_node + && DECL_ORIGINAL_TYPE (decl) == NULL_TREE) { tree tt = TREE_TYPE (decl); *type = build_variant_type_copy (*type); @@ -5988,7 +5990,7 @@ handle_aligned_attribute (tree *node, tree ARG_UNUSED (name), tree args, TREE_USED (*type) = TREE_USED (decl); TREE_TYPE (decl) = *type; } - else if (!(flags & (int) ATTR_FLAG_TYPE_IN_PLACE)) + else *type = build_variant_type_copy (*type); TYPE_ALIGN (*type) = (1 << i) * BITS_PER_UNIT; diff --git a/gcc/c-omp.c b/gcc/c-omp.c index 33f0a83e1a8..183ff36b105 100644 --- a/gcc/c-omp.c +++ b/gcc/c-omp.c @@ -1,7 +1,7 @@ /* This file contains routines to construct GNU OpenMP constructs, called from parsing in the C and C++ front ends. - Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Richard Henderson <rth@redhat.com>, Diego Novillo <dnovillo@redhat.com>. @@ -281,7 +281,8 @@ c_finish_omp_for (location_t locus, tree declv, tree initv, tree condv, || TREE_CODE (cond) == LE_EXPR || TREE_CODE (cond) == GT_EXPR || TREE_CODE (cond) == GE_EXPR - || TREE_CODE (cond) == NE_EXPR) + || TREE_CODE (cond) == NE_EXPR + || TREE_CODE (cond) == EQ_EXPR) { tree op0 = TREE_OPERAND (cond, 0); tree op1 = TREE_OPERAND (cond, 1); @@ -326,18 +327,21 @@ c_finish_omp_for (location_t locus, tree declv, tree initv, tree condv, cond_ok = true; } - if (TREE_CODE (cond) == NE_EXPR) + if (TREE_CODE (cond) == NE_EXPR + || TREE_CODE (cond) == EQ_EXPR) { if (!INTEGRAL_TYPE_P (TREE_TYPE (decl))) cond_ok = false; else if (operand_equal_p (TREE_OPERAND (cond, 1), TYPE_MIN_VALUE (TREE_TYPE (decl)), 0)) - TREE_SET_CODE (cond, GT_EXPR); + TREE_SET_CODE (cond, TREE_CODE (cond) == NE_EXPR + ? GT_EXPR : LE_EXPR); else if (operand_equal_p (TREE_OPERAND (cond, 1), TYPE_MAX_VALUE (TREE_TYPE (decl)), 0)) - TREE_SET_CODE (cond, LT_EXPR); + TREE_SET_CODE (cond, TREE_CODE (cond) == NE_EXPR + ? LT_EXPR : GE_EXPR); else cond_ok = false; } diff --git a/gcc/config/i386/gmon-sol2.c b/gcc/config/i386/gmon-sol2.c index d20762156a6..fb813a12d25 100644 --- a/gcc/config/i386/gmon-sol2.c +++ b/gcc/config/i386/gmon-sol2.c @@ -268,14 +268,14 @@ asm(".globl _mcount\n" FROMPCINDEX (via the frame pointer. */ "\tmovq\t0x38(%rsp),%rdi\n" "\tmovq\t0x8(%rbp),%rsi\n" - "\tcallq\tinternal_mcount\n" + "\tcall\tinternal_mcount\n" /* Restore the saved registers. */ "\tmovq\t0x30(%rsp),%r9\n" "\tmovq\t0x28(%rsp),%r8\n" "\tmovq\t0x20(%rsp),%rdi\n" "\tmovq\t0x18(%rsp),%rsi\n" "\tmovq\t0x10(%rsp),%rdx\n" - "\tmovq\t0x08(%rsp),%rdx\n" + "\tmovq\t0x08(%rsp),%rcx\n" "\tmovq\t(%rsp),%rax\n" "\taddq\t$0x38,%rsp\n" "\tretq\n" diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index ccc6668d6da..2fbf1ebb5b4 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1,6 +1,6 @@ /* Subroutines used for code generation on IA-32. Copyright (C) 1988, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -2358,7 +2358,7 @@ ix86_target_string (int isa, int flags, const char *arch, const char *tune, if (flags && add_nl_p) { opts[num++][0] = target_other; - sprintf (target_other, "(other flags: 0x%x)", isa); + sprintf (target_other, "(other flags: 0x%x)", flags); } /* Add -fpmath= option. */ @@ -6588,6 +6588,10 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum) if (ix86_varargs_fpr_size) { + /* Stack must be aligned to 16byte for FP register save area. */ + if (crtl->stack_alignment_needed < 128) + crtl->stack_alignment_needed = 128; + /* Now emit code to save SSE registers. The AX parameter contains number of SSE parameter registers used to call this function. We use sse_prologue_save insn template that produces computed jump across @@ -26833,7 +26837,7 @@ x86_function_profiler (FILE *file, int labelno ATTRIBUTE_UNUSED) if (TARGET_64BIT) { #ifndef NO_PROFILE_COUNTERS - fprintf (file, "\tleaq\t%sP%d@(%%rip),%%r11\n", LPREFIX, labelno); + fprintf (file, "\tleaq\t%sP%d(%%rip),%%r11\n", LPREFIX, labelno); #endif if (DEFAULT_ABI == SYSV_ABI && flag_pic) diff --git a/gcc/config/pa/hpux-unwind.h b/gcc/config/pa/hpux-unwind.h index cfce90be6ba..92061ec3677 100644 --- a/gcc/config/pa/hpux-unwind.h +++ b/gcc/config/pa/hpux-unwind.h @@ -351,6 +351,7 @@ pa_fallback_frame_state (struct _Unwind_Context *context, fs->retaddr_column = DWARF_ALT_FRAME_RETURN_COLUMN; UPDATE_FS_FOR_PC (fs, DWARF_ALT_FRAME_RETURN_COLUMN); + fs->signal_frame = 1; return _URC_NO_REASON; } diff --git a/gcc/config/pa/linux-unwind.h b/gcc/config/pa/linux-unwind.h index 733f772c1c7..a0560e97445 100644 --- a/gcc/config/pa/linux-unwind.h +++ b/gcc/config/pa/linux-unwind.h @@ -135,6 +135,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context, fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].loc.offset = (long) &sc->sc_iaoq[0] - new_cfa; fs->retaddr_column = DWARF_ALT_FRAME_RETURN_COLUMN; + fs->signal_frame = 1; return _URC_NO_REASON; } #endif /* inhibit_libc */ diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 5e6f30183a9..05d03823b2d 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -759,7 +759,6 @@ static bool spe_func_has_64bit_regs_p (void); static void emit_frame_save (rtx, rtx, enum machine_mode, unsigned int, int, HOST_WIDE_INT); static rtx gen_frame_mem_offset (enum machine_mode, rtx, int); -static void rs6000_emit_allocate_stack (HOST_WIDE_INT, int, int); static unsigned rs6000_hash_constant (rtx); static unsigned toc_hash_function (const void *); static int toc_hash_eq (const void *, const void *); @@ -15548,13 +15547,11 @@ rs6000_emit_stack_tie (void) } /* Emit the correct code for allocating stack space, as insns. - If COPY_R12, make sure a copy of the old frame is left in r12. - If COPY_R11, make sure a copy of the old frame is left in r11, - in preference to r12 if COPY_R12. + If COPY_REG, make sure a copy of the old frame is left there. The generated code may use hard register 0 as a temporary. */ static void -rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12, int copy_r11) +rs6000_emit_allocate_stack (HOST_WIDE_INT size, rtx copy_reg) { rtx insn; rtx stack_reg = gen_rtx_REG (Pmode, STACK_POINTER_REGNUM); @@ -15604,11 +15601,8 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12, int copy_r11) warning (0, "stack limit expression is not supported"); } - if (copy_r12 || copy_r11) - emit_move_insn (copy_r11 - ? gen_rtx_REG (Pmode, 11) - : gen_rtx_REG (Pmode, 12), - stack_reg); + if (copy_reg) + emit_move_insn (copy_reg, stack_reg); if (size > 32767) { @@ -16180,20 +16174,33 @@ rs6000_emit_prologue (void) ? (!saving_GPRs_inline && info->spe_64bit_regs_used == 0) : (!saving_FPRs_inline || !saving_GPRs_inline)); + rtx copy_reg = need_r11 ? gen_rtx_REG (Pmode, 11) : NULL; + if (info->total_size < 32767) sp_offset = info->total_size; + else if (need_r11) + frame_reg_rtx = copy_reg; + else if (info->cr_save_p + || info->lr_save_p + || info->first_fp_reg_save < 64 + || info->first_gp_reg_save < 32 + || info->altivec_size != 0 + || info->vrsave_mask != 0 + || crtl->calls_eh_return) + { + copy_reg = frame_ptr_rtx; + frame_reg_rtx = copy_reg; + } else - frame_reg_rtx = (need_r11 - ? gen_rtx_REG (Pmode, 11) - : frame_ptr_rtx); - rs6000_emit_allocate_stack (info->total_size, - (frame_reg_rtx != sp_reg_rtx - && (info->cr_save_p - || info->lr_save_p - || info->first_fp_reg_save < 64 - || info->first_gp_reg_save < 32 - )), - need_r11); + { + /* The prologue won't be saving any regs so there is no need + to set up a frame register to access any frame save area. + We also won't be using sp_offset anywhere below, but set + the correct value anyway to protect against future + changes to this function. */ + sp_offset = info->total_size; + } + rs6000_emit_allocate_stack (info->total_size, copy_reg); if (frame_reg_rtx != sp_reg_rtx) rs6000_emit_stack_tie (); } @@ -16627,16 +16634,19 @@ rs6000_emit_prologue (void) if (!WORLD_SAVE_P (info) && info->push_p && !(DEFAULT_ABI == ABI_V4 || crtl->calls_eh_return)) { + rtx copy_reg = NULL; + if (info->total_size < 32767) - sp_offset = info->total_size; + sp_offset = info->total_size; + else if (info->altivec_size != 0 + || info->vrsave_mask != 0) + { + copy_reg = frame_ptr_rtx; + frame_reg_rtx = copy_reg; + } else - frame_reg_rtx = frame_ptr_rtx; - rs6000_emit_allocate_stack (info->total_size, - (frame_reg_rtx != sp_reg_rtx - && ((info->altivec_size != 0) - || (info->vrsave_mask != 0) - )), - FALSE); + sp_offset = info->total_size; + rs6000_emit_allocate_stack (info->total_size, copy_reg); if (frame_reg_rtx != sp_reg_rtx) rs6000_emit_stack_tie (); } diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index e63688934e6..118a4e3c437 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -1650,9 +1650,19 @@ override_options (void) target_flags |= MASK_LONG_DOUBLE_128; #endif - if (s390_tune == PROCESSOR_2097_Z10 - && !PARAM_SET_P (PARAM_MAX_UNROLLED_INSNS)) - set_param_value ("max-unrolled-insns", 100); + if (s390_tune == PROCESSOR_2097_Z10) + { + if (!PARAM_SET_P (PARAM_MAX_UNROLLED_INSNS)) + set_param_value ("max-unrolled-insns", 100); + if (!PARAM_SET_P (PARAM_MAX_UNROLL_TIMES)) + set_param_value ("max-unroll-times", 32); + if (!PARAM_SET_P (PARAM_MAX_COMPLETELY_PEELED_INSNS)) + set_param_value ("max-completely-peeled-insns", 800); + if (!PARAM_SET_P (PARAM_MAX_COMPLETELY_PEEL_TIMES)) + set_param_value ("max-completely-peel-times", 64); + } + + set_param_value ("max-pending-list-length", 256); } /* Map for smallest class containing reg regno. */ diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 0861a857568..1c6e704c3a3 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -3884,6 +3884,7 @@ find_barrier (int num_mova, rtx mova, rtx from) int si_limit; int hi_limit; rtx orig = from; + rtx last_symoff = NULL_RTX; /* For HImode: range is 510, add 4 because pc counts from address of second instruction after this one, subtract 2 for the jump instruction @@ -4015,6 +4016,16 @@ find_barrier (int num_mova, rtx mova, rtx from) { switch (untangle_mova (&num_mova, &mova, from)) { + case 1: + if (flag_pic) + { + rtx src = SET_SRC (PATTERN (from)); + if (GET_CODE (src) == CONST + && GET_CODE (XEXP (src, 0)) == UNSPEC + && XINT (XEXP (src, 0), 1) == UNSPEC_SYMOFF) + last_symoff = from; + } + break; case 0: return find_barrier (0, 0, mova); case 2: { @@ -4120,6 +4131,12 @@ find_barrier (int num_mova, rtx mova, rtx from) so we'll make one. */ rtx label = gen_label_rtx (); + /* Don't emit a constant table in the middle of insns for + casesi_worker_2. This is a bit overkill but is enough + because casesi_worker_2 wouldn't appear so frequently. */ + if (last_symoff) + from = last_symoff; + /* If we exceeded the range, then we must back up over the last instruction we looked at. Otherwise, we just need to undo the NEXT_INSN at the end of the loop. */ diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 60f08e11e72..d9f8b74c452 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2010-04-29 Release Manager + + * GCC 4.4.4 released. + 2010-03-30 Jason Merrill <jason@redhat.com> PR c++/41185 diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index dcbaeaea54b..417ca57b897 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -7421,6 +7421,9 @@ The maximum number of insns of a completely peeled loop. @item max-completely-peel-times The maximum number of iterations of a loop to be suitable for complete peeling. +@item max-completely-peel-loop-nest-depth +The maximum depth of a loop nest suitable for complete peeling. + @item max-unswitch-insns The maximum number of insns of an unswitched loop. diff --git a/gcc/doc/standards.texi b/gcc/doc/standards.texi index 471ea456e1f..173c4a46c06 100644 --- a/gcc/doc/standards.texi +++ b/gcc/doc/standards.texi @@ -183,7 +183,7 @@ working paper for the C++0x standard; the latest working paper is available on the ISO C++ committee's web site at @uref{http://www.open-std.org/jtc1/sc22/wg21/}. For information regarding the C++0x features available in the experimental C++0x mode, -see @uref{http://gcc.gnu.org/gcc-4.3/cxx0x_status.html}. To select this +see @uref{http://gcc.gnu.org/projects/cxx0x.html}. To select this standard in GCC, use the option @option{-std=c++0x}; to obtain all the diagnostics required by the standard, you should also specify @option{-pedantic} (or @option{-pedantic-errors} if you want them to be diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 5480098e721..e97017fdce9 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,45 @@ +2010-05-14 Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/44135 + * fortran/interface.c (get_sym_storage_size): Use signed instead of + unsigned mpz_get_?i routines. + +2010-05-13 Jakub Jelinek <jakub@redhat.com> + + PR fortran/44036 + * openmp.c (resolve_omp_clauses): Allow procedure pointers in clause + variable lists. + * trans-openmp.c (gfc_omp_privatize_by_reference): Don't privatize + by reference dummy procedures or non-dummy procedure pointers. + (gfc_omp_predetermined_sharing): Return + OMP_CLAUSE_DEFAULT_FIRSTPRIVATE for dummy procedures. + +2010-04-29 Release Manager + + * GCC 4.4.4 released. + +2010-04-21 Jakub Jelinek <jakub@redhat.com> + + PR fortran/43836 + * f95-lang.c (gfc_define_builtin): Set TREE_NOTHROW on + the decl. + +2010-04-20 Harald Anlauf <anlauf@gmx.de> + + * intrinsic.c (sort_actual): Remove 'is' in error message. + +2010-04-20 Jakub Jelinek <jakub@redhat.com> + + PR fortran/43339 + * openmp.c (gfc_resolve_do_iterator): Only make iteration vars for + sequential loops private in the innermost containing task region. + +2010-04-07 Janne Blomqvist <jb@gcc.gnu.org> + + PR fortran/43539 + * gfortran.texi: Add section about representation of + LOGICAL variables. + 2010-03-30 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/43409 diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index b8f2d221801..98dccd929f8 100644 --- a/gcc/fortran/f95-lang.c +++ b/gcc/fortran/f95-lang.c @@ -1,5 +1,5 @@ /* gfortran backend interface - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 Free Software Foundation, Inc. Contributed by Paul Brook. @@ -687,6 +687,7 @@ gfc_define_builtin (const char *name, library_name, NULL_TREE); if (const_p) TREE_READONLY (decl) = 1; + TREE_NOTHROW (decl) = 1; built_in_decls[code] = decl; implicit_built_in_decls[code] = decl; diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi index af1d2961085..0512cb9e6fc 100644 --- a/gcc/fortran/gfortran.texi +++ b/gcc/fortran/gfortran.texi @@ -181,7 +181,7 @@ Part I: Invoking GNU Fortran Part II: Language Reference * Fortran 2003 and 2008 status:: Fortran 2003 and 2008 features supported by GNU Fortran. -* Compiler Characteristics:: KIND type parameters supported. +* Compiler Characteristics:: User-visible implementation details. * Extensions:: Language extensions implemented by GNU Fortran. * Intrinsic Procedures:: Intrinsic procedures supported by GNU Fortran. * Intrinsic Modules:: Intrinsic modules supported by GNU Fortran. @@ -914,14 +914,13 @@ made and you should only use it for experimental purposes. @node Compiler Characteristics @chapter Compiler Characteristics -@c TODO: Formulate this introduction a little more generally once -@c there is more here than KIND type parameters. - -This chapter describes certain characteristics of the GNU Fortran compiler, -namely the KIND type parameter values supported. +This chapter describes certain characteristics of the GNU Fortran +compiler, that are not specified by the Fortran standard, but which +might in some way or another become visible to the programmer. @menu * KIND Type Parameters:: +* Internal representation of LOGICAL variables:: @end menu @@ -965,6 +964,33 @@ imaginary part are a real value of the given size). It is recommended to use the @code{SELECT_*_KIND} intrinsics instead of the concrete values. +@node Internal representation of LOGICAL variables +@section Internal representation of LOGICAL variables +@cindex logical, variable representation + +The Fortran standard does not specify how variables of @code{LOGICAL} +type are represented, beyond requiring that @code{LOGICAL} variables +of default kind have the same storage size as default @code{INTEGER} +and @code{REAL} variables. The GNU Fortran internal representation is +as follows. + +A @code{LOGICAL(KIND=N)} variable is represented as an +@code{INTEGER(KIND=N)} variable, however, with only two permissible +values: @code{1} for @code{.TRUE.} and @code{0} for +@code{.FALSE.}. Any other integer value results in undefined behavior. + +Note that for mixed-language programming using the +@code{ISO_C_BINDING} feature, there is a @code{C_BOOL} kind that can +be used to create @code{LOGICAL(KIND=C_BOOL)} variables which are +interoperable with the C99 _Bool type. The C99 _Bool type has an +internal representation described in the C99 standard, which is +identical to the above description, i.e. with 1 for true and 0 for +false being the only permissible values. Thus the internal +representation of @code{LOGICAL} variables in GNU Fortran is identical +to C99 _Bool, except for a possible difference in storage size +depending on the kind. + + @c --------------------------------------------------------------------- @c Extensions @c --------------------------------------------------------------------- diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 01ca2c773c0..f7ae52108d8 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -1625,8 +1625,8 @@ get_sym_storage_size (gfc_symbol *sym) || sym->as->lower[i]->expr_type != EXPR_CONSTANT) return 0; - elements *= mpz_get_ui (sym->as->upper[i]->value.integer) - - mpz_get_ui (sym->as->lower[i]->value.integer) + 1L; + elements *= mpz_get_si (sym->as->upper[i]->value.integer) + - mpz_get_si (sym->as->lower[i]->value.integer) + 1L; } return strlen*elements; diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c index 0dfc6398fcb..4987e4c84cf 100644 --- a/gcc/fortran/intrinsic.c +++ b/gcc/fortran/intrinsic.c @@ -3105,7 +3105,7 @@ keywords: if (f->actual != NULL) { - gfc_error ("Argument '%s' is appears twice in call to '%s' at %L", + gfc_error ("Argument '%s' appears twice in call to '%s' at %L", f->name, name, where); return FAILURE; } diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index b75a1e844cb..00b365f86ac 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -1,5 +1,5 @@ /* OpenMP directive matching and resolving. - Copyright (C) 2005, 2006, 2007, 2008 + Copyright (C) 2005, 2006, 2007, 2008, 2010 Free Software Foundation, Inc. Contributed by Jakub Jelinek @@ -812,6 +812,8 @@ resolve_omp_clauses (gfc_code *code) if (el) continue; } + if (n->sym->attr.proc_pointer) + continue; } gfc_error ("Object '%s' is not a variable at %L", n->sym->name, &code->loc); @@ -1367,7 +1369,6 @@ gfc_resolve_omp_parallel_blocks (gfc_code *code, gfc_namespace *ns) void gfc_resolve_do_iterator (gfc_code *code, gfc_symbol *sym) { - struct omp_context *ctx; int i = omp_current_do_collapse; gfc_code *c = omp_current_do_code; @@ -1386,21 +1387,21 @@ gfc_resolve_do_iterator (gfc_code *code, gfc_symbol *sym) c = c->block->next; } - for (ctx = omp_current_ctx; ctx; ctx = ctx->previous) - { - if (pointer_set_contains (ctx->sharing_clauses, sym)) - continue; + if (omp_current_ctx == NULL) + return; - if (! pointer_set_insert (ctx->private_iterators, sym)) - { - gfc_omp_clauses *omp_clauses = ctx->code->ext.omp_clauses; - gfc_namelist *p; + if (pointer_set_contains (omp_current_ctx->sharing_clauses, sym)) + return; - p = gfc_get_namelist (); - p->sym = sym; - p->next = omp_clauses->lists[OMP_LIST_PRIVATE]; - omp_clauses->lists[OMP_LIST_PRIVATE] = p; - } + if (! pointer_set_insert (omp_current_ctx->private_iterators, sym)) + { + gfc_omp_clauses *omp_clauses = omp_current_ctx->code->ext.omp_clauses; + gfc_namelist *p; + + p = gfc_get_namelist (); + p->sym = sym; + p->next = omp_clauses->lists[OMP_LIST_PRIVATE]; + omp_clauses->lists[OMP_LIST_PRIVATE] = p; } } diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index e6d8c44de81..bbb0497adff 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -56,7 +56,8 @@ gfc_omp_privatize_by_reference (const_tree decl) if (GFC_POINTER_TYPE_P (type)) return false; - if (!DECL_ARTIFICIAL (decl)) + if (!DECL_ARTIFICIAL (decl) + && TREE_CODE (TREE_TYPE (type)) != FUNCTION_TYPE) return true; /* Some arrays are expanded as DECL_ARTIFICIAL pointers @@ -95,6 +96,15 @@ gfc_omp_predetermined_sharing (tree decl) == NULL) return OMP_CLAUSE_DEFAULT_SHARED; + /* Dummy procedures aren't considered variables by OpenMP, thus are + disallowed in OpenMP clauses. They are represented as PARM_DECLs + in the middle-end, so return OMP_CLAUSE_DEFAULT_FIRSTPRIVATE here + to avoid complaining about their uses with default(none). */ + if (TREE_CODE (decl) == PARM_DECL + && TREE_CODE (TREE_TYPE (decl)) == POINTER_TYPE + && TREE_CODE (TREE_TYPE (TREE_TYPE (decl))) == FUNCTION_TYPE) + return OMP_CLAUSE_DEFAULT_FIRSTPRIVATE; + /* COMMON and EQUIVALENCE decls are shared. They are only referenced through DECL_VALUE_EXPR of the variables contained in them. If those are privatized, they will not be diff --git a/gcc/gimplify.c b/gcc/gimplify.c index e2342c5e078..7600eb560e0 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -74,9 +74,10 @@ enum gimplify_omp_var_data enum omp_region_type { ORT_WORKSHARE = 0, - ORT_TASK = 1, ORT_PARALLEL = 2, - ORT_COMBINED_PARALLEL = 3 + ORT_COMBINED_PARALLEL = 3, + ORT_TASK = 4, + ORT_UNTIED_TASK = 5 }; struct gimplify_omp_ctx @@ -320,7 +321,7 @@ new_omp_context (enum omp_region_type region_type) c->privatized_types = pointer_set_create (); c->location = input_location; c->region_type = region_type; - if (region_type != ORT_TASK) + if ((region_type & ORT_TASK) == 0) c->default_kind = OMP_CLAUSE_DEFAULT_SHARED; else c->default_kind = OMP_CLAUSE_DEFAULT_UNSPECIFIED; @@ -3919,18 +3920,21 @@ gimple_fold_indirect_ref (tree t) /* *(foo *)&fooarray => fooarray[0] */ if (TREE_CODE (optype) == ARRAY_TYPE + && TREE_CODE (TYPE_SIZE (TREE_TYPE (optype))) == INTEGER_CST && useless_type_conversion_p (type, TREE_TYPE (optype))) { tree type_domain = TYPE_DOMAIN (optype); tree min_val = size_zero_node; if (type_domain && TYPE_MIN_VALUE (type_domain)) min_val = TYPE_MIN_VALUE (type_domain); - return build4 (ARRAY_REF, type, op, min_val, NULL_TREE, NULL_TREE); + if (TREE_CODE (min_val) == INTEGER_CST) + return build4 (ARRAY_REF, type, op, min_val, NULL_TREE, NULL_TREE); } } /* *(foo *)fooarrptr => (*fooarrptr)[0] */ if (TREE_CODE (TREE_TYPE (subtype)) == ARRAY_TYPE + && TREE_CODE (TYPE_SIZE (TREE_TYPE (TREE_TYPE (subtype)))) == INTEGER_CST && useless_type_conversion_p (type, TREE_TYPE (TREE_TYPE (subtype)))) { tree type_domain; @@ -3942,7 +3946,8 @@ gimple_fold_indirect_ref (tree t) type_domain = TYPE_DOMAIN (TREE_TYPE (sub)); if (type_domain && TYPE_MIN_VALUE (type_domain)) min_val = TYPE_MIN_VALUE (type_domain); - return build4 (ARRAY_REF, type, sub, min_val, NULL_TREE, NULL_TREE); + if (TREE_CODE (min_val) == INTEGER_CST) + return build4 (ARRAY_REF, type, sub, min_val, NULL_TREE, NULL_TREE); } return NULL_TREE; @@ -5286,6 +5291,32 @@ omp_add_variable (struct gimplify_omp_ctx *ctx, tree decl, unsigned int flags) splay_tree_insert (ctx->variables, (splay_tree_key)decl, flags); } +/* Notice a threadprivate variable DECL used in OpenMP context CTX. + This just prints out diagnostics about threadprivate variable uses + in untied tasks. If DECL2 is non-NULL, prevent this warning + on that variable. */ + +static bool +omp_notice_threadprivate_variable (struct gimplify_omp_ctx *ctx, tree decl, + tree decl2) +{ + splay_tree_node n; + + if (ctx->region_type != ORT_UNTIED_TASK) + return false; + n = splay_tree_lookup (ctx->variables, (splay_tree_key)decl); + if (n == NULL) + { + error ("threadprivate variable %qs used in untied task", + IDENTIFIER_POINTER (DECL_NAME (decl))); + error ("%Henclosing task", &ctx->location); + splay_tree_insert (ctx->variables, (splay_tree_key)decl, 0); + } + if (decl2) + splay_tree_insert (ctx->variables, (splay_tree_key)decl2, 0); + return false; +} + /* Record the fact that DECL was used within the OpenMP context CTX. IN_CODE is true when real code uses DECL, and false when we should merely emit default(none) errors. Return true if DECL is going to @@ -5306,14 +5337,14 @@ omp_notice_variable (struct gimplify_omp_ctx *ctx, tree decl, bool in_code) if (is_global_var (decl)) { if (DECL_THREAD_LOCAL_P (decl)) - return false; + return omp_notice_threadprivate_variable (ctx, decl, NULL_TREE); if (DECL_HAS_VALUE_EXPR_P (decl)) { tree value = get_base_address (DECL_VALUE_EXPR (decl)); if (value && DECL_P (value) && DECL_THREAD_LOCAL_P (value)) - return false; + return omp_notice_threadprivate_variable (ctx, decl, value); } } @@ -5339,8 +5370,11 @@ omp_notice_variable (struct gimplify_omp_ctx *ctx, tree decl, bool in_code) case OMP_CLAUSE_DEFAULT_NONE: error ("%qs not specified in enclosing parallel", IDENTIFIER_POINTER (DECL_NAME (decl))); - error ("%Henclosing parallel", &ctx->location); - /* FALLTHRU */ + if ((ctx->region_type & ORT_TASK) != 0) + error ("%Henclosing task", &ctx->location); + else + error ("%Henclosing parallel", &ctx->location); + /* FALLTHRU */ case OMP_CLAUSE_DEFAULT_SHARED: flags |= GOVD_SHARED; break; @@ -5352,7 +5386,7 @@ omp_notice_variable (struct gimplify_omp_ctx *ctx, tree decl, bool in_code) break; case OMP_CLAUSE_DEFAULT_UNSPECIFIED: /* decl will be either GOVD_FIRSTPRIVATE or GOVD_SHARED. */ - gcc_assert (ctx->region_type == ORT_TASK); + gcc_assert ((ctx->region_type & ORT_TASK) != 0); if (ctx->outer_context) omp_notice_variable (ctx->outer_context, decl, in_code); for (octx = ctx->outer_context; octx; octx = octx->outer_context) @@ -5855,7 +5889,10 @@ gimplify_omp_task (tree *expr_p, gimple_seq *pre_p) gimple_seq body = NULL; struct gimplify_ctx gctx; - gimplify_scan_omp_clauses (&OMP_TASK_CLAUSES (expr), pre_p, ORT_TASK); + gimplify_scan_omp_clauses (&OMP_TASK_CLAUSES (expr), pre_p, + find_omp_clause (OMP_TASK_CLAUSES (expr), + OMP_CLAUSE_UNTIED) + ? ORT_UNTIED_TASK : ORT_TASK); push_gimplify_context (&gctx); diff --git a/gcc/ipa-type-escape.c b/gcc/ipa-type-escape.c index 48d95049b4f..306905370d9 100644 --- a/gcc/ipa-type-escape.c +++ b/gcc/ipa-type-escape.c @@ -1,6 +1,6 @@ /* Type based alias analysis. - Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, - Inc. + Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 + Free Software Foundation, Inc. Contributed by Kenneth Zadeck <zadeck@naturalbridge.com> This file is part of GCC. @@ -1343,7 +1343,8 @@ check_call (gimple call) if (TYPE_ARG_TYPES (TREE_TYPE (callee_t))) { for (arg_type = TYPE_ARG_TYPES (TREE_TYPE (callee_t)), i = 0; - arg_type && TREE_VALUE (arg_type) != void_type_node; + arg_type && TREE_VALUE (arg_type) != void_type_node + && i < gimple_call_num_args (call); arg_type = TREE_CHAIN (arg_type), i++) { tree operand = gimple_call_arg (call, i); @@ -1365,7 +1366,7 @@ check_call (gimple call) have to do this; the front ends should always process the arg list from the TYPE_ARG_LIST. */ for (arg_type = DECL_ARGUMENTS (callee_t), i = 0; - arg_type; + arg_type && i < gimple_call_num_args (call); arg_type = TREE_CHAIN (arg_type), i++) { tree operand = gimple_call_arg (call, i); diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 7de4b92a9c4..596be6cb33f 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,7 @@ +2010-04-29 Release Manager + + * GCC 4.4.4 released. + 2010-01-21 Release Manager * GCC 4.4.3 released. diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 11e26a6d24b..194439631f5 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,7 @@ +2010-04-29 Release Manager + + * GCC 4.4.4 released. + 2010-01-21 Release Manager * GCC 4.4.3 released. diff --git a/gcc/objcp/ChangeLog b/gcc/objcp/ChangeLog index 72d9e12443a..c99450098fd 100644 --- a/gcc/objcp/ChangeLog +++ b/gcc/objcp/ChangeLog @@ -1,3 +1,7 @@ +2010-04-29 Release Manager + + * GCC 4.4.4 released. + 2010-01-21 Release Manager * GCC 4.4.3 released. diff --git a/gcc/omp-low.c b/gcc/omp-low.c index fb5c0e2d44d..e852c3f3dc6 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -1421,10 +1421,6 @@ scan_sharing_clauses (tree clauses, omp_context *ctx) break; case OMP_CLAUSE_COPYPRIVATE: - if (ctx->outer) - scan_omp_op (&OMP_CLAUSE_DECL (c), ctx->outer); - /* FALLTHRU */ - case OMP_CLAUSE_COPYIN: decl = OMP_CLAUSE_DECL (c); by_ref = use_pointer_for_field (decl, NULL); @@ -2671,7 +2667,7 @@ lower_copyprivate_clauses (tree clauses, gimple_seq *slist, gimple_seq *rlist, for (c = clauses; c ; c = OMP_CLAUSE_CHAIN (c)) { - tree var, ref, x; + tree var, new_var, ref, x; bool by_ref; if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_COPYPRIVATE) @@ -2681,17 +2677,27 @@ lower_copyprivate_clauses (tree clauses, gimple_seq *slist, gimple_seq *rlist, by_ref = use_pointer_for_field (var, NULL); ref = build_sender_ref (var, ctx); - x = lookup_decl_in_outer_ctx (var, ctx); - x = by_ref ? build_fold_addr_expr (x) : x; + x = new_var = lookup_decl_in_outer_ctx (var, ctx); + if (by_ref) + { + x = build_fold_addr_expr (new_var); + x = fold_convert (TREE_TYPE (ref), x); + } gimplify_assign (ref, x, slist); - ref = build_receiver_ref (var, by_ref, ctx); + ref = build_receiver_ref (var, false, ctx); + if (by_ref) + { + ref = fold_convert (build_pointer_type (TREE_TYPE (new_var)), ref); + ref = build_fold_indirect_ref (ref); + } if (is_reference (var)) { + ref = fold_convert (TREE_TYPE (new_var), ref); ref = build_fold_indirect_ref (ref); - var = build_fold_indirect_ref (var); + new_var = build_fold_indirect_ref (new_var); } - x = lang_hooks.decls.omp_clause_assign_op (c, var, ref); + x = lang_hooks.decls.omp_clause_assign_op (c, new_var, ref); gimplify_and_add (x, rlist); } } diff --git a/gcc/params.def b/gcc/params.def index 3f7b2e77ed6..22a13759cda 100644 --- a/gcc/params.def +++ b/gcc/params.def @@ -292,6 +292,11 @@ DEFPARAM(PARAM_MAX_ONCE_PEELED_INSNS, "max-once-peeled-insns", "The maximum number of insns of a peeled loop that rolls only once", 400, 0, 0) +/* The maximum depth of a loop nest we completely peel. */ +DEFPARAM(PARAM_MAX_UNROLL_ITERATIONS, + "max-completely-peel-loop-nest-depth", + "The maximum depth of a loop nest we completely peel", + 8, 0, 0) /* The maximum number of insns of an unswitched loop. */ DEFPARAM(PARAM_MAX_UNSWITCH_INSNS, diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog index 78044fcabc7..b121dd43d39 100644 --- a/gcc/po/ChangeLog +++ b/gcc/po/ChangeLog @@ -1,3 +1,7 @@ +2010-04-29 Release Manager + + * GCC 4.4.4 released. + 2010-01-21 Release Manager * GCC 4.4.3 released. diff --git a/gcc/reginfo.c b/gcc/reginfo.c index e579c281aa3..f9340ebb6b0 100644 --- a/gcc/reginfo.c +++ b/gcc/reginfo.c @@ -667,6 +667,8 @@ void reinit_regs (void) { init_regs (); + /* caller_save needs to be re-initialized. */ + caller_save_initialized_p = false; ira_init (); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 05afbfb82f1..3a33d1ac437 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,123 @@ +2010-05-14 Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/44135 + * gfortran.dg/actual_array_interface_2.f90: New test. + +2010-05-13 Jakub Jelinek <jakub@redhat.com> + + PR fortran/44036 + * gfortran.dg/gomp/pr44036-1.f90: New test. + * gfortran.dg/gomp/pr44036-2.f90: New test. + * gfortran.dg/gomp/pr44036-3.f90: New test. + + PR middle-end/44085 + * gcc.dg/gomp/pr44085.c: New test. + * gfortran.dg/gomp/pr44085.f90: New test. + +2010-05-05 Jason Merrill <jason@redhat.com> + + PR debug/43370 + * g++.dg/ext/attrib39.C: New. + +2010-05-04 H.J. Lu <hongjiu.lu@intel.com> + + Backport from mainline + 2010-05-04 H.J. Lu <hongjiu.lu@intel.com> + + PR middle-end/43671 + * gcc.target/i386/pr43671.c: New. + +2010-05-03 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * ada/acats/run_acats (which): New function. + (host_gnatchop, host_gnatmake): Use it. + +2010-04-30 DJ Delorie <dj@redhat.com> + + * gcc.c-torture/execute/20100430-1.c: New test. + +2010-04-29 Release Manager + + * GCC 4.4.4 released. + +2010-04-21 Jakub Jelinek <jakub@redhat.com> + + PR fortran/43836 + * gfortran.dg/gomp/pr43836.f90: New test. + +2010-04-20 Jakub Jelinek <jakub@redhat.com> + + PR fortran/43339 + * gfortran.dg/gomp/sharing-2.f90: Adjust for iteration vars + of sequential loops being private only in the innermost containing + task region. + + PR middle-end/43337 + * gfortran.dg/gomp/pr43337.f90: New test. + +2010-04-19 Jie Zhang <jie@codesourcery.com> + + PR target/43662 + * gcc.target/i386/pr43662.c: New test. + +2010-04-19 Ira Rosen <irar@il.ibm.com> + + PR tree-optimization/43771 + * g++.dg/vect/pr43771.cc: New test. + +2010-04-18 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/rep_clause5.ad[sb]: New test. + * gnat.dg/rep_clause5_pkg.ads: New helper. + +2010-04-12 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/43560 + * gcc.c-torture/execute/pr43560.c: New test. + +2010-04-10 Jie Zhang <jie@codesourcery.com> + + PR target/43417 + * gcc.target/sh/pr43417.c: New test. + +2010-04-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + PR target/43643 + * gcc.dg/pr43643.c: New test. + +2010-04-08 Richard Guenther <rguenther@suse.de> + + PR middle-end/42956 + * gcc.c-torture/compile/pr42956.c: New testcase. + +2010-04-08 Jakub Jelinek <jakub@redhat.com> + + Backport from mainline: + 2010-03-29 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/43560 + * gcc.dg/torture/pr43560.c: New testcase. + + 2010-04-01 Richard Guenther <rguenther@suse.de> + + PR middle-end/43614 + * gcc.c-torture/compile/pr43614.c: New testcase. + +2010-04-08 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/43186 + * gcc.c-torture/compile/pr43186.c: New testcase. + +2010-04-07 H.J. Lu <hongjiu.lu@intel.com> + + PR target/43668 + * gcc.target/i386/pr43668.c: New. + +2010-04-07 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/43629 + * gcc.c-torture/execute/pr43629.c: New testcase. + 2010-04-06 Jakub Jelinek <jakub@redhat.com> * gcc.target/s390/stackcheck1.c: Add dg-warning. @@ -6,7 +126,7 @@ * gcc.target/i386/pr43638.c: New test. 2010-04-01 Janne Blomqvist <jb@gcc.gnu.org> - Dominique d'Humieres <dominiq@lps.ens.fr> + Dominique d'Humieres <dominiq@lps.ens.fr> PR libfortran/43605 * gfortran.dg/ftell_3.f90: Enhance test case by reading more. diff --git a/gcc/testsuite/ada/acats/run_acats b/gcc/testsuite/ada/acats/run_acats index 05f3ff57df5..9a9bdc2a318 100755 --- a/gcc/testsuite/ada/acats/run_acats +++ b/gcc/testsuite/ada/acats/run_acats @@ -5,10 +5,25 @@ if [ "$testdir" = "" ]; then exit 1 fi +# Provide which replacement. +# +# type -p is missing from Solaris 2 /bin/sh and /bin/ksh (ksh88), but both +# ksh93 and bash have it. +# type output format differs between ksh88 and ksh93, so avoid it if +# type -p is present. +# Fall back to whence which ksh88 and ksh93 provide, but bash does not. + +which () { + type -p $* 2>/dev/null && return 0 + type $* 2>/dev/null | awk '{print $3}' && return 0 + whence $* 2>/dev/null && return 0 + return 1 +} + # Set up environment to use the Ada compiler from the object tree -host_gnatchop=`type gnatchop | awk '{print $3}'` -host_gnatmake=`type gnatmake | awk '{print $3}'` +host_gnatchop=`which gnatchop` +host_gnatmake=`which gnatmake` ROOT=`${PWDCMD-pwd}` BASE=`cd $ROOT/../../..; ${PWDCMD-pwd}` diff --git a/gcc/testsuite/g++.dg/ext/attrib39.C b/gcc/testsuite/g++.dg/ext/attrib39.C new file mode 100644 index 00000000000..22a742942cb --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/attrib39.C @@ -0,0 +1,9 @@ +// PR debug/43370 +// { dg-options "-g" } + +int fragile_block(void) { + typedef __attribute__ ((aligned (16))) struct { + int i; + } XmmUint16; + return 0; +} diff --git a/gcc/testsuite/g++.dg/vect/pr43771.cc b/gcc/testsuite/g++.dg/vect/pr43771.cc new file mode 100644 index 00000000000..1a2d09aae93 --- /dev/null +++ b/gcc/testsuite/g++.dg/vect/pr43771.cc @@ -0,0 +1,14 @@ +/* { dg-do compile } */ + +void KWayNodeRefine__(int nparts, int *gpwgts, int *badminpwgt, int +*badmaxpwgt) +{ + int i; + + for (i=0; i<nparts; i+=2) { + badminpwgt[i] = badminpwgt[i+1] = gpwgts[i]+gpwgts[i+1]; + badmaxpwgt[i] = badmaxpwgt[i+1] = gpwgts[i]+gpwgts[i+1]; + } +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog b/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog index 6c3e26c53cf..57d08fe35f4 100644 --- a/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog +++ b/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog @@ -1,3 +1,7 @@ +2010-04-29 Release Manager + + * GCC 4.4.4 released. + 2010-01-21 Release Manager * GCC 4.4.3 released. diff --git a/gcc/testsuite/gcc.c-torture/compile/pr42956.c b/gcc/testsuite/gcc.c-torture/compile/pr42956.c new file mode 100644 index 00000000000..f592d4be4d7 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr42956.c @@ -0,0 +1,33 @@ +typedef const int cint; +typedef struct { +} Bounds; +int ndim_, ncomp_, selectedcomp_, nregions_; +void *voidregion_; +typedef struct { + double diff, err, spread; +} Errors; +typedef const Errors cErrors; +void Split(int iregion, int depth, int xregion) +{ + typedef struct { + double avg, err, spread, chisq; + double xmin[ndim_], xmax[ndim_]; + } Result; + typedef struct region { + Result result[ncomp_]; + } Region; + Errors errors[ncomp_]; + int comp, ireg, xreg; + for( ireg = iregion, xreg = xregion; ireg < nregions_; ireg = xreg++ ) + { + Result *result = ((Region *)voidregion_)[ireg].result; + for( comp = 0; comp < ncomp_; ++comp ) + { + Result *r = &result[comp]; + cErrors *e = &errors[comp]; + double c = e->diff; + if( r->err > 0 ) r->err = r->err*e->err + c; + } + } +} + diff --git a/gcc/testsuite/gcc.c-torture/compile/pr43186.c b/gcc/testsuite/gcc.c-torture/compile/pr43186.c new file mode 100644 index 00000000000..7171e6ac03a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr43186.c @@ -0,0 +1,15 @@ +int n; + +void foo (int i) +{ + int a, b; + + if (!i) + for (a = 1; a < 4; a++) + if (a) + for (b = 1; b < 3; b++) + foo (b); + + n++; +} + diff --git a/gcc/testsuite/gcc.c-torture/compile/pr43614.c b/gcc/testsuite/gcc.c-torture/compile/pr43614.c new file mode 100644 index 00000000000..411b25dac48 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr43614.c @@ -0,0 +1,27 @@ +volatile int g_2[7]; + +void foo (unsigned); + +int main (void) +{ + int i_459 = 0; + int t2818; + int t2819; + volatile char *t2820; + int t2821; + volatile char *t2822; + int *t2823; + unsigned t2824; +LL655: + t2822 = (volatile char *)g_2; + t2821 = i_459; + t2820 = t2822 + t2821; + t2823 = (int *)t2820; + t2824 = *t2823; + foo (t2824); + t2818 = i_459; + t2819 = t2818 + 1; + i_459 = t2819; + goto LL655; +} + diff --git a/gcc/testsuite/gcc.c-torture/execute/20100430-1.c b/gcc/testsuite/gcc.c-torture/execute/20100430-1.c new file mode 100644 index 00000000000..d29c6fa1a37 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20100430-1.c @@ -0,0 +1,51 @@ +/* This used to generate unaligned accesses at -O2 because of IVOPTS. */ + +struct packed_struct +{ + struct packed_struct1 + { + unsigned char cc11; + unsigned char cc12; + } __attribute__ ((packed)) pst1; + struct packed_struct2 + { + unsigned char cc21; + unsigned char cc22; + unsigned short ss[104]; + unsigned char cc23[13]; + } __attribute__ ((packed)) pst2[4]; +} __attribute__ ((packed)); + +typedef struct +{ + int ii; + struct packed_struct buf; +} info_t; + +static unsigned short g; + +static void __attribute__((noinline)) +dummy (unsigned short s) +{ + g = s; +} + +static int +foo (info_t *info) +{ + int i, j; + + for (i = 0; i < info->buf.pst1.cc11; i++) + for (j = 0; j < info->buf.pst2[i].cc22; j++) + dummy (info->buf.pst2[i].ss[j]); + + return 0; +} + +int main(void) +{ + info_t info; + info.buf.pst1.cc11 = 2; + info.buf.pst2[0].cc22 = info.buf.pst2[1].cc22 = 8; + return foo (&info); +} diff --git a/gcc/testsuite/gcc.c-torture/execute/pr43560.c b/gcc/testsuite/gcc.c-torture/execute/pr43560.c new file mode 100644 index 00000000000..cb420c614cc --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr43560.c @@ -0,0 +1,28 @@ +/* PR tree-optimization/43560 */ + +struct S +{ + int a, b; + char c[10]; +}; + +__attribute__ ((noinline)) void +test (struct S *x) +{ + while (x->b > 1 && x->c[x->b - 1] == '/') + { + x->b--; + x->c[x->b] = '\0'; + } +} + +const struct S s = { 0, 0, "" }; + +int +main () +{ + struct S *p; + asm ("" : "=r" (p) : "0" (&s)); + test (p); + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/execute/pr43629.c b/gcc/testsuite/gcc.c-torture/execute/pr43629.c new file mode 100644 index 00000000000..10c0196c89b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr43629.c @@ -0,0 +1,13 @@ +int flag; +extern void abort (void); +int main() +{ + int x; + if (flag) + x = -1; + else + x &= 0xff; + if (x & ~0xff) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/gomp/pr44085.c b/gcc/testsuite/gcc.dg/gomp/pr44085.c new file mode 100644 index 00000000000..55462abe504 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/pr44085.c @@ -0,0 +1,27 @@ +/* PR middle-end/44085 */ +/* { dg-do compile } */ +/* { dg-require-effective-target tls_native } */ +/* { dg-options "-fopenmp" } */ + +int thr1, thr2; +#pragma omp threadprivate (thr1, thr2) + +void +foo (void) +{ +#pragma omp task untied /* { dg-error "enclosing task" } */ + { + thr1++; /* { dg-error "used in untied task" } */ + thr2 |= 4; /* { dg-error "used in untied task" } */ + } +} + +void +bar (void) +{ +#pragma omp task + { + thr1++; + thr2 |= 4; + } +} diff --git a/gcc/testsuite/gcc.dg/pr43643.c b/gcc/testsuite/gcc.dg/pr43643.c new file mode 100644 index 00000000000..7fbbfc255f3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr43643.c @@ -0,0 +1,24 @@ +/* Contributed by Jürgen Keil <jrgn.keil@googlemail.com> */ + +/* { dg-do run } */ +/* { dg-require-profiling "-pg" } */ +/* { dg-options "-O2 -pg" } */ + +extern char *strdup (const char *); + +void +func(char *a, char *b, char *c) +{ + strdup(a); + strdup(b); + strdup(c); +} + +int +main(void) +{ + func("a", "b", "c"); + return 0; +} + +/* { dg-final { cleanup-profile-file } } */ diff --git a/gcc/testsuite/gcc.dg/torture/pr43560.c b/gcc/testsuite/gcc.dg/torture/pr43560.c new file mode 100644 index 00000000000..44abb80b193 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr43560.c @@ -0,0 +1,34 @@ +/* { dg-do run } */ +/* { dg-require-weak "" } */ + +int g_6[1][2] = {{1,1}}; +int g_34 = 0; +int *const g_82 = &g_6[0][1]; +int *g_85[2][1] __attribute__((weak)); + +void __attribute__((noinline)) +func_4 (int x) +{ + int i; + for (i = 0; i <= x; i++) { + if (g_6[0][1]) { + *g_82 = 1; + } else { + int **l_109 = &g_85[1][0]; + if (&g_82 != l_109) { + } else { + *l_109 = &g_6[0][1]; + } + *g_82 = 1; + } + } +} + +int main (void) +{ + g_85[0][0] = &g_34; + g_85[1][0] = &g_34; + func_4(1); + return 0; +} + diff --git a/gcc/testsuite/gcc.target/i386/pr43662.c b/gcc/testsuite/gcc.target/i386/pr43662.c new file mode 100644 index 00000000000..246c8aafa6e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr43662.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2" } */ + +void __attribute__ ((ms_abi)) foo (void) +{ +} + +typedef struct _IAVIStreamImpl +{ + int sInfo; + int has; +} IAVIStreamImpl; + +extern int __attribute__ ((ms_abi)) aso (void *); +extern int sre (void *); + +int AVIFILE_OpenCompressor (IAVIStreamImpl *This) +{ + if (This->has != 0) + aso (&This->has); + sre (&This->sInfo); + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/pr43668.c b/gcc/testsuite/gcc.target/i386/pr43668.c new file mode 100644 index 00000000000..b6c2114fd07 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr43668.c @@ -0,0 +1,10 @@ +/* PR target/43668 */ +/* { dg-do run } */ +/* { dg-options "-fschedule-insns" } */ + +int foo(int i, ...) { + return i; +} +int main() { + return foo(0, 0.0); +} diff --git a/gcc/testsuite/gcc.target/i386/pr43671.c b/gcc/testsuite/gcc.target/i386/pr43671.c new file mode 100644 index 00000000000..958eaff4453 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr43671.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-require-effective-target ilp32 } */ +/* { dg-options "-mtune=i686 -O1 -fpeel-loops -fschedule-insns2 -ftree-vectorize -fsched2-use-superblocks" } */ + +extern void abort (); + +int main () +{ + struct { + char ca[16]; + } s; + int i; + + for (i = 0; i < 16; i++) + { + s.ca[i] = 5; + } + + + for (i = 0; i < 16; i++) + { + if (s.ca[i] != 5) + abort (); + } + + return 0; +} diff --git a/gcc/testsuite/gcc.target/sh/pr43417.c b/gcc/testsuite/gcc.target/sh/pr43417.c new file mode 100644 index 00000000000..081ff46b998 --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/pr43417.c @@ -0,0 +1,36 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -m4" } */ + +int pid_count = 0; +main (int argc, char *argv[]) +{ + unsigned int c; + unsigned long long maxbytes = 0; + extern char *optarg; + int i; + int pid_cntr; + int pid; + int pid_list[1000]; + while ((c = getopt (argc, argv, "c:b:p:wvh")) != (-1)) + { + switch ((char) c) + { + case 'b': + maxbytes = atoll (optarg); + } + } + pid = fork (); + while ((pid != 0) && (maxbytes > 1024 * 1024 * 1024)) + { + maxbytes = maxbytes - (1024 * 1024 * 1024); + pid = fork (); + if (pid != 0) + pid_cntr++; + pid_list[i] = pid; + } + while ((pid_count < pid_cntr)) + { + } + kill (pid_list[i], 9); +} + diff --git a/gcc/testsuite/gfortran.dg/actual_array_interface_2.f90 b/gcc/testsuite/gfortran.dg/actual_array_interface_2.f90 new file mode 100644 index 00000000000..ae429b7d9a9 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/actual_array_interface_2.f90 @@ -0,0 +1,13 @@ +! { dg-do compile } +program gprogram + implicit none + real, dimension(-2:0) :: my_arr + call fill_array(my_arr) + contains + subroutine fill_array(arr) + implicit none + real, dimension(-2:0), intent(out) :: arr + arr = 42 + end subroutine fill_array +end program gprogram + diff --git a/gcc/testsuite/gfortran.dg/gomp/pr43337.f90 b/gcc/testsuite/gfortran.dg/gomp/pr43337.f90 new file mode 100644 index 00000000000..f07ccb441be --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr43337.f90 @@ -0,0 +1,30 @@ +! PR middle-end/43337 +! { dg-do compile } +! { dg-options "-fopenmp -O2 -g" } + +subroutine pr43337 + integer :: a, b(10) + call foo (b) + call bar (b) +contains + subroutine foo (b) + integer :: b(10) +!$omp parallel if (.false.) +!$omp task if (.false.) shared(b) + do a = 1, 10 + b(a) = 1 + end do +!$omp end task +!$omp end parallel + end subroutine foo + subroutine bar (b) + integer :: b(10) +!$omp parallel if (.false.) +!$omp parallel if (.false.) + do a = 1, 10 + b(a) = 1 + end do +!$omp end parallel +!$omp end parallel + end subroutine bar +end subroutine pr43337 diff --git a/gcc/testsuite/gfortran.dg/gomp/pr43836.f90 b/gcc/testsuite/gfortran.dg/gomp/pr43836.f90 new file mode 100644 index 00000000000..cf86523f52b --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr43836.f90 @@ -0,0 +1,10 @@ +! PR fortran/43836 +! { dg-do compile } +! { dg-options "-fopenmp -fexceptions -O2" } +subroutine foo +!$omp single +!$omp parallel + call bar +!$omp end parallel +!$omp end single +end subroutine foo diff --git a/gcc/testsuite/gfortran.dg/gomp/pr44036-1.f90 b/gcc/testsuite/gfortran.dg/gomp/pr44036-1.f90 new file mode 100644 index 00000000000..a4633a3e9c0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr44036-1.f90 @@ -0,0 +1,24 @@ +! PR fortran/44036 +! { dg-do compile } +! { dg-options "-fopenmp" } +subroutine foo(a, b) + integer, external :: a + integer, external, pointer :: b + integer, external :: c + integer, external, pointer :: d + integer :: x + x = 6 +!$omp parallel default(none) private (x) + x = a(4) +!$omp end parallel +!$omp parallel default(none) private (x) ! { dg-error "enclosing parallel" } + x = b(5) ! { dg-error "not specified in" } +!$omp end parallel +!$omp parallel default(none) private (x) + x = c(6) +!$omp end parallel + d => a +!$omp parallel default(none) private (x) ! { dg-error "enclosing parallel" } + x = d(7) ! { dg-error "not specified in" } +!$omp end parallel +end diff --git a/gcc/testsuite/gfortran.dg/gomp/pr44036-2.f90 b/gcc/testsuite/gfortran.dg/gomp/pr44036-2.f90 new file mode 100644 index 00000000000..c9320f13912 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr44036-2.f90 @@ -0,0 +1,17 @@ +! PR fortran/44036 +! { dg-do compile } +! { dg-options "-fopenmp" } +subroutine foo(a, b) + integer, external :: a + integer, external, pointer :: b + integer, external :: c + integer, external, pointer :: d + integer :: x + d => a +!$omp parallel default(none) private (x) firstprivate (b, d) + x = a(4) + x = b(5) + x = c(6) + x = d(7) +!$omp end parallel +end diff --git a/gcc/testsuite/gfortran.dg/gomp/pr44036-3.f90 b/gcc/testsuite/gfortran.dg/gomp/pr44036-3.f90 new file mode 100644 index 00000000000..449cb9572d0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr44036-3.f90 @@ -0,0 +1,13 @@ +! PR fortran/44036 +! { dg-do compile } +! { dg-options "-fopenmp" } +subroutine foo(a) + integer, external :: a, c + integer :: x +!$omp parallel default(none) private (x) shared (a) ! { dg-error "is not a variable" } + x = a(6) +!$omp end parallel +!$omp parallel default(none) private (x) shared (c) ! { dg-error "is not a variable" } + x = c(6) +!$omp end parallel +end diff --git a/gcc/testsuite/gfortran.dg/gomp/pr44085.f90 b/gcc/testsuite/gfortran.dg/gomp/pr44085.f90 new file mode 100644 index 00000000000..db8fbbc9544 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr44085.f90 @@ -0,0 +1,25 @@ +! PR middle-end/44085 +! { dg-do compile } +! { dg-require-effective-target tls_native } +! { dg-options "-fopenmp" } + + integer, save :: thr1, thr2 + integer :: thr3, thr4 + common /thrs/ thr3, thr4 +!$omp threadprivate (thr1, thr2, /thrs/) + +!$omp task untied ! { dg-error "enclosing task" } + thr1 = thr1 + 1 ! { dg-error "used in untied task" } + thr2 = thr2 + 2 ! { dg-error "used in untied task" } + thr3 = thr3 + 3 ! { dg-error "used in untied task" } + thr4 = thr4 + 4 ! { dg-error "used in untied task" } +!$omp end task + +!$omp task + thr1 = thr1 + 1 + thr2 = thr2 + 2 + thr3 = thr3 + 3 + thr4 = thr4 + 4 +!$omp end task + + end diff --git a/gcc/testsuite/gfortran.dg/gomp/sharing-2.f90 b/gcc/testsuite/gfortran.dg/gomp/sharing-2.f90 index aede06c9c0f..b7d7e072975 100644 --- a/gcc/testsuite/gfortran.dg/gomp/sharing-2.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/sharing-2.f90 @@ -28,10 +28,10 @@ end do !$omp end single !$omp end parallel -!$omp parallel default (none) shared (a) - i = 1 - j = 1 - k = 1 +!$omp parallel default (none) shared (a) ! { dg-error "enclosing parallel" } + i = 1 ! { dg-error "not specified in" } + j = 1 ! { dg-error "not specified in" } + k = 1 ! { dg-error "not specified in" } !$omp parallel default (none) shared (a) i = 1 j = 1 @@ -68,8 +68,8 @@ a(i, 1) = i + 1 end do !$omp end parallel -!$omp parallel default (none) shared (a) - i = 1 +!$omp parallel default (none) shared (a) ! { dg-error "enclosing parallel" } + i = 1 ! { dg-error "not specified in" } !$omp parallel default (none) shared (a, i) i = 2 !$omp parallel default (none) shared (a) diff --git a/gcc/testsuite/gnat.dg/rep_clause5.adb b/gcc/testsuite/gnat.dg/rep_clause5.adb new file mode 100644 index 00000000000..7fdf264095a --- /dev/null +++ b/gcc/testsuite/gnat.dg/rep_clause5.adb @@ -0,0 +1,39 @@ +-- { dg-do compile } +-- { dg-options "-O" } + +package body Rep_Clause5 is + + function To_LNumber(S : String) return LNumber_Type is + V : VString; + LV : Long_Type; + LN : LNumber_Type; + begin + LV := To_Long(V, 10); + LN := LNumber_Type(LV); + return LN; + end; + + procedure Merge_Numbered(LNodes : in out LNodes_Ptr) is + T1 : Token_Type; + LNO : LNumber_Type; + begin + for X in LNodes.all'Range loop + T1 := LNodes(X).Line(0); + if T1.Token /= LEX_LF then + declare + S : String := Element(T1.SID); + begin + begin + LNO := To_LNumber(S); + exception + when Bad_Number => + LNO := 0; + when Too_Large => + LNO := 0; + end; + end; + end if; + end loop; + end; + +end Rep_Clause5; diff --git a/gcc/testsuite/gnat.dg/rep_clause5.ads b/gcc/testsuite/gnat.dg/rep_clause5.ads new file mode 100644 index 00000000000..986f893ecbb --- /dev/null +++ b/gcc/testsuite/gnat.dg/rep_clause5.ads @@ -0,0 +1,12 @@ +with Rep_Clause5_Pkg; use Rep_Clause5_Pkg; + +package Rep_Clause5 is + + Bad_Number : exception; + Too_Large : exception; + + type LNumber_Type is range 0..99999; + + procedure Merge_Numbered(LNodes : in out LNodes_Ptr); + +end Rep_Clause5; diff --git a/gcc/testsuite/gnat.dg/rep_clause5_pkg.ads b/gcc/testsuite/gnat.dg/rep_clause5_pkg.ads new file mode 100644 index 00000000000..e3496c4a2b7 --- /dev/null +++ b/gcc/testsuite/gnat.dg/rep_clause5_pkg.ads @@ -0,0 +1,383 @@ +package Rep_Clause5_Pkg is + + type ID_Type is mod 65536; + type String_ID is new ID_Type; + type LNumber_Type is range 0..99999; + subtype Long_Type is Integer; + + type Func_ID is (No_Func, FUN_SGN, FUN_EXP, FUN_LOG, FUN_LOG10); + + type Token_Kind is ( + No_Token, + LEX_BINARY, + LEX_SECTION, + LEX_003, + LEX_004, + LEX_005, + LEX_006, + LEX_007, + LEX_008, + LEX_009, + LEX_LF, + LEX_011, + LEX_012, + LEX_013, + LEX_014, + LEX_015, + LEX_016, + LEX_017, + LEX_018, + LEX_019, + LEX_020, + LEX_021, + LEX_022, + LEX_023, + LEX_024, + LEX_025, + LEX_026, + LEX_027, + LEX_028, + LEX_029, + LEX_030, + LEX_031, + LEX_032, + '!', + '"', + '#', + '$', + '%', + '&', + ''', + '(', + ')', + '*', + '+', + ',', + '-', + '.', + '/', + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + ':', + ';', + '<', + '=', + '>', + '?', + '@', + 'A', + 'B', + 'C', + 'D', + 'E', + 'F', + 'G', + 'H', + 'I', + 'J', + 'K', + 'L', + 'M', + 'N', + 'O', + 'P', + 'Q', + 'R', + 'S', + 'T', + 'U', + 'V', + 'W', + 'X', + 'Y', + 'Z', + '[', + '\', + ']', + '^', + '_', + '`', + 'a', + 'b', + 'c', + 'd', + 'e', + 'f', + 'g', + 'h', + 'i', + 'j', + 'k', + 'l', + 'm', + 'n', + 'o', + LEX_SFUN3, + LEX_SFUN2, + LEX_SFUN1, + LEX_SFUNN, + LEX_FUN3, + LEX_FUN2, + LEX_FUN1, + LEX_FUNN, + 'x', + 'y', + 'z', + '{', + '|', + '}', + '~', + LEX_CRTA, + LEX_ISNULL, + LEX_USING, + LEX_HANDLE, + LEX_CALLX, + LEX_COMPLEX, + LEX_FIXED, + LEX_ENV, + LEX_SPARSE, + LEX_SUBROUTINE, + LEX_CALL, + LEX_BOX, + LEX_VLINE, + LEX_HLINE, + LEX_MAXLENGTH, + LEX_DLENGTH, + LEX_INPUT, + LEX_INITIALIZE, + LEX_OUTPUT, + LEX_UNLINK, + LEX_SEEK, + LEX_EXIT, + LEX_NOT, + LEX_COMMON, + LEX_CHAIN, + LEX_DEF, + LEX_ARITY, + LEX_RESUME, + LEX_PIC_S, + LEX_BG, + LEX_FG, + LEX_PC, + LEX_CRT, + LEX_ENUM, + LEX_DECLARE, + LEX_CURSOR, + LEX_DROP, + LEX_CURRENT, + LEX_ISOLATION, + LEX_SET, + LEX_TRANSACTION, + LEX_COMMIT, + LEX_ABORT, + LEX_BEGIN, + LEX_PREVIOUS, + LEX_LAST, + LEX_FIRST, + LEX_KEY, + LEX_START, + LEX_REWRITE, + LEX_INDEX, + LEX_SECONDARY, + LEX_PRIMARY, + LEX_COLUMN, + LEX_TEMP, + LEX_TABLE, + LEX_CREATE, + LEX_HASH, + LEX_BTREE, + LEX_UPDATE, + LEX_ERROR, + LEX_ACCEPT, + LEX_AVG, + LEX_MAX, + LEX_MIN, + LEX_FIELD, + LEX_RESTORE, + LEX_END, + LEX_STEP, + LEX_NEXT, + LEX_FOR, + LEX_RETURN, + LEX_GOSUB, + LEX_RANGE, + LEX_EXPON, + LEX_XOR, + LEX_OR, + LEX_AND, + LEX_SHIFTR, + LEX_GE, + LEX_NE, + LEX_SHIFTL, + LEX_LE, + LEX_VARYING, + LEX_LENGTH, + LEX_PRINT, + LEX_IF, + LEX_GOTO, + LEX_ON, + LEX_THEN, + LEX_DELETE, + LEX_TO, + LEX_SEQUENCE, + LEX_NONUNIQUE, + LEX_UNIQUE, + LEX_FILE, + LEX_CLOSE, + LEX_OPEN, + LEX_DATABASE, + LEX_RECORD, + LEX_DATA, + LEX_WRITE, + LEX_READ, + LEX_STOP, + LEX_LET, + LEX_MOD, + LEX_LONG, + LEX_DIM, + LEX_SHORT, + LEX_REM, + LEX_SHELL, + LEX_TOKEN, + LEX_FLOAT, + LEX_SIDENT, + LEX_INLREM, + LEX_ENDLIT, + LEX_STRLIT, + LEX_IDENT, + LEX_LNUMBER, + LEX_HEX, + LEX_NUMBER, + LEX_EOF, + LEX_QUIT, + LEX_LIST, + LEX_REMOVE, + LEX_RENUMBER, + LEX_CONTINUE, + LEX_RUN, + LEX_MERGE, + LEX_ENTER, + LEX_NEW, + LEX_RESET, + LEX_SYMTAB, + LEX_CLS, + LEX_EDIT, + LEX_SAVE, + LEX_RESAVE, + LEX_LOAD, + LEX_NAME, + LEX_LISTP, + LEX_SHOW, + LEX_STACK, + LEX_STATUS, + LEX_CACHE, + LEX_INSPECT, + LEX_STOW, + LEX_PKGRUN, + LEX_POP, + LEX_CHECK, + LEX_INSERT, + LEX_INTO, + LEX_VALUES, + LEX_NULL, + LEX_WHERE, + LEX_FROM, + LEX_EXEC, + LEX_SELECT, + LEX_AS, + LEX_ALL, + LEX_BY, + LEX_CROSS, + LEX_DESC, + LEX_FULL, + LEX_GROUP, + LEX_INNER, + LEX_JOIN, + LEX_LEFT, + LEX_LIMIT, + LEX_NATURAL, + LEX_OFFSET, + LEX_ORDER, + LEX_OUTER, + LEX_RIGHT, + LEX_FETCH, + LEX_DISTINCT, + LEX_DEFAULT, + LEX_RETURNING, + LEX_LEVEL, + LEX_COMMITTED, + LEX_SERIALIZABLE, + LEX_ONLY, + LEX_HOLD, + LEX_FORWARD, + LEX_WITH, + LEX_PRIOR, + LEX_RELATIVE, + LEX_BACKWARD, + LEX_OF, + LEX_SCROLL, + LEX_NOWAIT, + LEX_HAVING, + LEX_END_TOKENS + ); + + type Aux_Kind is (No_Aux, SID_Aux, FID_Aux, LNO_Aux); + + type Token_Type(Aux : Aux_Kind := No_Aux) is + record + Token : Token_Kind := No_Token; + case Aux is + when SID_Aux => + SID : String_ID; + when FID_Aux => + FID : Func_ID; + when LNO_Aux => + LNO : LNumber_Type; + when No_Aux => + null; + end case; + end record; + + for Token_Type use + record + Aux at 0 range 0..2; + Token at 0 range 3..12; + SID at 0 range 16..31; + FID at 0 range 16..31; + LNO at 0 range 13..31; + end record; + + type Tokens_Index is range 0..999999; + type Token_Array is array(Tokens_Index range <>) of Token_Type; + type Token_Line is access all Token_Array; + + type Line_Node is + record + Line : Token_Line; + LNO : LNumber_Type := 0; + Numbered : Boolean := False; + end record; + + type Nodes_Index is range 0..999999; + type LNodes_Array is array(Nodes_Index range <>) of Line_Node; + type LNodes_Ptr is access all LNodes_Array; + + type VString is + record + Max_Length : Natural := 0; + Fixed : Boolean := False; + end record; + + function To_Long(Object : VString; Radix : Natural) return Long_Type; + + function Element (V : String_ID) return String; + +end Rep_Clause5_Pkg; diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c index 8f9fec58cf6..9f52fc52c74 100644 --- a/gcc/tree-nested.c +++ b/gcc/tree-nested.c @@ -1,5 +1,6 @@ /* Nested function decomposition for GIMPLE. - Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 + Free Software Foundation, Inc. This file is part of GCC. @@ -1040,7 +1041,8 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi) { bitmap_set_bit (new_suppress, DECL_UID (decl)); OMP_CLAUSE_DECL (clause) = get_nonlocal_debug_decl (info, decl); - need_chain = true; + if (OMP_CLAUSE_CODE (clause) != OMP_CLAUSE_PRIVATE) + need_chain = true; } break; diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 6149ff551f9..b693ddd178d 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -2933,6 +2933,12 @@ bitfield_overlaps_p (tree blen, tree bpos, struct sra_elt *fld, else gcc_unreachable (); + if (CONTAINS_PLACEHOLDER_P (flen)) + flen = size_binop (MULT_EXPR, + fold_convert (bitsizetype, + lang_hooks.types.max_size (fld->type)), + bitsize_unit_node); + gcc_assert (host_integerp (blen, 1) && host_integerp (bpos, 1) && host_integerp (flen, 1) diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c index db5afa50a1c..1084c78ed0f 100644 --- a/gcc/tree-ssa-address.c +++ b/gcc/tree-ssa-address.c @@ -769,6 +769,8 @@ copy_mem_ref_info (tree to, tree from) /* And the info about the original reference. */ TMR_ORIGINAL (to) = TMR_ORIGINAL (from); + TREE_SIDE_EFFECTS (to) = TREE_SIDE_EFFECTS (from); + TREE_THIS_VOLATILE (to) = TREE_THIS_VOLATILE (from); } /* Move constants in target_mem_ref REF to offset. Returns the new target diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 4b978e0c7af..c46ddb6bad5 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -505,6 +505,7 @@ likely_value (gimple stmt) bool has_constant_operand, has_undefined_operand, all_undefined_operands; tree use; ssa_op_iter iter; + unsigned i; enum gimple_code code = gimple_code (stmt); @@ -559,6 +560,22 @@ likely_value (gimple stmt) has_constant_operand = true; } + /* There may be constants in regular rhs operands. For calls we + have to ignore lhs, fndecl and static chain, otherwise only + the lhs. */ + for (i = (is_gimple_call (stmt) ? 2 : 0) + gimple_has_lhs (stmt); + i < gimple_num_ops (stmt); ++i) + { + tree op = gimple_op (stmt, i); + if (!op || TREE_CODE (op) == SSA_NAME) + continue; + if (is_gimple_min_invariant (op)) + has_constant_operand = true; + } + + if (has_constant_operand) + all_undefined_operands = false; + /* If the operation combines operands like COMPLEX_EXPR make sure to not mark the result UNDEFINED if only one part of the result is undefined. */ diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c index 65c0b0d0b6f..eecb6206f45 100644 --- a/gcc/tree-ssa-loop-im.c +++ b/gcc/tree-ssa-loop-im.c @@ -1887,16 +1887,22 @@ hoist_memory_references (struct loop *loop, bitmap mem_refs, } } -/* Returns true if REF is always accessed in LOOP. */ +/* Returns true if REF is always accessed in LOOP. If STORED_P is true + make sure REF is always stored to in LOOP. */ static bool -ref_always_accessed_p (struct loop *loop, mem_ref_p ref) +ref_always_accessed_p (struct loop *loop, mem_ref_p ref, bool stored_p) { VEC (mem_ref_loc_p, heap) *locs = NULL; unsigned i; mem_ref_loc_p loc; bool ret = false; struct loop *must_exec; + tree base; + + base = get_base_address (ref->mem); + if (INDIRECT_REF_P (base)) + base = TREE_OPERAND (base, 0); get_all_locs_in_loop (loop, ref, &locs); for (i = 0; VEC_iterate (mem_ref_loc_p, locs, i, loc); i++) @@ -1904,6 +1910,22 @@ ref_always_accessed_p (struct loop *loop, mem_ref_p ref) if (!get_lim_data (loc->stmt)) continue; + /* If we require an always executed store make sure the statement + stores to the reference. */ + if (stored_p) + { + tree lhs; + if (!gimple_get_lhs (loc->stmt)) + continue; + lhs = get_base_address (gimple_get_lhs (loc->stmt)); + if (!lhs) + continue; + if (INDIRECT_REF_P (lhs)) + lhs = TREE_OPERAND (lhs, 0); + if (lhs != base) + continue; + } + must_exec = get_lim_data (loc->stmt)->always_executed_in; if (!must_exec) continue; @@ -2041,6 +2063,8 @@ ref_indep_loop_p (struct loop *loop, mem_ref_p ref) static bool can_sm_ref_p (struct loop *loop, mem_ref_p ref) { + tree base; + /* Unless the reference is stored in the loop, there is nothing to do. */ if (!bitmap_bit_p (ref->stored, loop->num)) return false; @@ -2051,9 +2075,14 @@ can_sm_ref_p (struct loop *loop, mem_ref_p ref) || !for_each_index (&ref->mem, may_move_till, loop)) return false; - /* If it can trap, it must be always executed in LOOP. */ - if (tree_could_trap_p (ref->mem) - && !ref_always_accessed_p (loop, ref)) + /* If it can trap, it must be always executed in LOOP. + Readonly memory locations may trap when storing to them, but + tree_could_trap_p is a predicate for rvalues, so check that + explicitly. */ + base = get_base_address (ref->mem); + if ((tree_could_trap_p (ref->mem) + || (DECL_P (base) && TREE_READONLY (base))) + && !ref_always_accessed_p (loop, ref, true)) return false; /* And it must be independent on all other memory references diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c index e278c55b08b..edac10ef8a0 100644 --- a/gcc/tree-ssa-loop-ivcanon.c +++ b/gcc/tree-ssa-loop-ivcanon.c @@ -352,6 +352,7 @@ tree_unroll_loops_completely (bool may_increase_size, bool unroll_outer) struct loop *loop; bool changed; enum unroll_level ul; + int iteration = 0; do { @@ -384,7 +385,8 @@ tree_unroll_loops_completely (bool may_increase_size, bool unroll_outer) scev_reset (); } } - while (changed); + while (changed + && ++iteration <= PARAM_VALUE (PARAM_MAX_UNROLL_ITERATIONS)); return 0; } diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 8e23e21b111..1586e7dfcf8 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -1525,16 +1525,18 @@ may_be_unaligned_p (tree ref, tree step) if (mode != BLKmode) { - double_int mul; - tree al = build_int_cst (TREE_TYPE (step), - GET_MODE_ALIGNMENT (mode) / BITS_PER_UNIT); + unsigned mode_align = GET_MODE_ALIGNMENT (mode); - if (base_align < GET_MODE_ALIGNMENT (mode) - || bitpos % GET_MODE_ALIGNMENT (mode) != 0 - || bitpos % BITS_PER_UNIT != 0) + if (base_align < mode_align + || (bitpos % mode_align) != 0 + || (bitpos % BITS_PER_UNIT) != 0) return true; - - if (!constant_multiple_of (step, al, &mul)) + + if (toffset + && (highest_pow2_factor (toffset) * BITS_PER_UNIT) < mode_align) + return true; + + if ((highest_pow2_factor (step) * BITS_PER_UNIT) < mode_align) return true; } @@ -1674,7 +1676,11 @@ find_interesting_uses_address (struct ivopts_data *data, gimple stmt, tree *op_p while (handled_component_p (*ref)) ref = &TREE_OPERAND (*ref, 0); if (TREE_CODE (*ref) == INDIRECT_REF) - *ref = fold_indirect_ref (*ref); + { + tree tem = gimple_fold_indirect_ref (TREE_OPERAND (*ref, 0)); + if (tem) + *ref = tem; + } } } @@ -5329,6 +5335,8 @@ copy_ref_info (tree new_ref, tree old_ref) { TMR_ORIGINAL (new_ref) = unshare_and_remove_ssa_names (old_ref); TMR_TAG (new_ref) = get_ref_tag (old_ref, TMR_ORIGINAL (new_ref)); + TREE_SIDE_EFFECTS (new_ref) = TREE_SIDE_EFFECTS (old_ref); + TREE_THIS_VOLATILE (new_ref) = TREE_THIS_VOLATILE (old_ref); } } diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index a762f5f9b75..512c58921be 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -1606,6 +1606,9 @@ get_tmr_operands (gimple stmt, tree expr, int flags) /* Mark the statement as having memory operands. */ gimple_set_references_memory (stmt, true); + if (TREE_THIS_VOLATILE (expr)) + gimple_set_has_volatile_ops (stmt, true); + /* First record the real operands. */ get_expr_operands (stmt, &TMR_BASE (expr), opf_use); get_expr_operands (stmt, &TMR_INDEX (expr), opf_use); diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c index 8bc9de4a6bf..8174851b729 100644 --- a/gcc/tree-vect-analyze.c +++ b/gcc/tree-vect-analyze.c @@ -3260,6 +3260,10 @@ vect_supported_load_permutation_p (slp_instance slp_instn, int group_size, SET_BIT (load_index, prev); } + for (j = 0; j < group_size; j++) + if (!TEST_BIT (load_index, j)) + return false; + sbitmap_free (load_index); if (supported && i == group_size * group_size diff --git a/gcc/tree.c b/gcc/tree.c index ec560c86773..35bed1302d0 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -3450,7 +3450,11 @@ build7_stat (enum tree_code code, tree tt, tree arg0, tree arg1, PROCESS_ARG(6); TREE_SIDE_EFFECTS (t) = side_effects; - TREE_THIS_VOLATILE (t) = 0; + if (code == TARGET_MEM_REF) + TREE_SIDE_EFFECTS (t) = (arg5 && TREE_SIDE_EFFECTS (arg5)); + TREE_THIS_VOLATILE (t) + = (code == TARGET_MEM_REF + && arg5 && TREE_THIS_VOLATILE (arg5)); return t; } |