diff options
author | Ulrich Weigand <Ulrich.Weigand@de.ibm.com> | 2010-02-16 16:59:29 +0000 |
---|---|---|
committer | Ulrich Weigand <Ulrich.Weigand@de.ibm.com> | 2010-02-16 16:59:29 +0000 |
commit | 07aa2628c0107577843a47fef6ae3458781242a1 (patch) | |
tree | e41d2b7f8d8fc5a2931a10d764074109cd79000c | |
parent | 93b413205a37a51a4ac0359577b02e63bc005f1e (diff) |
Merge with gcc-4_3-branch up to revision 156795.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/cell-4_3-branch@156810 138bc75d-0d04-0410-961f-82ee72b054a4
58 files changed, 1430 insertions, 234 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6b8bb8da5e7..e1acf6202df 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,156 @@ +2010-02-16 Paolo Bonzini <bonzini@gnu.org> + + PR rtl-optimization/41917 + * rtlanal.c (num_sign_bit_copies1) <case UMOD>: If sign bit of second + operand isn't known to be 0, return 1. + +2010-02-04 Richard Guenther <rguenther@suse.de> + + PR rtl-optimization/42952 + * dse.c (const_or_frame_p): Remove MEM handling. + +2010-01-31 Eric Botcazou <ebotcazou@adacore.com> + + PR middle-end/42898 + Backport from mainline: + 2009-04-23 Eric Botcazou <ebotcazou@adacore.com> + + * gimplify.c (gimplify_modify_expr_rhs) <VAR_DECL>: Do not do a direct + assignment from the constructor either if the target is volatile. + +2010-01-31 Richard Guenther <rguenther@suse.de> + + PR middle-end/42898 + * gimplify.c (gimplify_init_constructor): For volatile LHS + initialize a temporary. + +2010-01-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * config/sparc/sparc.c (sparc_elf_asm_named_section): Test for + HAVE_GNU_AS value. + * config/sparc/sysv4.h [HAVE_GNU_AS] (TARGET_ASM_NAMED_SECTION): + Test for HAVE_GNU_AS value. + +2010-01-25 Christian Bruel <christian.bruel@st.com> + + PR target/42841 + * config/sh/sh.c (find_barrier): Increase length for non delayed + conditional branches. + (sh_insn_length_adjustment): Use JUMP_TABLE_DATA_P. + +2010-01-24 David S. Miller <davem@davemloft.net> + + * config/sparc/sysv4.h (TARGET_ASM_NAMED_SECTION): Only + define if not using GAS. + * config/sparc/sparc.c (sparc_elf_asm_named_section): + Likewise. Delete SECTION_MERGE code, which is only applicable + when using GAS. + +2010-01-21 Felyza Wishbringer <fwishbringer@gmail.com> + + PR bootstrap/42786 + * config.gcc (i[34567]86-*-*): Fix handling of athlon64 and athlon-fx + cpu types. Add support for *-sse3 cpu types. + (x86_64-*-*): Ditto. + +2010-01-20 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/41826 + * tree-ssa-structalias.c (get_constraint_for_ptr_offset): Avoid + access to re-allocated vector fields. + +2010-01-18 Uros Bizjak <ubizjak@gmail.com> + + PR target/42774 + * config/alpha/predicates.md (aligned_memory_operand): Return 0 for + memory references with unaligned offsets. Remove CQImode handling. + (unaligned_memory_operand): Return 1 for memory references with + unaligned offsets. Remove CQImode handling. + +2010-01-17 H.J. Lu <hongjiu.lu@intel.com> + + Backport from mainline: + 2010-01-13 Steve Ellcey <sje@cup.hp.com> + + PR target/42542 + * config/ia64/ia64.c (ia64_expand_vecint_compare): Convert GTU to GT + for V2SI by subtracting (-(INT MAX) - 1) from both operands to make + them signed. + +2010-01-07 H.J. Lu <hongjiu.lu@intel.com> + + Backport from mainline + 2010-01-05 Paolo Bonzini <bonzini@gnu.org> + H.J. Lu <hongjiu.lu@intel.com> + + PR target/42542 + * config/i386/i386.c (ix86_expand_int_vcond): Convert GTU to GT + for V4SI and V2DI by subtracting (-(INT MAX) - 1) from both + operands to make them signed. + +2010-01-07 Uros Bizjak <ubizjak@gmail.com> + + * ifcvt.c (if_convert): Output slim multiple dumps with TDF_SLIM. + + PR target/42511 + * ifcvt.c (dead_or_predicable): Also remove REG_EQUAL note when + note itself is not function_invariant_p. + +2010-01-05 Eric Botcazou <ebotcazou@adacore.com> + + PR target/42564 + * config/sparc/sparc.h (SPARC_SYMBOL_REF_TLS_P): Delete. + * config/sparc/sparc-protos.h (legitimize_pic_address): Likewise. + (legitimize_tls_address): Likewise. + (sparc_tls_referenced_p): Likewise. + * config/sparc/sparc.c (sparc_expand_move): Use legitimize_tls_address + and adjust calls to legitimize_pic_address. + (legitimate_constant_p) Use sparc_tls_referenced_p. + (legitimate_pic_operand_p): Likewise. + (sparc_legitimate_address_p): Do not use SPARC_SYMBOL_REF_TLS_P. + (sparc_tls_symbol_ref_1): Delete. + (sparc_tls_referenced_p): Make static, recognize specific patterns. + (legitimize_tls_address): Make static, handle CONST patterns. + (legitimize_pic_address): Make static, remove unused parameter and + adjust recursive calls. + (sparc_legitimize_address): Make static, use sparc_tls_referenced_p + and adjust call to legitimize_pic_address. + (sparc_output_mi_thunk): Likewise. + +2010-01-02 Uros Bizjak <ubizjak@gmail.com> + + PR target/42448 + * config/alpha/predicates.md (aligned_memory_operand): Return false + for CQImode. + (unaligned_memory_operand): Return true for CQImode. + * config/alpha/alpha.c (get_aligned_mem): Assert that location + doesn not cross aligned SImode word boundary. + +2009-12-30 Ian Lance Taylor <iant@google.com> + + PR middle-end/42099 + * expmed.c (expand_divmod): Don't shift HOST_WIDE_INT value more + than HOST_BITS_PER_WIDE_INT. + +2009-12-30 Uros Bizjak <ubizjak@gmail.com> + + PR target/42549 + * config/i386/mmx.md (*mmx_subv2sf3): Fix insn operand number for + alternative 1. + +2009-12-07 Uros Bizjak <ubizjak@gmail.com> + + * config/i386/i386.md (*iorqi_ext_2): Fix insn mnemonic typo. + +2009-11-23 Uros Bizjak <ubizjak@gmail.com> + + PR target/42113 + * config/alpha/alpha.md (*cmp_sadd_si): Change mode + of scratch register to SImode. + (*cmp_sadd_sidi): Ditto. + (*cmp_ssub_si): Ditto. + (*cmp_ssub_sidi): Ditto. + 2009-11-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> * config/spu/spu.c (get_pic_reg): Use LAST_ARG_REGNUM as PIC diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index dd4e4bf8461..553ae2cbf52 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20091117 +20100216 diff --git a/gcc/config.gcc b/gcc/config.gcc index f65d4bac516..baafe67fa47 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1165,14 +1165,14 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu) # FIXME: -m64 for i[34567]86-*-* should be allowed just # like -m32 for x86_64-*-*. case X"${with_cpu}" in - Xgeneric|Xcore2|Xnocona|Xx86-64|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx) + Xgeneric|Xcore2|Xnocona|Xx86-64|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3) ;; X) with_cpu=generic ;; *) echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2 - echo "generic core2 nocona x86-64 amdfam10 barcelona k8 opteron athlon64 athlon-fx" 1>&2 + echo "generic core2 nocona x86-64 amdfam10 barcelona k8 opteron athlon64 athlon-fx athlon64-sse3 k8-sse3 opteron-sse3" 1>&2 exit 1 ;; esac @@ -1297,14 +1297,14 @@ i[34567]86-*-solaris2*) # FIXME: -m64 for i[34567]86-*-* should be allowed just # like -m32 for x86_64-*-*. case X"${with_cpu}" in - Xgeneric|Xcore2|Xnocona|Xx86-64|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx) + Xgeneric|Xcore2|Xnocona|Xx86-64|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx|Xathlon64-sse3|Xk8-sse3|Xopteron-sse3) ;; X) with_cpu=generic ;; *) echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2 - echo "generic core2 nocona x86-64 amdfam10 barcelona k8 opteron athlon64 athlon-fx" 1>&2 + echo "generic core2 nocona x86-64 amdfam10 barcelona k8 opteron athlon64 athlon-fx athlon64-sse3 k8-sse3 opteron-sse3" 1>&2 exit 1 ;; esac @@ -2708,7 +2708,10 @@ if test x$with_cpu = x ; then amdfam10-*|barcelona-*) with_cpu=amdfam10 ;; - k8-*|opteron-*|athlon_64-*) + k8_sse3-*|opteron_sse3-*|athlon64_sse3-*) + with_cpu=k8-sse3 + ;; + k8-*|opteron-*|athlon64-*|athlon_fx-*) with_cpu=k8 ;; athlon_xp-*|athlon_mp-*|athlon_4-*) @@ -2754,7 +2757,10 @@ if test x$with_cpu = x ; then amdfam10-*|barcelona-*) with_cpu=amdfam10 ;; - k8-*|opteron-*|athlon_64-*) + k8_sse3-*|opteron_sse3-*|athlon64_sse3-*) + with_cpu=k8-sse3 + ;; + k8-*|opteron-*|athlon64-*|athlon_fx-*) with_cpu=k8 ;; nocona-*) @@ -3036,7 +3042,7 @@ case "${target}" in esac # OK ;; - "" | amdfam10 | barcelona | k8 | opteron | athlon64 | athlon-fx | nocona | core2 | generic) + "" | amdfam10 | barcelona | k8-sse3 | opteron-sse3 | athlon64-sse3 | k8 | opteron | athlon64 | athlon-fx | nocona | core2 | generic) # OK ;; *) diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 3faeb0745fb..06a6a27b24c 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -1456,6 +1456,10 @@ get_aligned_mem (rtx ref, rtx *paligned_mem, rtx *pbitnum) else offset = disp & 3; + /* The location should not cross aligned word boundary. */ + gcc_assert (offset + GET_MODE_SIZE (GET_MODE (ref)) + <= GET_MODE_SIZE (SImode)); + /* Access the entire aligned word. */ *paligned_mem = widen_memory_access (ref, SImode, -offset); diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md index 831a6983b66..72a8f2f2685 100644 --- a/gcc/config/alpha/alpha.md +++ b/gcc/config/alpha/alpha.md @@ -4349,7 +4349,7 @@ (match_dup 4)))] { if (can_create_pseudo_p ()) - operands[5] = gen_reg_rtx (DImode); + operands[5] = gen_reg_rtx (SImode); else if (reg_overlap_mentioned_p (operands[5], operands[4])) operands[5] = operands[0]; }) @@ -4375,9 +4375,9 @@ (match_dup 4))))] { if (can_create_pseudo_p ()) - operands[5] = gen_reg_rtx (DImode); + operands[5] = gen_reg_rtx (SImode); else if (reg_overlap_mentioned_p (operands[5], operands[4])) - operands[5] = operands[0]; + operands[5] = gen_lowpart (SImode, operands[0]); }) (define_insn_and_split "*cmp_ssub_di" @@ -4425,7 +4425,7 @@ (match_dup 4)))] { if (can_create_pseudo_p ()) - operands[5] = gen_reg_rtx (DImode); + operands[5] = gen_reg_rtx (SImode); else if (reg_overlap_mentioned_p (operands[5], operands[4])) operands[5] = operands[0]; }) @@ -4451,9 +4451,9 @@ (match_dup 4))))] { if (can_create_pseudo_p ()) - operands[5] = gen_reg_rtx (DImode); + operands[5] = gen_reg_rtx (SImode); else if (reg_overlap_mentioned_p (operands[5], operands[4])) - operands[5] = operands[0]; + operands[5] = gen_lowpart (SImode, operands[0]); }) ;; Here are the CALL and unconditional branch insns. Calls on NT and OSF diff --git a/gcc/config/alpha/predicates.md b/gcc/config/alpha/predicates.md index e8379e73dc0..476a89d0769 100644 --- a/gcc/config/alpha/predicates.md +++ b/gcc/config/alpha/predicates.md @@ -439,9 +439,11 @@ (match_code "mem")) { rtx base; + int offset; if (MEM_ALIGN (op) >= 32) return 1; + op = XEXP (op, 0); /* LEGITIMIZE_RELOAD_ADDRESS creates (plus (plus reg const_hi) const_lo) @@ -449,14 +451,29 @@ if (reload_in_progress && GET_CODE (op) == PLUS && GET_CODE (XEXP (op, 0)) == PLUS) - base = XEXP (XEXP (op, 0), 0); + { + base = XEXP (XEXP (op, 0), 0); + offset = INTVAL (XEXP (op, 1)); + } else { if (! memory_address_p (mode, op)) return 0; - base = (GET_CODE (op) == PLUS ? XEXP (op, 0) : op); + if (GET_CODE (op) == PLUS) + { + base = XEXP (op, 0); + offset = INTVAL (XEXP (op, 1)); + } + else + { + base = op; + offset = 0; + } } + if (offset % GET_MODE_SIZE (mode)) + return 0; + return (GET_CODE (base) == REG && REGNO_POINTER_ALIGN (REGNO (base)) >= 32); }) @@ -467,9 +484,11 @@ (match_code "mem")) { rtx base; + int offset; if (MEM_ALIGN (op) >= 32) return 0; + op = XEXP (op, 0); /* LEGITIMIZE_RELOAD_ADDRESS creates (plus (plus reg const_hi) const_lo) @@ -477,14 +496,29 @@ if (reload_in_progress && GET_CODE (op) == PLUS && GET_CODE (XEXP (op, 0)) == PLUS) - base = XEXP (XEXP (op, 0), 0); + { + base = XEXP (XEXP (op, 0), 0); + offset = INTVAL (XEXP (op, 1)); + } else { if (! memory_address_p (mode, op)) return 0; - base = (GET_CODE (op) == PLUS ? XEXP (op, 0) : op); + if (GET_CODE (op) == PLUS) + { + base = XEXP (op, 0); + offset = INTVAL (XEXP (op, 1)); + } + else + { + base = op; + offset = 0; + } } + if (offset % GET_MODE_SIZE (mode)) + return 1; + return (GET_CODE (base) == REG && REGNO_POINTER_ALIGN (REGNO (base)) < 32); }) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index d9f9b8cd3e4..25336d95c90 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -13418,28 +13418,22 @@ ix86_expand_int_vcond (rtx operands[]) case V2DImode: { rtx t1, t2, mask; + rtx (*gen_sub3) (rtx, rtx, rtx); - /* Perform a parallel modulo subtraction. */ - t1 = gen_reg_rtx (mode); - emit_insn ((mode == V4SImode - ? gen_subv4si3 - : gen_subv2di3) (t1, cop0, cop1)); - - /* Extract the original sign bit of op0. */ + /* Subtract (-(INT MAX) - 1) from both operands to make + them signed. */ mask = ix86_build_signbit_mask (GET_MODE_INNER (mode), true, false); - t2 = gen_reg_rtx (mode); - emit_insn ((mode == V4SImode - ? gen_andv4si3 - : gen_andv2di3) (t2, cop0, mask)); + gen_sub3 = (mode == V4SImode + ? gen_subv4si3 : gen_subv2di3); + t1 = gen_reg_rtx (mode); + emit_insn (gen_sub3 (t1, cop0, mask)); - /* XOR it back into the result of the subtraction. This results - in the sign bit set iff we saw unsigned underflow. */ - x = gen_reg_rtx (mode); - emit_insn ((mode == V4SImode - ? gen_xorv4si3 - : gen_xorv2di3) (x, t1, t2)); + t2 = gen_reg_rtx (mode); + emit_insn (gen_sub3 (t2, cop1, mask)); + cop0 = t1; + cop1 = t2; code = GT; } break; @@ -13451,6 +13445,8 @@ ix86_expand_int_vcond (rtx operands[]) emit_insn (gen_rtx_SET (VOIDmode, x, gen_rtx_US_MINUS (mode, cop0, cop1))); + cop0 = x; + cop1 = CONST0_RTX (mode); code = EQ; negate = !negate; break; @@ -13458,9 +13454,6 @@ ix86_expand_int_vcond (rtx operands[]) default: gcc_unreachable (); } - - cop0 = x; - cop1 = CONST0_RTX (mode); } x = ix86_expand_sse_cmp (operands[0], code, cop0, cop1, diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 6d571726aac..8370b810c05 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -9532,7 +9532,7 @@ (const_int 8)))) (clobber (reg:CC FLAGS_REG))] "(!TARGET_PARTIAL_REG_STALL || optimize_size)" - "ior{b}\t{%h2, %h0|%h0, %h2}" + "or{b}\t{%h2, %h0|%h0, %h2}" [(set_attr "type" "alu") (set_attr "length_immediate" "0") (set_attr "mode" "QI")]) diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index 3f8bfe71d30..60d0e08cba2 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -226,7 +226,7 @@ "TARGET_3DNOW && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "@ pfsub\\t{%2, %0|%0, %2} - pfsubr\\t{%2, %0|%0, %2}" + pfsubr\\t{%1, %0|%0, %1}" [(set_attr "type" "mmxadd") (set_attr "mode" "V2SF")]) diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 4fad4bcaf39..ae5e761cfb3 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -1593,25 +1593,18 @@ ia64_expand_vecint_compare (enum rtx_code code, enum machine_mode mode, { rtx t1, t2, mask; - /* Perform a parallel modulo subtraction. */ - t1 = gen_reg_rtx (V2SImode); - emit_insn (gen_subv2si3 (t1, op0, op1)); - - /* Extract the original sign bit of op0. */ - mask = GEN_INT (-0x80000000); + /* Subtract (-(INT MAX) - 1) from both operands to make + them signed. */ + mask = GEN_INT (0x80000000); mask = gen_rtx_CONST_VECTOR (V2SImode, gen_rtvec (2, mask, mask)); - mask = force_reg (V2SImode, mask); - t2 = gen_reg_rtx (V2SImode); - emit_insn (gen_andv2si3 (t2, op0, mask)); - - /* XOR it back into the result of the subtraction. This results - in the sign bit set iff we saw unsigned underflow. */ - x = gen_reg_rtx (V2SImode); - emit_insn (gen_xorv2si3 (x, t1, t2)); - + mask = force_reg (mode, mask); + t1 = gen_reg_rtx (mode); + emit_insn (gen_subv2si3 (t1, op0, mask)); + t2 = gen_reg_rtx (mode); + emit_insn (gen_subv2si3 (t2, op1, mask)); + op0 = t1; + op1 = t2; code = GT; - op0 = x; - op1 = CONST0_RTX (mode); } break; diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index fa54872eff2..2db614209a4 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -4020,6 +4020,13 @@ find_barrier (int num_mova, rtx mova, rtx from) && ! TARGET_SMALLCODE) new_align = 4; + /* There is a possibility that a bf is transformed into a bf/s by the + delay slot scheduler. */ + if (JUMP_P (from) && !JUMP_TABLE_DATA_P (from) + && get_attr_type (from) == TYPE_CBRANCH + && GET_CODE (PATTERN (NEXT_INSN (PREV_INSN (from)))) != SEQUENCE) + inc += 2; + if (found_si) { count_si += inc; @@ -8451,9 +8458,7 @@ sh_insn_length_adjustment (rtx insn) && GET_CODE (PATTERN (insn)) != USE && GET_CODE (PATTERN (insn)) != CLOBBER) || GET_CODE (insn) == CALL_INSN - || (GET_CODE (insn) == JUMP_INSN - && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC - && GET_CODE (PATTERN (insn)) != ADDR_VEC)) + || (JUMP_P (insn) && !JUMP_TABLE_DATA_P (insn))) && GET_CODE (PATTERN (NEXT_INSN (PREV_INSN (insn)))) != SEQUENCE && get_attr_needs_delay_slot (insn) == NEEDS_DELAY_SLOT_YES) return 2; @@ -8461,9 +8466,7 @@ sh_insn_length_adjustment (rtx insn) /* SH2e has a bug that prevents the use of annulled branches, so if the delay slot is not filled, we'll have to put a NOP in it. */ if (sh_cpu == CPU_SH2E - && GET_CODE (insn) == JUMP_INSN - && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC - && GET_CODE (PATTERN (insn)) != ADDR_VEC + && JUMP_P (insn) && !JUMP_TABLE_DATA_P (insn) && get_attr_type (insn) == TYPE_CBRANCH && GET_CODE (PATTERN (NEXT_INSN (PREV_INSN (insn)))) != SEQUENCE) return 2; diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h index 7c56925c01d..48d3263a446 100644 --- a/gcc/config/sparc/sparc-protos.h +++ b/gcc/config/sparc/sparc-protos.h @@ -68,8 +68,6 @@ extern bool legitimate_constant_p (rtx); extern bool constant_address_p (rtx); extern bool legitimate_pic_operand_p (rtx); extern int legitimate_address_p (enum machine_mode, rtx, int); -extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx); -extern rtx legitimize_tls_address (rtx); extern rtx legitimize_address (rtx, rtx, enum machine_mode); extern void sparc_emit_call_insn (rtx, rtx); extern void sparc_defer_case_vector (rtx, rtx, int); @@ -101,7 +99,6 @@ extern int emit_move_sequence (rtx, enum machine_mode); extern int fp_sethi_p (rtx); extern int fp_mov_p (rtx); extern int fp_high_losum_p (rtx); -extern bool sparc_tls_referenced_p (rtx); extern int mem_min_alignment (rtx, int); extern int pic_address_needs_scratch (rtx); extern int reg_unused_after (rtx, rtx); diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 4fc3cd21998..37f38acdc52 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -1,6 +1,6 @@ /* Subroutines for insn-output.c for SPARC. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) 64-bit SPARC-V9 support by Michael Tiemann, Jim Wilson, and Doug Evans, @@ -371,7 +371,7 @@ static int save_or_restore_regs (int, int, rtx, int, int); static void emit_save_or_restore_regs (int); static void sparc_asm_function_prologue (FILE *, HOST_WIDE_INT); static void sparc_asm_function_epilogue (FILE *, HOST_WIDE_INT); -#ifdef OBJECT_FORMAT_ELF +#if defined (OBJECT_FORMAT_ELF) && !HAVE_GNU_AS static void sparc_elf_asm_named_section (const char *, unsigned int, tree); #endif @@ -412,6 +412,9 @@ static bool sparc_strict_argument_naming (CUMULATIVE_ARGS *); static void sparc_va_start (tree, rtx); static tree sparc_gimplify_va_arg (tree, tree, tree *, tree *); static bool sparc_vector_mode_supported_p (enum machine_mode); +static bool sparc_tls_referenced_p (rtx); +static rtx legitimize_tls_address (rtx); +static rtx legitimize_pic_address (rtx, rtx); static bool sparc_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, const_tree, bool); static int sparc_arg_partial_bytes (CUMULATIVE_ARGS *, @@ -986,34 +989,17 @@ sparc_expand_move (enum machine_mode mode, rtx *operands) /* Fixup TLS cases. */ if (TARGET_HAVE_TLS && CONSTANT_P (operands[1]) - && GET_CODE (operands[1]) != HIGH && sparc_tls_referenced_p (operands [1])) { - rtx sym = operands[1]; - rtx addend = NULL; - - if (GET_CODE (sym) == CONST && GET_CODE (XEXP (sym, 0)) == PLUS) - { - addend = XEXP (XEXP (sym, 0), 1); - sym = XEXP (XEXP (sym, 0), 0); - } - - gcc_assert (SPARC_SYMBOL_REF_TLS_P (sym)); - - sym = legitimize_tls_address (sym); - if (addend) - { - sym = gen_rtx_PLUS (mode, sym, addend); - sym = force_operand (sym, operands[0]); - } - operands[1] = sym; + operands[1] = legitimize_tls_address (operands[1]); + return false; } - + /* Fixup PIC cases. */ if (flag_pic && CONSTANT_P (operands[1])) { if (pic_address_needs_scratch (operands[1])) - operands[1] = legitimize_pic_address (operands[1], mode, 0); + operands[1] = legitimize_pic_address (operands[1], NULL_RTX); /* VxWorks does not impose a fixed gap between segments; the run-time gap can be different from the object-file gap. We therefore can't @@ -1041,10 +1027,8 @@ sparc_expand_move (enum machine_mode mode, rtx *operands) if (symbolic_operand (operands[1], mode)) { operands[1] = legitimize_pic_address (operands[1], - mode, - (reload_in_progress ? - operands[0] : - NULL_RTX)); + reload_in_progress + ? operands[0] : NULL_RTX); return false; } } @@ -2846,23 +2830,11 @@ pic_address_needs_scratch (rtx x) bool legitimate_constant_p (rtx x) { - rtx inner; - switch (GET_CODE (x)) { - case SYMBOL_REF: - /* TLS symbols are not constant. */ - if (SYMBOL_REF_TLS_MODEL (x)) - return false; - break; - case CONST: - inner = XEXP (x, 0); - - /* Offsets of TLS symbols are never valid. - Discourage CSE from creating them. */ - if (GET_CODE (inner) == PLUS - && SPARC_SYMBOL_REF_TLS_P (XEXP (inner, 0))) + case SYMBOL_REF: + if (sparc_tls_referenced_p (x)) return false; break; @@ -2929,10 +2901,7 @@ legitimate_pic_operand_p (rtx x) { if (pic_address_needs_scratch (x)) return false; - if (SPARC_SYMBOL_REF_TLS_P (x) - || (GET_CODE (x) == CONST - && GET_CODE (XEXP (x, 0)) == PLUS - && SPARC_SYMBOL_REF_TLS_P (XEXP (XEXP (x, 0), 0)))) + if (sparc_tls_referenced_p (x)) return false; return true; } @@ -2970,7 +2939,7 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) && GET_CODE (rs2) != SUBREG && GET_CODE (rs2) != LO_SUM && GET_CODE (rs2) != MEM - && ! SPARC_SYMBOL_REF_TLS_P (rs2) + && !(GET_CODE (rs2) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (rs2)) && (! symbolic_operand (rs2, VOIDmode) || mode == Pmode) && (GET_CODE (rs2) != CONST_INT || SMALL_INT (rs2))) || ((REG_P (rs1) @@ -3010,7 +2979,8 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) rs2 = NULL; imm1 = XEXP (rs1, 1); rs1 = XEXP (rs1, 0); - if (! CONSTANT_P (imm1) || SPARC_SYMBOL_REF_TLS_P (rs1)) + if (!CONSTANT_P (imm1) + || (GET_CODE (rs1) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (rs1))) return 0; } } @@ -3019,7 +2989,8 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) rs1 = XEXP (addr, 0); imm1 = XEXP (addr, 1); - if (! CONSTANT_P (imm1) || SPARC_SYMBOL_REF_TLS_P (rs1)) + if (!CONSTANT_P (imm1) + || (GET_CODE (rs1) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (rs1))) return 0; /* We can't allow TFmode in 32-bit mode, because an offset greater @@ -3095,29 +3066,28 @@ sparc_tls_got (void) return temp; } -/* Return 1 if *X is a thread-local symbol. */ - -static int -sparc_tls_symbol_ref_1 (rtx *x, void *data ATTRIBUTE_UNUSED) -{ - return SPARC_SYMBOL_REF_TLS_P (*x); -} - -/* Return 1 if X contains a thread-local symbol. */ +/* Return true if X contains a thread-local symbol. */ -bool +static bool sparc_tls_referenced_p (rtx x) { if (!TARGET_HAVE_TLS) return false; - return for_each_rtx (&x, &sparc_tls_symbol_ref_1, 0); + if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS) + x = XEXP (XEXP (x, 0), 0); + + if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x)) + return true; + + /* That's all we handle in legitimize_tls_address for now. */ + return false; } /* ADDR contains a thread-local SYMBOL_REF. Generate code to compute this (thread-local) address. */ -rtx +static rtx legitimize_tls_address (rtx addr) { rtx temp1, temp2, temp3, ret, o0, got, insn; @@ -3241,21 +3211,34 @@ legitimize_tls_address (rtx addr) gcc_unreachable (); } + else if (GET_CODE (addr) == CONST) + { + rtx base, offset; + + gcc_assert (GET_CODE (XEXP (addr, 0)) == PLUS); + + base = legitimize_tls_address (XEXP (XEXP (addr, 0), 0)); + offset = XEXP (XEXP (addr, 0), 1); + + base = force_operand (base, NULL_RTX); + if (!(GET_CODE (offset) == CONST_INT && SMALL_INT (offset))) + offset = force_reg (Pmode, offset); + ret = gen_rtx_PLUS (Pmode, base, offset); + } + else gcc_unreachable (); /* for now ... */ return ret; } - /* Legitimize PIC addresses. If the address is already position-independent, we return ORIG. Newly generated position-independent addresses go into a reg. This is REG if nonzero, otherwise we allocate register(s) as necessary. */ -rtx -legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED, - rtx reg) +static rtx +legitimize_pic_address (rtx orig, rtx reg) { if (GET_CODE (orig) == SYMBOL_REF /* See the comment in sparc_expand_move. */ @@ -3322,9 +3305,9 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED, } gcc_assert (GET_CODE (XEXP (orig, 0)) == PLUS); - base = legitimize_pic_address (XEXP (XEXP (orig, 0), 0), Pmode, reg); - offset = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode, - base == reg ? 0 : reg); + base = legitimize_pic_address (XEXP (XEXP (orig, 0), 0), reg); + offset = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), + base == reg ? NULL_RTX : reg); if (GET_CODE (offset) == CONST_INT) { @@ -3376,10 +3359,10 @@ legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, enum machine_mode mode) if (x != orig_x && legitimate_address_p (mode, x, FALSE)) return x; - if (SPARC_SYMBOL_REF_TLS_P (x)) + if (sparc_tls_referenced_p (x)) x = legitimize_tls_address (x); else if (flag_pic) - x = legitimize_pic_address (x, mode, 0); + x = legitimize_pic_address (x, NULL_RTX); else if (GET_CODE (x) == PLUS && CONSTANT_ADDRESS_P (XEXP (x, 1))) x = gen_rtx_PLUS (Pmode, XEXP (x, 0), copy_to_mode_reg (Pmode, XEXP (x, 1))); @@ -3388,8 +3371,9 @@ legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, enum machine_mode mode) copy_to_mode_reg (Pmode, XEXP (x, 0))); else if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == CONST - || GET_CODE (x) == LABEL_REF) + || GET_CODE (x) == LABEL_REF) x = copy_to_suggested_reg (x, NULL_RTX, Pmode); + return x; } @@ -7802,19 +7786,11 @@ sparc_profile_hook (int labelno) emit_library_call (fun, LCT_NORMAL, VOIDmode, 1, lab, Pmode); } -#ifdef OBJECT_FORMAT_ELF +#if defined (OBJECT_FORMAT_ELF) && !HAVE_GNU_AS static void sparc_elf_asm_named_section (const char *name, unsigned int flags, tree decl) { - if (flags & SECTION_MERGE) - { - /* entsize cannot be expressed in this section attributes - encoding style. */ - default_elf_asm_named_section (name, flags, decl); - return; - } - fprintf (asm_out_file, "\t.section\t\"%s\"", name); if (!(flags & SECTION_DEBUG)) @@ -8762,7 +8738,7 @@ sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, /* Delay emitting the PIC helper function because it needs to change the section and we are emitting assembly code. */ load_pic_register (true); /* clobbers %o7 */ - scratch = legitimize_pic_address (funexp, Pmode, scratch); + scratch = legitimize_pic_address (funexp, scratch); seq = get_insns (); end_sequence (); emit_and_preserve (seq, spill_reg, spill_reg2); diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index 8899437cb78..198fee57d84 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -2380,9 +2380,6 @@ extern int sparc_indent_opcode; } \ } while (0) -#define SPARC_SYMBOL_REF_TLS_P(RTX) \ - (GET_CODE (RTX) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (RTX) != 0) - #define PRINT_OPERAND_PUNCT_VALID_P(CHAR) \ ((CHAR) == '#' || (CHAR) == '*' || (CHAR) == '(' \ || (CHAR) == ')' || (CHAR) == '_' || (CHAR) == '&') diff --git a/gcc/config/sparc/sysv4.h b/gcc/config/sparc/sysv4.h index 1c60debf850..9adf4a7bdc8 100644 --- a/gcc/config/sparc/sysv4.h +++ b/gcc/config/sparc/sysv4.h @@ -1,5 +1,5 @@ /* Target definitions for GNU compiler for SPARC running System V.4 - Copyright (C) 1991, 1992, 1995, 1996, 1997, 1998, 2000, 2002, 2007 + Copyright (C) 1991, 1992, 1995, 1996, 1997, 1998, 2000, 2002, 2007, 2010 Free Software Foundation, Inc. Contributed by Ron Guilmette (rfg@monkeys.com). @@ -126,9 +126,11 @@ do { ASM_OUTPUT_ALIGN ((FILE), Pmode == SImode ? 2 : 3); \ #undef DTORS_SECTION_ASM_OP #define DTORS_SECTION_ASM_OP "\t.section\t\".dtors\",#alloc,#write" +#if !HAVE_GNU_AS /* Switch into a generic section. */ #undef TARGET_ASM_NAMED_SECTION #define TARGET_ASM_NAMED_SECTION sparc_elf_asm_named_section +#endif #undef ASM_OUTPUT_ALIGNED_BSS #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ diff --git a/gcc/dse.c b/gcc/dse.c index a6de40b51d1..9cd2948c4ab 100644 --- a/gcc/dse.c +++ b/gcc/dse.c @@ -964,9 +964,6 @@ const_or_frame_p (rtx x) { switch (GET_CODE (x)) { - case MEM: - return MEM_READONLY_P (x); - case CONST: case CONST_INT: case CONST_DOUBLE: diff --git a/gcc/expmed.c b/gcc/expmed.c index dc61de73ee2..c1233aacb5a 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -4136,7 +4136,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, else if (d == -1) quotient = expand_unop (compute_mode, neg_optab, op0, tquotient, 0); - else if (abs_d == (unsigned HOST_WIDE_INT) 1 << (size - 1)) + else if (HOST_BITS_PER_WIDE_INT >= size + && abs_d == (unsigned HOST_WIDE_INT) 1 << (size - 1)) { /* This case is not handled correctly below. */ quotient = emit_store_flag (tquotient, EQ, op0, op1, diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 2bf213c24e7..897c185c143 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -3314,6 +3314,21 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p, } } + /* If the target is volatile and we have non-zero elements + initialize the target from a temporary. */ + if (TREE_THIS_VOLATILE (object) + && !TREE_ADDRESSABLE (type) + && num_nonzero_elements > 0) + { + tree temp = create_tmp_var (TYPE_MAIN_VARIANT (type), NULL); + TREE_OPERAND (*expr_p, 0) = temp; + *expr_p = build2 (COMPOUND_EXPR, TREE_TYPE (*expr_p), + *expr_p, + build2 (MODIFY_EXPR, void_type_node, + object, temp)); + return GS_OK; + } + if (notify_temp_creation) return GS_OK; @@ -3551,11 +3566,14 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p, tree *pre_p, switch (TREE_CODE (*from_p)) { case VAR_DECL: - /* If we're assigning from a constant constructor, move the - constructor expression to the RHS of the MODIFY_EXPR. */ + /* If we're assigning from a read-only variable initialized with + a constructor, do the direct assignment from the constructor, + but only if neither source nor target are volatile since this + latter assignment might end up being done on a per-field basis. */ if (DECL_INITIAL (*from_p) && TREE_READONLY (*from_p) && !TREE_THIS_VOLATILE (*from_p) + && !TREE_THIS_VOLATILE (*to_p) && TREE_CODE (DECL_INITIAL (*from_p)) == CONSTRUCTOR) { tree old_from = *from_p; diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index d95462a95f3..fe39cf9d79d 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -4843,7 +4843,8 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb, if (! note) continue; set = single_set (insn); - if (!set || !function_invariant_p (SET_SRC (set))) + if (!set || !function_invariant_p (SET_SRC (set)) + || !function_invariant_p (XEXP (note, 0))) remove_note (insn, note); } while (insn != end && (insn = NEXT_INSN (insn))); @@ -4948,7 +4949,12 @@ if_convert (void) #ifdef IFCVT_MULTIPLE_DUMPS if (dump_file && cond_exec_changed_p) - print_rtl_with_bb (dump_file, get_insns ()); + { + if (dump_flags & TDF_SLIM) + print_rtl_slim_with_bb (dump_file, get_insns (), dump_flags); + else + print_rtl_with_bb (dump_file, get_insns ()); + } #endif if (aggressive_cmov && cond_exec_changed_p) { diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index ae9e0c3546c..3b02627f0ea 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -4449,8 +4449,16 @@ num_sign_bit_copies1 (const_rtx x, enum machine_mode mode, const_rtx known_x, known_x, known_mode, known_ret); case UMOD: - /* The result must be <= the second operand. */ - return cached_num_sign_bit_copies (XEXP (x, 1), mode, + /* The result must be <= the second operand. If the second operand + has (or just might have) the high bit set, we know nothing about + the number of sign bit copies. */ + if (bitwidth > HOST_BITS_PER_WIDE_INT) + return 1; + else if ((nonzero_bits (XEXP (x, 1), mode) + & ((HOST_WIDE_INT) 1 << (bitwidth - 1))) != 0) + return 1; + else + return cached_num_sign_bit_copies (XEXP (x, 1), mode, known_x, known_mode, known_ret); case DIV: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 077763691d7..82618ad8a29 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,94 @@ +2010-02-16 Paolo Bonzini <bonzini@gnu.org> + + * gcc.c-torture/execute/pr41917.c: New test. + +2010-02-04 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libfortran/42901 + * gfortran.dg/namelist_60.f90: New test. + * gfortran.dg/namelist_59.f90: New test. + * gcc/testsuite/gfortran.dg/namelist_47.f90: Update test. + * gcc/testsuite/gfortran.dg/namelist_40.f90: Update test. + +2010-02-04 Richard Guenther <rguenther@suse.de> + + PR rtl-optimization/42952 + * gcc.dg/torture/pr42952.c: New testcase. + +2010-01-31 Eric Botcazou <ebotcazou@adacore.com> + + PR middle-end/42898 + * gcc.dg/torture/pr42898-2.c: New test. + +2010-01-31 Richard Guenther <rguenther@suse.de> + + * gcc.dg/torture/pr42898.c: Skip -O0. + +2010-01-31 Richard Guenther <rguenther@suse.de> + + PR middle-end/42898 + * gcc.dg/torture/pr42898.c: New testcase. + +2010-01-18 Uros Bizjak <ubizjak@gmail.com> + + PR target/42774 + * gcc.target/alpha/pr42774.c: New test. + +2010-01-17 H.J. Lu <hongjiu.lu@intel.com> + + Backport from mainline: + 2010-01-13 Steve Ellcey <sje@cup.hp.com> + + PR target/42542 + * gcc.target/ia64/pr42542-1.c: New. + * gcc.target/ia64/pr42542-2.c: New. + * gcc.target/ia64/pr42542-3.c: New. + +2010-01-07 H.J. Lu <hongjiu.lu@intel.com> + + Backport from mainline + 2010-01-05 H.J. Lu <hongjiu.lu@intel.com> + + PR target/42542 + * gcc.target/i386/pr42542-1.c: New. + * gcc.target/i386/pr42542-1a.c: Likewise. + * gcc.target/i386/pr42542-1b.c: Likewise. + * gcc.target/i386/pr42542-2.c: Likewise. + * gcc.target/i386/pr42542-2a.c: Likewise. + * gcc.target/i386/pr42542-2b.c: Likewise. + * gcc.target/i386/pr42542-3.c: Likewise. + * gcc.target/i386/pr42542-3a.c: Likewise. + +2010-01-05 Eric Botcazou <ebotcazou@adacore.com> + + * gcc.dg/tls/opt-15.c: New test. + +2009-12-30 Ian Lance Taylor <iant@google.com> + + PR middle-end/42099 + * gcc.c-torture/execute/20091229-1.c: New test. + +2009-12-30 Uros Bizjak <ubizjak@gmail.com> + + PR target/42549 + * gcc.target/i386/mmx-3dnow-check.h: New file. + * gcc.target/i386/pr42549.c: New test. + +2009-12-23 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR libfortran/PR42422 + * gfortran.dg/list_read_10.f90: New test. + +2009-11-23 Uros Bizjak <ubizjak@gmail.com> + + PR target/42113 + * gcc.target/alpha/pr42113.c: New test. + +2009-11-20 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libgfortran/42090 + * gfortran.dg/direct_io_11.f90: New test. + 2009-11-13 Jason Merrill <jason@redhat.com> PR c++/21008, DR 515 @@ -6621,7 +6712,7 @@ PR c++/30659 * g++.dg/template/crash71.C: New. -2007-10-28 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-28 Tobias Schl�ter <tobi@gcc.gnu.org> PR fortran/32147 * gfortran.dg/module_md5_1.f90: Update hash-value. @@ -7080,7 +7171,7 @@ * gfortran.dg/bounds_check_10.f90: Fix testcase. -2007-10-13 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-13 Tobias Schl�ter <tobi@gcc.gnu.org> Paul Thomas <pault@gcc.gnu.org> PR fortran/33254 @@ -7222,7 +7313,7 @@ PR tree-optimization/33572 * g++.dg/torture/pr33572.C: Replace with complete test. -2007-10-08 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-08 Tobias Schl�ter <tobi@gcc.gnu.org> PR fortran/33689 * gfortran.dg/spec_expr_5.f90: New. @@ -7254,7 +7345,7 @@ PR libfortran/33683 * gfortran.dg/gamma_5.f90: New test case -2007-10-07 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-07 Tobias Schl�ter <tobi@gcc.gnu.org> PR fortran/20851 * initialization_1.f90: Fix dg-error annotations. @@ -7291,7 +7382,7 @@ PR tree-optimization/33572 * g++.dg/torture/pr33572.C: New. -2007-10-06 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-06 Tobias Schl�ter <tobi@gcc.gnu.org> PR fortran/25076 * gfortran.dg/forall_11.f90: New. @@ -7351,7 +7442,7 @@ PR tree-optimization/33627 * g++.dg/torture/pr33627.C: New testcase. -2007-10-04 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-04 Tobias Schl�ter <tobi@gcc.gnu.org> PR fortran/33626 * gfortran.dg/parens_6.f90: New. @@ -7391,7 +7482,7 @@ * gfortran.dg/default_format_1.f90: XFAIL on ppc-darwin. * gfortran.dg/default_format_2.f90: XFAIL on ppc-darwin. -2007-10-03 Tobias Schlüter <tobi@gcc.gnu.org> +2007-10-03 Tobias Schl�ter <tobi@gcc.gnu.org> PR fortran/33198 * gfortran.dg/common_errors_1.f90: New. @@ -7512,7 +7603,7 @@ * gcc.target/i386/sse5-convert.c: Fix target selector and rename to... * gcc.target/i386/pr33524.c: ...this. -2007-09-28 Tobias Schlüter <tobi@gcc.gnu.org> +2007-09-28 Tobias Schl�ter <tobi@gcc.gnu.org> PR fortran/33354 * gfortran.dg/minmaxloc_4.f90: New. @@ -7554,7 +7645,7 @@ PR middle-end/7003 * gcc.target/powerpc/gcse-1.c: New test. -2007-09-27 Tobias Schlüter <tobi@gcc.gnu.org> +2007-09-27 Tobias Schl�ter <tobi@gcc.gnu.org> * gfortran.dg/array_initializer_3.f90: Adapt error annotations for fixed capitalizations. @@ -7656,7 +7747,7 @@ PR c++/14688 * g++.dg/inherit/override_attribs.C: New file. -2007-09-23 Tobias Schlüter <tobi@gcc.gnu.org> +2007-09-23 Tobias Schl�ter <tobi@gcc.gnu.org> PR fortran/33269 * io.c (check_format_string): Move NULL and constant checks into @@ -8082,7 +8173,7 @@ * gcc.dg/sibcall-4.c: As for gcc.dg/sibcall-3.c. * gcc.dg/tree-ssa/ssa-fre-3.c: Require !mips64. -2007-09-20 Tobias Schlüter <tobi@gcc.gnu.org> +2007-09-20 Tobias Schl�ter <tobi@gcc.gnu.org> * gfortran.dg/g77/19981216-0.f: Remove dg-warning annotation. * gfortran.dg/io_constraints_1.f90: Make a -std=f95 test. Add @@ -9254,7 +9345,7 @@ * gcc.target/cris/builtin_clz_v0.c: New testcase. * gcc.target/cris/builtin_clz_v3.c: New testcase. -2007-09-02 Tobias Schlüuter <tobi@gcc.gnu.org> +2007-09-02 Tobias Schl�uter <tobi@gcc.gnu.org> * gfortran.dg/substr_6.f90: New test. @@ -10918,7 +11009,7 @@ PR fortran/30814 * gfortran.dg/pack_bounds_1.f90: New test case. -2007-07-23 Daniel Franke <franke.daniel@gmail.com> +2007-07-23 �Daniel Franke �<franke.daniel@gmail.com> PR fortran/31639 * gfortran.dg/initialization_9.f90: New test. @@ -11471,7 +11562,7 @@ * gcc.target/m68k/interrupt_thread-2.c: Likewise. * gcc.target/m68k/interrupt_thread-3.c: Likewise. -2007-07-12 Daniel Franke <franke.daniel@gmail.com> +2007-07-12 �Daniel Franke �<franke.daniel@gmail.com> PR fortran/31639 * gfortran.dg/func_decl_4.f90: New test. @@ -13003,7 +13094,7 @@ * gcc.dg/tree-ssa/prefetch-6.c: New test. -2007-05-29 Tobias Schlüter <tobi@gcc.gnu.org> +2007-05-29 Tobias Schl�ter <tobi@gcc.gnu.org> * gfortran.dg/sizeof.f90: New. @@ -13836,7 +13927,7 @@ PR tree-optimization/31885 * gcc.dg/tree-ssa/loop-29.c: New test. -2007-05-10 Dominique d'Humières <dominiq@lps.ens.fr> +2007-05-10 Dominique d'Humi�res <dominiq@lps.ens.fr> * assumed_dummy_1.f90: Fix dg directive. * char_initialiser_actual.f90: Likewise. @@ -14510,7 +14601,7 @@ * gcc.dg/cpp/_Pragma6.c: Skip on fido-*-* and m68k-*-*. -2007-04-17 Tobias Schlüter <tobi@gcc.gnu.org> +2007-04-17 Tobias Schl�ter <tobi@gcc.gnu.org> PR fortran/31144 * gfortran.dg/module_naming_1.f90: New. @@ -14613,7 +14704,7 @@ PR fortran/31550 * gfortran.dg/used_types_16.f90: New test. -2007-04-13 Tobias Schlüter <tobi@gcc.gnu.org> +2007-04-13 Tobias Schl�ter <tobi@gcc.gnu.org> PR fortran/18937 * gfortran.dg/goto_2.f90: New. @@ -14643,7 +14734,7 @@ * gfortran.dg/c_by_val.c: Use GCC extensions instead of including <complex.h>. -2007-04-12 Tobias Schlüter <tobi@gcc.gnu.org> +2007-04-12 Tobias Schl�ter <tobi@gcc.gnu.org> PR fortran/31250 * gfortran.dg/char_length_2.f90: New. @@ -15211,7 +15302,7 @@ PR fortran/31193 * gfortran.dg/transfer_array_intrinsic_3.f90: New test. -2007-03-22 Tobias Schlüter <tobi@gcc.gnu.org> +2007-03-22 Tobias Schl�ter <tobi@gcc.gnu.org> PR fortran/20897 * gfortran.dg/derived_name_1.f90: New. @@ -16375,7 +16466,7 @@ * gcc.target/ia64/builtin-popcount-1.c: New test case. * gcc.target/ia64/builtin-popcount-2.c: Likewise. -2007-02-11 Tobias Schlüter <tobi@gcc.gnu.org> +2007-02-11 Tobias Schl�ter <tobi@gcc.gnu.org> PR fortran/30478 * gfortran.dg/enum_4.f90: Update error message checks. @@ -17629,7 +17720,7 @@ PR target/29248 * gcc.dg/rs6000-leaf.c: New. -2006-12-20 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-12-20 Tobias Schl�ter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/25392 * gfortran.dg/f2c_8.f90: New test. @@ -17952,7 +18043,7 @@ * gcc.c-torture/compile/vector-2.c: New test. * gcc.c-torture/compile/vector-3.c: New test. -2006-12-12 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-12-12 Tobias Schl�ter <tobias.schlueter@physik.uni-muenchen.de> * lib/fortran-torture.exp: Update copyright years. Remove obsolete comment. Test -ftree-vectorize where it makes sense. @@ -21748,7 +21839,7 @@ * gnat.dg/string_slice.adb: New test. -2006-07-01 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-07-01 Tobias Schl�ter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/19259 * gfortran.dg/semicolon_fixed.c: New. @@ -23027,7 +23118,7 @@ PR tree-optimization/27409 * gcc.dg/torture/pr27409.c: New testcase. -2006-05-07 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-05-07 Tobias Schl�ter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/27457 * gfortran.dg/select_6.f90: New. @@ -24576,7 +24667,7 @@ PR fortran/25045 * optional_dim.f90: New test. -2006-02-14 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-02-14 Tobias Schl�ter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/26277 * gfortran.dg/label_4.f90: New. @@ -24666,7 +24757,7 @@ gfortran.dg/null_1.f90: New test. -2006-02-10 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-02-10 Tobias Schl�ter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/14771 * gfortran.dg/parens_4.f90: New. @@ -24676,7 +24767,7 @@ * gcc.dg/pr23372-1.c: Remove empty file. -2006-02-09 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-02-09 Tobias Schl�ter <tobias.schlueter@physik.uni-muenchen.de> Paul Thomas <pault@gcc.gnu.org> PR fortran/14771 @@ -24770,7 +24861,7 @@ * gcc.dg/gomp/critical-3.c: Call cleanup-tree-dump. * gcc.dg/tree-ssa/pr23382.c: Ditto. -2006-02-07 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-02-07 Tobias Schl�ter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/25577 * gfortran.dg/mvbits_1.f90: New. @@ -25190,7 +25281,7 @@ * gcc.target/i386/20060125-1.c: New test case. * gcc.target/i386/20060125-2.c: New test case. -2006-01-25 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> +2006-01-25 Tobias Schl�ter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/18540 * gfortran.dg/goto_1.f: New. diff --git a/gcc/testsuite/gcc.c-torture/execute/20091229-1.c b/gcc/testsuite/gcc.c-torture/execute/20091229-1.c new file mode 100644 index 00000000000..08d952f1b3a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20091229-1.c @@ -0,0 +1,2 @@ +long long foo(long long v) { return v / -0x080000000LL; } +void main() { if (foo(0x080000000LL) != -1) abort(); exit (0); } diff --git a/gcc/testsuite/gcc.c-torture/execute/pr41917.c b/gcc/testsuite/gcc.c-torture/execute/pr41917.c new file mode 100644 index 00000000000..4a9ada921c4 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr41917.c @@ -0,0 +1,21 @@ +/* PR rtl-optimization/41917 */ + +extern void abort (void); +unsigned int a = 1; + +int +main (void) +{ + unsigned int b, c, d; + + if (sizeof (int) != 4 || (int) 0xc7d24b5e > 0) + return 0; + + c = 0xc7d24b5e; + d = a | -2; + b = (d == 0) ? c : (c % d); + if (b != c) + abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tls/opt-15.c b/gcc/testsuite/gcc.dg/tls/opt-15.c new file mode 100644 index 00000000000..bebee8a499f --- /dev/null +++ b/gcc/testsuite/gcc.dg/tls/opt-15.c @@ -0,0 +1,24 @@ +/* PR target/42564 */ +/* This used to ICE on the SPARC because of an unrecognized TLS pattern. */ + +/* { dg-do compile } */ +/* { dg-options "-O -fPIC" } */ +/* { dg-require-effective-target tls_native } */ +/* { dg-require-effective-target fpic } */ + +extern void *memset(void *s, int c, __SIZE_TYPE__ n); + +struct S1 { int i; }; + +struct S2 +{ + int ver; + struct S1 s; +}; + +static __thread struct S2 m; + +void init(void) +{ + memset(&m.s, 0, sizeof(m.s)); +} diff --git a/gcc/testsuite/gcc.dg/torture/pr42898-2.c b/gcc/testsuite/gcc.dg/torture/pr42898-2.c new file mode 100644 index 00000000000..32c94273b13 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr42898-2.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ +/* { dg-options "-fdump-tree-optimized" } */ + +struct hardware { + int parm1:8; + int :4; + int parm2:4; + int parm3:15; + int parm4:1; +}; + +const struct hardware h = { + .parm1=42, + .parm2=13, + .parm3=11850, + .parm4=1, +}; + +void f1(volatile struct hardware *ptr) +{ + *ptr = h; +} + +/* { dg-final { scan-tree-dump-times "\\*ptr" 1 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/torture/pr42898.c b/gcc/testsuite/gcc.dg/torture/pr42898.c new file mode 100644 index 00000000000..f770baf0c7d --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr42898.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ +/* { dg-options "-fdump-tree-optimized" } */ + +struct hardware { + int parm1:8; + int :4; + int parm2:4; + int parm3:15; + int parm4:1; +}; + +void f1(volatile struct hardware *ptr) +{ + *ptr=(struct hardware) { + .parm1=42, + .parm2=13, + .parm3=11850, + .parm4=1, + }; +} + +/* { dg-final { scan-tree-dump-times "\\*ptr" 1 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/torture/pr42952.c b/gcc/testsuite/gcc.dg/torture/pr42952.c new file mode 100644 index 00000000000..db8782af3b9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr42952.c @@ -0,0 +1,19 @@ +/* { dg-do run } */ +/* { dg-options "-fno-tree-ccp -fno-tree-fre" } */ + +extern void abort (void); + +static int g[1]; + +static int * const p = &g[0]; +static int * const q = &g[0]; + +int main(void) +{ + g[0] = 1; + *p = 0; + *p = *q; + if (g[0] != 0) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/alpha/pr42113.c b/gcc/testsuite/gcc.target/alpha/pr42113.c new file mode 100644 index 00000000000..228c14abb64 --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/pr42113.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int foo (int a, int b) +{ + int bar = a * sizeof (int); + + if (b) + bar += sizeof (int); + + return bar; +} diff --git a/gcc/testsuite/gcc.target/alpha/pr42448-1.c b/gcc/testsuite/gcc.target/alpha/pr42448-1.c new file mode 100644 index 00000000000..4e2c376e39d --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/pr42448-1.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-options "-mcpu=21064 -O0" } */ + +extern void abort (void); + +struct S2180 +{ + char t; + _Complex char u[2]; +}; + +struct S2180 s2180; + +int +main (void) +{ + volatile struct S2180 x; + + s2180.u[1] = 3 + 4i; + + x.u[1] = s2180.u[1]; + + if (x.u[1] != s2180.u[1]) + abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/alpha/pr42448-2.c b/gcc/testsuite/gcc.target/alpha/pr42448-2.c new file mode 100644 index 00000000000..aeebad2809b --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/pr42448-2.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-options "-mcpu=21064 -O0" } */ + +extern void abort (void); + +struct S2180 +{ + char t; + _Complex char u[4]; +}; + +struct S2180 s2180; + +int +main (void) +{ + volatile struct S2180 x; + + s2180.u[3] = 3 + 4i; + + x.u[3] = s2180.u[3]; + + if (x.u[3] != s2180.u[3]) + abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/alpha/pr42774.c b/gcc/testsuite/gcc.target/alpha/pr42774.c new file mode 100644 index 00000000000..65688002b3a --- /dev/null +++ b/gcc/testsuite/gcc.target/alpha/pr42774.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mcpu=ev4" } */ + +unsigned int ntfs_getinfo(void *p) +{ + char bootsect[8]; + + __builtin_memcpy(bootsect, p, sizeof bootsect); + return *(unsigned short *)(bootsect + 3); +} diff --git a/gcc/testsuite/gcc.target/i386/mmx-3dnow-check.h b/gcc/testsuite/gcc.target/i386/mmx-3dnow-check.h new file mode 100644 index 00000000000..458e7cda898 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/mmx-3dnow-check.h @@ -0,0 +1,21 @@ +#include <stdio.h> +#include <stdlib.h> + +#include "cpuid.h" + +static void mmx_3dnow_test (void); + +int +main () +{ + unsigned int eax, ebx, ecx, edx; + + if (!__get_cpuid (0x80000001, &eax, &ebx, &ecx, &edx)) + return 0; + + /* Run 3DNow! test only if host has 3DNow! support. */ + if (edx & bit_3DNOW) + mmx_3dnow_test (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/pr42542-1.c b/gcc/testsuite/gcc.target/i386/pr42542-1.c new file mode 100644 index 00000000000..60da8ee1501 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr42542-1.c @@ -0,0 +1,77 @@ +/* { dg-do run } */ +/* { dg-options "-O1 -msse2 -ftree-vectorize" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +unsigned int v1[] __attribute__ ((aligned(16))) = +{ + 0x80000000, 1, 0xa0000000, 2, + 3, 0xd0000000, 0xf0000000, 0xe0000000 +}; +unsigned int v2[] __attribute__ ((aligned(16))) = +{ + 4, 0xb0000000, 5, 0xc0000000, + 0xd0000000, 6, 7, 8 +}; + +unsigned int max[] = +{ + 0x80000000, 0xb0000000, 0xa0000000, 0xc0000000, + 0xd0000000, 0xd0000000, 0xf0000000, 0xe0000000 +}; + +unsigned int min[] = +{ + 4, 1, 5, 2, + 3, 6, 7, 8 +}; + +unsigned int res[8] __attribute__ ((aligned(16))); + +extern void abort (void); + +void +find_max (void) +{ + int i; + + for (i = 0; i < 8; i++) + res[i] = v1[i] < v2[i] ? v2[i] : v1[i]; +} + +void +find_min (void) +{ + int i; + + for (i = 0; i < 8; i++) + res[i] = v1[i] > v2[i] ? v2[i] : v1[i]; +} + +static void +TEST (void) +{ + int i; + int err = 0; + + find_max (); + for (i = 0; i < 8; i++) + if (res[i] != max[i]) + err++; + + find_min (); + for (i = 0; i < 8; i++) + if (res[i] != min[i]) + err++; + + if (err) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/pr42542-1a.c b/gcc/testsuite/gcc.target/i386/pr42542-1a.c new file mode 100644 index 00000000000..cd77175f6e5 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr42542-1a.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target sse4 } */ +/* { dg-options "-O1 -msse4.1 -ftree-vectorize" } */ + +#define CHECK_H "sse4_1-check.h" +#define TEST sse4_1_test + +#include "pr42542-1.c" diff --git a/gcc/testsuite/gcc.target/i386/pr42542-1b.c b/gcc/testsuite/gcc.target/i386/pr42542-1b.c new file mode 100644 index 00000000000..7651f07a649 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr42542-1b.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -msse4.1 -ftree-vectorize" } */ + +#define CHECK_H "sse4_1-check.h" +#define TEST sse4_1_test + +#include "pr42542-1.c" + +/* { dg-final { scan-assembler "pmaxud" } } */ +/* { dg-final { scan-assembler "pminud" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr42542-2.c b/gcc/testsuite/gcc.target/i386/pr42542-2.c new file mode 100644 index 00000000000..fc59534d906 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr42542-2.c @@ -0,0 +1,77 @@ +/* { dg-do run } */ +/* { dg-options "-O1 -msse2 -ftree-vectorize" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +unsigned short v1[] __attribute__ ((aligned(16))) = +{ + 0x8000, 0x9000, 1, 10, 0xa000, 0xb000, 2, 20, + 3, 30, 0xd000, 0xe000, 0xf000, 0xe000, 25, 30 +}; +unsigned short v2[] __attribute__ ((aligned(16))) = +{ + 4, 40, 0xb000, 0x8000, 5, 50, 0xc000, 0xf000, + 0xd000, 0xa000, 6, 65, 7, 75, 0xe000, 0xc000 +}; + +unsigned short max[] = +{ + 0x8000, 0x9000, 0xb000, 0x8000, 0xa000, 0xb000, 0xc000, 0xf000, + 0xd000, 0xa000, 0xd000, 0xe000, 0xf000, 0xe000, 0xe000, 0xc000 +}; + +unsigned short min[] = +{ + 4, 40, 1, 10, 5, 50, 2, 20, + 3, 30, 6, 65, 7, 75, 25, 30 +}; + +unsigned short res[16] __attribute__ ((aligned(16))); + +extern void abort (void); + +void +find_max (void) +{ + int i; + + for (i = 0; i < 16; i++) + res[i] = v1[i] < v2[i] ? v2[i] : v1[i]; +} + +void +find_min (void) +{ + int i; + + for (i = 0; i < 16; i++) + res[i] = v1[i] > v2[i] ? v2[i] : v1[i]; +} + +static void +TEST (void) +{ + int i; + int err = 0; + + find_max (); + for (i = 0; i < 16; i++) + if (res[i] != max[i]) + err++; + + find_min (); + for (i = 0; i < 16; i++) + if (res[i] != min[i]) + err++; + + if (err) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/pr42542-2a.c b/gcc/testsuite/gcc.target/i386/pr42542-2a.c new file mode 100644 index 00000000000..bcefa9cfe8d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr42542-2a.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target sse4 } */ +/* { dg-options "-O1 -msse4.1 -ftree-vectorize" } */ + +#define CHECK_H "sse4_1-check.h" +#define TEST sse4_1_test + +#include "pr42542-2.c" diff --git a/gcc/testsuite/gcc.target/i386/pr42542-2b.c b/gcc/testsuite/gcc.target/i386/pr42542-2b.c new file mode 100644 index 00000000000..ddb539bf7a6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr42542-2b.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -msse4.1 -ftree-vectorize" } */ + +#define CHECK_H "sse4_1-check.h" +#define TEST sse4_1_test + +#include "pr42542-2.c" + +/* { dg-final { scan-assembler "pmaxuw" } } */ +/* { dg-final { scan-assembler "pminuw" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr42542-3.c b/gcc/testsuite/gcc.target/i386/pr42542-3.c new file mode 100644 index 00000000000..028d2f89964 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr42542-3.c @@ -0,0 +1,85 @@ +/* { dg-do run } */ +/* { dg-options "-O1 -msse2 -ftree-vectorize" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +unsigned char v1[] __attribute__ ((aligned(16))) = +{ + 0x80, 0xd0, 0x90, 0xa0, 1, 15, 10, 15, + 0xa0, 0xc0, 0xb0, 0xf0, 2, 25, 20, 35, + 3, 34, 30, 36, 0xd0, 0x80, 0xe0, 0xb0, + 0xf0, 0xe0, 0xe0, 0x80, 25, 34, 30, 40 +}; +unsigned char v2[] __attribute__ ((aligned(16))) = +{ + 4, 44, 40, 48, 0xb0, 0x80, 0x80, 0x90, + 5, 55, 50, 51, 0xc0, 0xb0, 0xf0, 0xd0, + 0xd0, 0x80, 0xa0, 0xf0, 6, 61, 65, 68, + 7, 76, 75, 81, 0xe0, 0xf0, 0xc0, 0x90 +}; + +unsigned char max[] = +{ + 0x80, 0xd0, 0x90, 0xa0, 0xb0, 0x80, 0x80, 0x90, + 0xa0, 0xc0, 0xb0, 0xf0, 0xc0, 0xb0, 0xf0, 0xd0, + 0xd0, 0x80, 0xa0, 0xf0, 0xd0, 0x80, 0xe0, 0xb0, + 0xf0, 0xe0, 0xe0, 0x80, 0xe0, 0xf0, 0xc0, 0x90 +}; + +unsigned char min[] = +{ + 4, 44, 40, 48, 1, 15, 10, 15, + 5, 55, 50, 51, 2, 25, 20, 35, + 3, 34, 30, 36, 6, 61, 65, 68, + 7, 76, 75, 81, 25, 34, 30, 40 +}; + +unsigned char res[32] __attribute__ ((aligned(16))); + +extern void abort (void); + +void +find_max (void) +{ + int i; + + for (i = 0; i < 32; i++) + res[i] = v1[i] < v2[i] ? v2[i] : v1[i]; +} + +void +find_min (void) +{ + int i; + + for (i = 0; i < 32; i++) + res[i] = v1[i] > v2[i] ? v2[i] : v1[i]; +} + +static void +TEST (void) +{ + int i; + int err = 0; + + find_max (); + for (i = 0; i < 32; i++) + if (res[i] != max[i]) + err++; + + find_min (); + for (i = 0; i < 32; i++) + if (res[i] != min[i]) + err++; + + if (err) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/pr42542-3a.c b/gcc/testsuite/gcc.target/i386/pr42542-3a.c new file mode 100644 index 00000000000..754e59e8487 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr42542-3a.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -msse2 -ftree-vectorize" } */ + +#include "pr42542-3.c" + +/* { dg-final { scan-assembler "pmaxub" } } */ +/* { dg-final { scan-assembler "pminub" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr42549.c b/gcc/testsuite/gcc.target/i386/pr42549.c new file mode 100644 index 00000000000..5f9646251aa --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr42549.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -m3dnow" } */ + +#include "mmx-3dnow-check.h" + +#include <mm3dnow.h> + +typedef union { + float f[2]; + __m64 v; +} vec_t; + +void __attribute__ ((noinline)) +Butterfly_3 (__m64 * D, __m64 SC) +{ + __m64 T, T1; + + T = _m_pfmul (D[1], SC); + T1 = D[0]; + D[0] = _m_pfadd (T1, T); + D[1] = _m_pfsub (T1, T); +} + +void +mmx_3dnow_test (void) +{ + vec_t D[2] = { { .f = { 2.0f, 3.0f } }, + { .f = { 4.0f, 5.0f } } }; + + const vec_t SC = { .f = { 1.0f, 1.0f } }; + + Butterfly_3 (&D[0].v, SC.v); + _m_femms (); + + if (D[1].f[0] != -2.0f || D[1].f[1] != -2.0f) + abort (); +} diff --git a/gcc/testsuite/gcc.target/ia64/pr42542-1.c b/gcc/testsuite/gcc.target/ia64/pr42542-1.c new file mode 100644 index 00000000000..9ce66f494a9 --- /dev/null +++ b/gcc/testsuite/gcc.target/ia64/pr42542-1.c @@ -0,0 +1,68 @@ +/* { dg-do run } */ +/* { dg-options "-O1 -ftree-vectorize" } */ + +unsigned int v1[] __attribute__ ((aligned(16))) = +{ + 0x80000000, 1, 0xa0000000, 2, + 3, 0xd0000000, 0xf0000000, 0xe0000000 +}; +unsigned int v2[] __attribute__ ((aligned(16))) = +{ + 4, 0xb0000000, 5, 0xc0000000, + 0xd0000000, 6, 7, 8 +}; + +unsigned int max[] = +{ + 0x80000000, 0xb0000000, 0xa0000000, 0xc0000000, + 0xd0000000, 0xd0000000, 0xf0000000, 0xe0000000 +}; + +unsigned int min[] = +{ + 4, 1, 5, 2, + 3, 6, 7, 8 +}; + +unsigned int res[8] __attribute__ ((aligned(16))); + +extern void abort (void); + +void +find_max (void) +{ + int i; + + for (i = 0; i < 8; i++) + res[i] = v1[i] < v2[i] ? v2[i] : v1[i]; +} + +void +find_min (void) +{ + int i; + + for (i = 0; i < 8; i++) + res[i] = v1[i] > v2[i] ? v2[i] : v1[i]; +} + +int main (void) +{ + int i; + int err = 0; + + find_max (); + for (i = 0; i < 8; i++) + if (res[i] != max[i]) + err++; + + find_min (); + for (i = 0; i < 8; i++) + if (res[i] != min[i]) + err++; + + if (err) + abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/ia64/pr42542-2.c b/gcc/testsuite/gcc.target/ia64/pr42542-2.c new file mode 100644 index 00000000000..d41eef38386 --- /dev/null +++ b/gcc/testsuite/gcc.target/ia64/pr42542-2.c @@ -0,0 +1,68 @@ +/* { dg-do run } */ +/* { dg-options "-O1 -ftree-vectorize" } */ + +unsigned short v1[] __attribute__ ((aligned(16))) = +{ + 0x8000, 0x9000, 1, 10, 0xa000, 0xb000, 2, 20, + 3, 30, 0xd000, 0xe000, 0xf000, 0xe000, 25, 30 +}; +unsigned short v2[] __attribute__ ((aligned(16))) = +{ + 4, 40, 0xb000, 0x8000, 5, 50, 0xc000, 0xf000, + 0xd000, 0xa000, 6, 65, 7, 75, 0xe000, 0xc000 +}; + +unsigned short max[] = +{ + 0x8000, 0x9000, 0xb000, 0x8000, 0xa000, 0xb000, 0xc000, 0xf000, + 0xd000, 0xa000, 0xd000, 0xe000, 0xf000, 0xe000, 0xe000, 0xc000 +}; + +unsigned short min[] = +{ + 4, 40, 1, 10, 5, 50, 2, 20, + 3, 30, 6, 65, 7, 75, 25, 30 +}; + +unsigned short res[16] __attribute__ ((aligned(16))); + +extern void abort (void); + +void +find_max (void) +{ + int i; + + for (i = 0; i < 16; i++) + res[i] = v1[i] < v2[i] ? v2[i] : v1[i]; +} + +void +find_min (void) +{ + int i; + + for (i = 0; i < 16; i++) + res[i] = v1[i] > v2[i] ? v2[i] : v1[i]; +} + +int main (void) +{ + int i; + int err = 0; + + find_max (); + for (i = 0; i < 16; i++) + if (res[i] != max[i]) + err++; + + find_min (); + for (i = 0; i < 16; i++) + if (res[i] != min[i]) + err++; + + if (err) + abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/ia64/pr42542-3.c b/gcc/testsuite/gcc.target/ia64/pr42542-3.c new file mode 100644 index 00000000000..29e090883b7 --- /dev/null +++ b/gcc/testsuite/gcc.target/ia64/pr42542-3.c @@ -0,0 +1,76 @@ +/* { dg-do run } */ +/* { dg-options "-O1 -ftree-vectorize" } */ + +unsigned char v1[] __attribute__ ((aligned(16))) = +{ + 0x80, 0xd0, 0x90, 0xa0, 1, 15, 10, 15, + 0xa0, 0xc0, 0xb0, 0xf0, 2, 25, 20, 35, + 3, 34, 30, 36, 0xd0, 0x80, 0xe0, 0xb0, + 0xf0, 0xe0, 0xe0, 0x80, 25, 34, 30, 40 +}; +unsigned char v2[] __attribute__ ((aligned(16))) = +{ + 4, 44, 40, 48, 0xb0, 0x80, 0x80, 0x90, + 5, 55, 50, 51, 0xc0, 0xb0, 0xf0, 0xd0, + 0xd0, 0x80, 0xa0, 0xf0, 6, 61, 65, 68, + 7, 76, 75, 81, 0xe0, 0xf0, 0xc0, 0x90 +}; + +unsigned char max[] = +{ + 0x80, 0xd0, 0x90, 0xa0, 0xb0, 0x80, 0x80, 0x90, + 0xa0, 0xc0, 0xb0, 0xf0, 0xc0, 0xb0, 0xf0, 0xd0, + 0xd0, 0x80, 0xa0, 0xf0, 0xd0, 0x80, 0xe0, 0xb0, + 0xf0, 0xe0, 0xe0, 0x80, 0xe0, 0xf0, 0xc0, 0x90 +}; + +unsigned char min[] = +{ + 4, 44, 40, 48, 1, 15, 10, 15, + 5, 55, 50, 51, 2, 25, 20, 35, + 3, 34, 30, 36, 6, 61, 65, 68, + 7, 76, 75, 81, 25, 34, 30, 40 +}; + +unsigned char res[32] __attribute__ ((aligned(16))); + +extern void abort (void); + +void +find_max (void) +{ + int i; + + for (i = 0; i < 32; i++) + res[i] = v1[i] < v2[i] ? v2[i] : v1[i]; +} + +void +find_min (void) +{ + int i; + + for (i = 0; i < 32; i++) + res[i] = v1[i] > v2[i] ? v2[i] : v1[i]; +} + +int main (void) +{ + int i; + int err = 0; + + find_max (); + for (i = 0; i < 32; i++) + if (res[i] != max[i]) + err++; + + find_min (); + for (i = 0; i < 32; i++) + if (res[i] != min[i]) + err++; + + if (err) + abort (); + + return 0; +} diff --git a/gcc/testsuite/gfortran.dg/direct_io_11.f90 b/gcc/testsuite/gfortran.dg/direct_io_11.f90 new file mode 100644 index 00000000000..a2b8afc358f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/direct_io_11.f90 @@ -0,0 +1,55 @@ +! { dg-do run } +! PR42090 Problems reading partial records in formatted direct access files +! Test case from PR, prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org> +program da_good_now + implicit none + real :: a, b + + a = 1.111111111 + b = 2.222222222 + + open( 10, file = 't.dat', form = 'formatted', access = 'direct', recl = 12 ) + write( 10, rec = 1, fmt = '( f6.4, /, f6.4 )' ) a, b + close( 10 ) + + a = -1.0 + b = -1.0 + + open( 10, file = 't.dat', form = 'formatted', access = 'direct', recl = 12 ) + + read( 10, rec = 1, fmt = '( f6.4, /, f6.4 )' ) a, b + !write( *, '( "partial record 1", t25, 2( f6.4, 1x ) )' ) a, b + a = -1.0 + b = -1.0 + + read( 10, rec = 1, fmt = '( f6.4 )' ) a, b + !write( *, '( "partial record 2", t25, 2( f6.4, 1x ) )' ) a, b + if (a /= 1.1111 .and. b /= 2.2222) call abort() + a = -1.0 + b = -1.0 + + read( 10, rec = 1, fmt = '( f12.4, /, f12.4 )' ) a, b + !write( *, '( "full record 1", t25, 2( f6.4, 1x ) )' ) a, b + if (a /= 1.1111 .and. b /= 2.2222) call abort() + a = -1.0 + b = -1.0 + + read( 10, rec = 1, fmt = '( f12.4 )' ) a, b + !write( *, '( "full record 2", t25, 2( f6.4, 1x ) )' ) a, b + if (a /= 1.1111 .and. b /= 2.2222) call abort() + a = -1.0 + b = -1.0 + + read( 10, rec = 1, fmt = '( f6.4, 6x, /, f6.4, 6x )' ) a, b + !write( *, '( "full record with 6x", t25, 2( f6.4, 1x ) )' ) a, b + if (a /= 1.1111 .and. b /= 2.2222) call abort() + a = -1.0 + b = -1.0 + + read( 10, rec = 1, fmt = '( f6.4 )' ) a + read( 10, rec = 2, fmt = '( f6.4 )' ) b + !write( *, '( "record at a time", t25, 2( f6.4, 1x ) )' ) a, b + if (a /= 1.1111 .and. b /= 2.2222) call abort() + + close( 10, status="delete") +end program da_good_now diff --git a/gcc/testsuite/gfortran.dg/list_read_10.f90 b/gcc/testsuite/gfortran.dg/list_read_10.f90 new file mode 100644 index 00000000000..1ad3304d50c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/list_read_10.f90 @@ -0,0 +1,14 @@ +! { dg-do run } +! PR 42422 - read with a repeat specifyer following a separator +program main + integer, dimension(10) :: i1, i2 + + i1 = 0 + i2 = (/ 1, 2, 3, 5, 5, 5, 5, 0, 0, 0 /) + open (10,file="pr42422.dat") + write (10,'(A)') ' 1 2 3 4*5 /' + rewind 10 + read (10,*) i1 + if (any(i1 /= i2)) call abort + close (10,status="delete") +end program main diff --git a/gcc/testsuite/gfortran.dg/namelist_40.f90 b/gcc/testsuite/gfortran.dg/namelist_40.f90 index 3c9d813343a..d6f896a3956 100644 --- a/gcc/testsuite/gfortran.dg/namelist_40.f90 +++ b/gcc/testsuite/gfortran.dg/namelist_40.f90 @@ -47,7 +47,7 @@ subroutine writenml (astring) end subroutine writenml end program namelist_40 -! { dg-output "Multiple sub-objects with non-zero rank in namelist object x(\n|\r\n|\r)" } +! { dg-output "Multiple sub-objects with non-zero rank in namelist object x%m%ch(\n|\r\n|\r)" } ! { dg-output "Missing colon in substring qualifier for namelist variable x%m%ch(\n|\r\n|\r)" } ! { dg-output "Substring out of range for namelist variable x%m%ch(\n|\r\n|\r)" } ! { dg-output "Bad character in substring qualifier for namelist variable x%m%ch(\n|\r\n|\r)" } diff --git a/gcc/testsuite/gfortran.dg/namelist_47.f90 b/gcc/testsuite/gfortran.dg/namelist_47.f90 index bc9110fa3cd..581924720bd 100644 --- a/gcc/testsuite/gfortran.dg/namelist_47.f90 +++ b/gcc/testsuite/gfortran.dg/namelist_47.f90 @@ -45,7 +45,7 @@ subroutine writenml (astring) end subroutine writenml end program namelist_47 -! { dg-output "Multiple sub-objects with non-zero rank in namelist object x(\n|\r\n|\r)" } +! { dg-output "Multiple sub-objects with non-zero rank in namelist object x%m%c012345678901234567890123456789012345678901234567890123456789h(\n|\r\n|\r)" } ! { dg-output "Missing colon in substring qualifier for namelist variable x%m%c012345678901234567890123456789012345678901234567890123456789h(\n|\r\n|\r)" } ! { dg-output "Substring out of range for namelist variable x%m%c012345678901234567890123456789012345678901234567890123456789h(\n|\r\n|\r)" } ! { dg-output "Bad character in substring qualifier for namelist variable x%m%c012345678901234567890123456789012345678901234567890123456789h(\n|\r\n|\r)" } diff --git a/gcc/testsuite/gfortran.dg/namelist_59.f90 b/gcc/testsuite/gfortran.dg/namelist_59.f90 new file mode 100644 index 00000000000..bb68b9bebe9 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/namelist_59.f90 @@ -0,0 +1,26 @@ +! { dg-do run } +! PR41192 NAMELIST input with just a comment ("&NAME ! comment \") error +program cmdline +! comment by itself causes error in gfortran + call process(' ') + call process('i=10 , j=20 k=30 ! change all three values') + call process(' ') + call process('! change no values')! before patch this failed. +end program cmdline + +subroutine process(string) + implicit none + character(len=*) :: string + character(len=132) :: lines(3) + character(len=255) :: message + integer :: i=1,j=2,k=3 + integer ios + namelist /cmd/ i,j,k + save cmd + lines(1)='&cmd' + lines(2)=string + lines(3)='/' + + read(lines,nml=cmd,iostat=ios,iomsg=message) + if (ios.ne.0) call abort +end subroutine process diff --git a/gcc/testsuite/gfortran.dg/namelist_60.f90 b/gcc/testsuite/gfortran.dg/namelist_60.f90 new file mode 100644 index 00000000000..5cab78b8ca3 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/namelist_60.f90 @@ -0,0 +1,27 @@ +! { dg-do run } +! PR42901 Reading array of structures from namelist +! Test case derived from the reporters test case. +program test_nml +type field_descr + integer number +end type +type fsetup + type (field_descr), dimension(3) :: vel ! 3 velocity components +end type +type (fsetup) field_setup +namelist /nl_setup/ field_setup +field_setup%vel%number = 0 +! write(*,nml=nl_setup) +open(10, status="scratch") +write(10,'(a)') "&nl_setup" +write(10,'(a)') " field_setup%vel(1)%number= 3," +write(10,'(a)') " field_setup%vel(2)%number= 9," +write(10,'(a)') " field_setup%vel(3)%number= 27," +write(10,'(a)') "/" +rewind(10) +read(10,nml=nl_setup) +if (field_setup%vel(1)%number .ne. 3) call abort +if (field_setup%vel(2)%number .ne. 9) call abort +if (field_setup%vel(3)%number .ne. 27) call abort +! write(*,nml=nl_setup) +end program test_nml diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 97c4fb32c73..cf91502e610 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -2657,7 +2657,7 @@ static void get_constraint_for_ptr_offset (tree ptr, tree offset, VEC (ce_s, heap) **results) { - struct constraint_expr *c; + struct constraint_expr c; unsigned int j, n; unsigned HOST_WIDE_INT rhsunitoffset, rhsoffset; @@ -2708,13 +2708,13 @@ get_constraint_for_ptr_offset (tree ptr, tree offset, for (j = 0; j < n; j++) { varinfo_t curr; - c = VEC_index (ce_s, *results, j); - curr = get_varinfo (c->var); + c = *VEC_index (ce_s, *results, j); + curr = get_varinfo (c.var); - if (c->type == ADDRESSOF + if (c.type == ADDRESSOF && !curr->is_full_var) { - varinfo_t temp, curr = get_varinfo (c->var); + varinfo_t temp, curr = get_varinfo (c.var); /* Search the sub-field which overlaps with the pointed-to offset. As we deal with positive offsets @@ -2750,15 +2750,17 @@ get_constraint_for_ptr_offset (tree ptr, tree offset, c2.offset = 0; VEC_safe_push (ce_s, heap, *results, &c2); } - c->var = temp->id; - c->offset = 0; + c.var = temp->id; + c.offset = 0; } - else if (c->type == ADDRESSOF + else if (c.type == ADDRESSOF /* If this varinfo represents a full variable just use it. */ && curr->is_full_var) - c->offset = 0; + c.offset = 0; else - c->offset = rhsoffset; + c.offset = rhsoffset; + + VEC_replace (ce_s, *results, j, &c); } } diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 2f3accde31b..8b3edc32ba1 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,19 @@ +2010-02-04 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libfortran/42901 + * io/list_read.c (nml_get_obj_data): Add new qualifier flag, clean up + code, and adjust logic to set namelist info pointer correctly for array + qualifiers of derived type components. + +2009-11-20 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libgfortran/42090 + Backport from trunk. + * io/transfer.c (skip_record): Set bytes_left_subrecord to zero after + skipping the remaining bytes in the record. + (next_record_r): Call skip_record with the number of bytes_left to be + skipped. + 2009-08-04 Release Manager * GCC 4.3.4 released. diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index 367caeaf394..f05d410b4c3 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -297,10 +297,10 @@ static void eat_line (st_parameter_dt *dtp) { char c; - if (!is_internal_unit (dtp)) - do - c = next_char (dtp); - while (c != '\n'); + + do + c = next_char (dtp); + while (c != '\n'); } @@ -2522,7 +2522,7 @@ nml_get_obj_data (st_parameter_dt *dtp, namelist_info **pprev_nl, namelist_info * first_nl = NULL; namelist_info * root_nl = NULL; int dim, parsed_rank; - int component_flag; + int component_flag, qualifier_flag; index_type clow, chigh; int non_zero_rank_count; @@ -2571,11 +2571,12 @@ nml_get_obj_data (st_parameter_dt *dtp, namelist_info **pprev_nl, break; } - /* Untouch all nodes of the namelist and reset the flag that is set for + /* Untouch all nodes of the namelist and reset the flags that are set for derived type components. */ nml_untouch_nodes (dtp); component_flag = 0; + qualifier_flag = 0; non_zero_rank_count = 0; /* Get the object name - should '!' and '\n' be permitted separators? */ @@ -2657,10 +2658,11 @@ get_name: " for namelist variable %s", nl->var_name); goto nml_err_ret; } - if (parsed_rank > 0) non_zero_rank_count++; + qualifier_flag = 1; + c = next_char (dtp); unget_char (dtp, c); } @@ -2685,6 +2687,7 @@ get_name: root_nl = nl; component_flag = 1; + c = next_char (dtp); goto get_name; } @@ -2725,15 +2728,6 @@ get_name: unget_char (dtp, c); } - /* If a derived type touch its components and restore the root - namelist_info if we have parsed a qualified derived type - component. */ - - if (nl->type == GFC_DTYPE_DERIVED) - nml_touch_nodes (nl); - if (component_flag && nl->var_rank > 0) - nl = first_nl; - /* Make sure no extraneous qualifiers are there. */ if (c == '(') @@ -2779,8 +2773,23 @@ get_name: goto nml_err_ret; } - if (first_nl != NULL && first_nl->var_rank > 0) - nl = first_nl; + /* If a derived type, touch its components and restore the root + namelist_info if we have parsed a qualified derived type + component. */ + + if (nl->type == GFC_DTYPE_DERIVED) + nml_touch_nodes (nl); + + if (first_nl) + { + if (first_nl->var_rank == 0) + { + if (component_flag && qualifier_flag) + nl = first_nl; + } + else + nl = first_nl; + } if (nml_read_obj (dtp, nl, 0, pprev_nl, nml_err_msg, nml_err_msg_size, clow, chigh) == FAILURE) diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index a93c9b8dcd5..d5c9d4e7edf 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -2186,6 +2186,8 @@ skip_record (st_parameter_dt *dtp, size_t bytes) only I/O errors. */ if (sseek (dtp->u.p.current_unit->s, new) == FAILURE) generate_error (&dtp->common, LIBERROR_OS, NULL); + + dtp->u.p.current_unit->bytes_left_subrecord = 0; } else { /* Seek by reading data. */ @@ -2258,7 +2260,7 @@ next_record_r (st_parameter_dt *dtp) case FORMATTED_DIRECT: case UNFORMATTED_DIRECT: - skip_record (dtp, 0); + skip_record (dtp, dtp->u.p.current_unit->bytes_left); break; case FORMATTED_STREAM: diff --git a/libjava/libltdl/ChangeLog b/libjava/libltdl/ChangeLog index a77a7016f65..a8218ba9d4c 100644 --- a/libjava/libltdl/ChangeLog +++ b/libjava/libltdl/ChangeLog @@ -1,3 +1,18 @@ +2009-12-03 Jakub Jelinek <jakub@redhat.com> + + * acinclude.m4: Regenerated to pick: + 2007-06-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> + + * libtool.m4 (AC_LIBTOOL_SYS_DYNAMIC_LINKER) [linux]: + Ignore lines in ld.so.conf starting with 'hwcap '. + + * configure: Regenerated. + + 2009-11-24 Peter O'Gorman <peter@pogma.com> + + Backport of libltdl changes from the 2.26b release. + * ltdl.c: Backport changes. + 2009-08-04 Release Manager * GCC 4.3.4 released. diff --git a/libjava/libltdl/acinclude.m4 b/libjava/libltdl/acinclude.m4 index 066682458f5..53e3e5c19df 100644 --- a/libjava/libltdl/acinclude.m4 +++ b/libjava/libltdl/acinclude.m4 @@ -1527,7 +1527,7 @@ linux*) # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi diff --git a/libjava/libltdl/configure b/libjava/libltdl/configure index da75eaacedc..9294136fe45 100755 --- a/libjava/libltdl/configure +++ b/libjava/libltdl/configure @@ -8587,7 +8587,7 @@ linux*) # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi @@ -12385,7 +12385,7 @@ linux*) # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi @@ -15666,7 +15666,7 @@ linux*) # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi @@ -18152,7 +18152,7 @@ linux*) # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi diff --git a/libjava/libltdl/ltdl.c b/libjava/libltdl/ltdl.c index 6b5d8890efa..3c1c0396167 100644 --- a/libjava/libltdl/ltdl.c +++ b/libjava/libltdl/ltdl.c @@ -2175,7 +2175,8 @@ static int trim LT_PARAMS((char **dest, static int try_dlopen LT_PARAMS((lt_dlhandle *handle, const char *filename)); static int tryall_dlopen LT_PARAMS((lt_dlhandle *handle, - const char *filename)); + const char *filename, + const char * useloader)); static int unload_deplibs LT_PARAMS((lt_dlhandle handle)); static int lt_argz_insert LT_PARAMS((char **pargz, size_t *pargz_len, @@ -2361,9 +2362,10 @@ lt_dlexit () } static int -tryall_dlopen (handle, filename) +tryall_dlopen (handle, filename, useloader) lt_dlhandle *handle; const char *filename; + const char *useloader; { lt_dlhandle cur; lt_dlloader *loader; @@ -2430,6 +2432,11 @@ tryall_dlopen (handle, filename) while (loader) { + if (useloader && strcmp(loader->loader_name, useloader)) + { + loader = loader->next; + continue; + } lt_user_data data = loader->dlloader_data; cur->module = loader->module_open (data, filename); @@ -2499,7 +2506,7 @@ tryall_dlopen_module (handle, prefix, dirname, dlname) error += tryall_dlopen_module (handle, (const char *) 0, prefix, filename); } - else if (tryall_dlopen (handle, filename) != 0) + else if (tryall_dlopen (handle, filename, NULL) != 0) { ++error; } @@ -2520,7 +2527,7 @@ find_module (handle, dir, libdir, dlname, old_name, installed) /* Try to open the old library first; if it was dlpreopened, we want the preopened version of it, even if a dlopenable module is available. */ - if (old_name && tryall_dlopen (handle, old_name) == 0) + if (old_name && tryall_dlopen (handle, old_name, "dlpreload") == 0) { return 0; } @@ -2784,7 +2791,7 @@ find_handle_callback (filename, data, ignored) /* Try to dlopen the file, but do not continue searching in any case. */ - if (tryall_dlopen (handle, filename) != 0) + if (tryall_dlopen (handle, filename,NULL) != 0) *handle = 0; return 1; @@ -3072,7 +3079,7 @@ try_dlopen (phandle, filename) /* lt_dlclose()ing yourself is very bad! Disallow it. */ LT_DLSET_FLAG (*phandle, LT_DLRESIDENT_FLAG); - if (tryall_dlopen (&newhandle, 0) != 0) + if (tryall_dlopen (&newhandle, 0, NULL) != 0) { LT_DLFREE (*phandle); return 1; @@ -3194,7 +3201,7 @@ try_dlopen (phandle, filename) } #endif } - if (!file) + else { file = fopen (filename, LT_READTEXT_MODE); } @@ -3378,7 +3385,7 @@ try_dlopen (phandle, filename) #endif ))) { - if (tryall_dlopen (&newhandle, filename) != 0) + if (tryall_dlopen (&newhandle, filename, NULL) != 0) { newhandle = NULL; } |