+2015-02-05 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR target/64580
+ Backport from mainline
+ * config.rs6000/rs6000.c (compute_vrsave_mask): Reverse loop order.
+ (rs6000_stack_info): Add assert.
+ (rs6000_output_savres_externs): New function, split off from...
+ (rs6000_output_function_prologue): ... here. Do not call it for
+ thunks.
+
+2015-02-04 Matthias Klose <doko@ubuntu.com>
+
+ PR target/64938
+ Backport from mainline
+ 2015-01-15 Jan Hubicka <hubicka@ucw.cz>
+
+ PR ipa/64068
+ PR ipa/64559
+ * ipa.c (symbol_table::remove_unreachable_nodes):
+ Do not put abstract origins into boundary.
+
+2015-02-04 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2015-01-31 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/64882
+ * config/i386/predicates.md (address_no_seg_operand): Reject
+ non-CONST_INT_P operands in invalid mode.
+
+ Backport from mainline
+ 2015-01-31 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*prefetch_prefetchw1): Remove mode of
+ address_operand 0. Rename from *prefetch_prefetchwt1_<mode>.
+ * config/i386/predicates.md (address_no_seg_operand): Call
+ address_operand with VOIDmode.
+ (vsib_address_operand): Ditto.
+
+2015-02-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ Backported from mainline
+ 2015-01-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/driver-i386.c (host_detect_local_cpu): Check new
+ Silvermont, Haswell, Broadwell and Knights Landing model numbers.
+ * config/i386/i386.c (processor_model): Add
+ M_INTEL_COREI7_BROADWELL.
+ (arch_names_table): Add "broadwell".
+
+2015-02-01 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-01-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/61058
+ * jump.c (cleanup_barriers): Update basic block boundaries
+ if BLOCK_FOR_INSN is non-NULL on PREV.
+
+ 2015-01-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/64421
+ * omp-low.c (simd_clone_mangle): If DECL_ASSEMBLER_NAME starts
+ with asterisk, skip the first character.
+
+ * config/rs6000/rs6000-cpus.def (POWERPC_MASKS): Add
+ OPTION_MASK_QUAD_MEMORY_ATOMIC.
+
+ 2015-01-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/63637
+ PR rtl-optimization/60663
+ * cse.c (merge_equiv_classes): Set new_elt->cost to MAX_COST
+ if elt->cost is MAX_COST for ASM_OPERANDS.
+ (find_sets_in_insn): Fix up comment typo.
+ (cse_insn): Don't set src_volatile for all non-volatile
+ ASM_OPERANDS in PARALLELs, but just those with multiple outputs
+ or with "memory" clobber. Set elt->cost to MAX_COST
+ for ASM_OPERANDS in PARALLEL. Set src_elt->cost to MAX_COST
+ if new_src is ASM_OPERANDS and elt->cost is MAX_COST.
+
+ PR debug/64511
+ * dwarf2out.c (struct dw_loc_descr_node): Add chain_next
+ GTY markup.
+
+ 2015-01-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/64663
+ * dwarf2out.c (decl_piece_node): Don't put bitsize into
+ mode if bitsize <= 0.
+ (decl_piece_bitsize, adjust_piece_list, add_var_loc_to_decl,
+ dw_sra_loc_expr): Use HOST_WIDE_INT instead of int for bit
+ sizes and positions.
+
+2015-01-29 Ilya Tocar <ilya.tocar@intel.com>
+
+ * config/i386/avx2intrin.h (_mm256_bslli_epi128,
+ _mm256_bsrli_epi128): New.
+ * config/i386/emmintrin.h (_mm_bsrli_si128, _mm_bslli_si128): Ditto.
+
+2015-01-27 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/s390.c (s390_memory_move_cost): Increase costs for
+ memory accesses.
+
+2015-01-27 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/s390.c (s390_register_move_cost): Increase costs for
+ FPR->GPR moves.
+
+2015-01-26 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2015-01-26 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/64795
+ * config/i386/i386.md (*movdi_internal): Also check operand 0
+ to determine TYPE_LEA operand.
+ (*movsi_internal): Ditto.
+
+ Backport from mainline
+ 2015-01-23 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/sse.md (sse2_loadld): Set attribute isa to sse2 for
+ alternative 1.
+
+2015-01-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/64734
+ * omp-low.c (scan_sharing_clauses): Don't ignore
+ OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION GOMP_MAP_POINTER clauses
+ on target data/update constructs.
+
+2015-01-23 Wei Mi <wmi@google.com>
+
+ Backported from trunk.
+ 2015-01-22 Wei Mi <wmi@google.com>
+
+ PR rtl-optimization/64557
+ * dse.c (record_store): Call get_addr for mem_addr.
+ (check_mem_read_rtx): Likewise.
+
+2015-01-22 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/s390.md (atomic code attribute): Fix typo "ior" ->
+ "or".
+
+2015-01-21 Wei Mi <wmi@google.com>
+
+ Backported from trunk.
+ 2014-11-22 Jan Hubicka <hubicka@ucw.cz>
+
+ PR ipa/63970
+ * ipa.c (symbol_table::remove_unreachable_nodes): Mark all inline clones
+ as having abstract origin used.
+ * ipa-inline-transform.c (can_remove_node_now_p_1): Drop abstract origin check.
+ (clone_inlined_nodes): Copy abstract originflag.
+ * lto-cgraph.c (compute_ltrans_boundary): Use get_create to get abstract origin node.
+
+2015-01-20 Chung-Lin Tang <cltang@codesourcery.com>
+
+ Backport from mainline
+ * config/nios2/nios2.c (nios2_asm_file_end): Implement
+ TARGET_ASM_FILE_END hook for adding .note.GNU-stack section when
+ needed.
+ (TARGET_ASM_FILE_END): Define.
+
+2015-01-15 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2014-11-27 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/63704
+ * alias.c (mems_in_disjoint_alias_sets_p): Remove assert
+ and instead return false when !fstrict-aliasing.
+
+2015-01-15 Eric Botcazou <ebotcazou@adacore.com>
+
+ * expr.c (expand_expr_real_1) <normal_inner_ref>: Use the expression to
+ set the memory attributes in all cases but clear MEM_EXPR if need be.
+
+2015-01-14 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-01-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/64513
+ * config/i386/i386.c (ix86_expand_prologue): Add
+ REG_FRAME_RELATED_EXPR to %rax and %r10 pushes.
+
+ 2015-01-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/64286
+ * ree.c (combine_reaching_defs): Move part of comment earlier,
+ remove !SCALAR_INT_MODE_P check.
+ (add_removable_extension): Don't add vector mode
+ extensions if all uses of the source register aren't the same
+ vector extensions.
+
+ 2015-01-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/64563
+ * tree-vrp.c (vrp_evaluate_conditional): Check for VR_RANGE
+ instead of != VR_VARYING.
+
+2015-01-14 Marek Polacek <polacek@redhat.com>
+
+ Backport from mainline
+ 2015-01-13 Marek Polacek <polacek@redhat.com>
+
+ PR middle-end/64391
+ * trans-mem.c (get_attrs_for): Return NULL_TREE if X is NULL_TREE.
+
+2015-01-13 Marc Glisse <marc.glisse@inria.fr>
+
+ PR c++/54442
+ * tree.c (build_qualified_type): Use a canonical type for
+ TYPE_CANONICAL.
+
+2015-01-13 Pat Haugen <pthaugen@us.ibm.com>
+
+ Backport from mainline
+ 2014-12-20 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR target/64358
+ * config/rs6000/rs6000.c (rs6000_split_logical_inner): Swap the
+ input operands if only the second is inverted.
+ * config/rs6000/rs6000.md (*boolc<mode>3_internal1 for BOOL_128):
+ Swap BOOL_REGS_OP1 and BOOL_REGS_OP2. Correct arguments to
+ rs6000_split_logical.
+ (*boolc<mode>3_internal2 for TI2): Swap operands[1] and operands[2].
+
+2015-01-13 Renlin Li <renlin.li@arm.com>
+
+ Backport from mainline:
+ 2014-11-19 Renlin Li <renlin.li@arm.com>
+
+ PR target/63424
+ * config/aarch64/aarch64-simd.md (<su><maxmin>v2di3): New.
+
+2015-01-13 Oleg Endo <olegendo@gcc.gnu.org>
+
+ Backport form mainline
+ 2015-01-13 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/64479
+ * rtlanal.c (set_reg_p): Handle SEQUENCE constructs.
+
2015-01-09 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/64536
+2015-02-08 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (is_cplusplus_method): Use Is_Primitive flag to
+ detect primitive operations of tagged and untagged types.
+
2015-01-05 Eric Botcazou <ebotcazou@adacore.com>
PR ada/64492
if (Convention (gnat_entity) != Convention_CPP)
return false;
- /* This is the main case: C++ method imported as a primitive operation. */
- if (Is_Dispatching_Operation (gnat_entity))
+ /* This is the main case: C++ method imported as a primitive operation.
+ Note that a C++ class with no virtual functions can be imported as a
+ limited record type so the operation is not necessarily dispatching. */
+ if (Is_Primitive (gnat_entity))
return true;
/* A thunk needs to be handled like its associated primitive operation. */
if (Is_Subprogram (gnat_entity) && Is_Thunk (gnat_entity))
return true;
- /* C++ classes with no virtual functions can be imported as limited
- record types, but we need to return true for the constructors. */
+ /* A constructor is a method on the C++ side. */
if (Is_Constructor (gnat_entity))
return true;
static inline int
mems_in_disjoint_alias_sets_p (const_rtx mem1, const_rtx mem2)
{
-/* Perform a basic sanity check. Namely, that there are no alias sets
- if we're not using strict aliasing. This helps to catch bugs
- whereby someone uses PUT_CODE, but doesn't clear MEM_ALIAS_SET, or
- where a MEM is allocated in some way other than by the use of
- gen_rtx_MEM, and the MEM_ALIAS_SET is not cleared. If we begin to
- use alias sets to indicate that spilled registers cannot alias each
- other, we might need to remove this check. */
- gcc_assert (flag_strict_aliasing
- || (!MEM_ALIAS_SET (mem1) && !MEM_ALIAS_SET (mem2)));
-
- return ! alias_sets_conflict_p (MEM_ALIAS_SET (mem1), MEM_ALIAS_SET (mem2));
+ return (flag_strict_aliasing
+ && ! alias_sets_conflict_p (MEM_ALIAS_SET (mem1),
+ MEM_ALIAS_SET (mem2)));
}
/* Insert the NODE into the splay tree given by DATA. Used by
+2015-01-20 Marek Polacek <polacek@redhat.com>
+
+ Backport from mainline
+ 2014-06-23 Marek Polacek <polacek@redhat.com>
+
+ PR c/61553
+ * c-common.c (get_atomic_generic_size): Don't segfault if the
+ type doesn't have a size.
+
2014-10-30 Release Manager
* GCC 4.9.2 released.
function);
return 0;
}
- size = tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (type)));
+ tree type_size = TYPE_SIZE_UNIT (TREE_TYPE (type));
+ size = type_size ? tree_to_uhwi (type_size) : 0;
if (size != size_0)
{
error_at (loc, "size mismatch in argument %d of %qE", x + 1,
+2015-02-01 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-01-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/64766
+ * c-typeck.c (store_init_value): Don't overwrite DECL_INITIAL
+ of FUNCTION_DECLs with error_mark_node.
+
+ 2015-01-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/64778
+ * c-typeck.c (convert_arguments): Return -1 if there are
+ error_args, even if we've diagnosed too many arguments.
+
2014-10-30 Release Manager
* GCC 4.9.2 released.
else
error_at (loc, "too many arguments to function %qE", function);
inform_declaration (fundecl);
- return parmnum;
+ return error_args ? -1 : (int) parmnum;
}
if (selector && argnum > 2)
warning (OPT_Wtraditional, "traditional C rejects automatic "
"aggregate initialization");
- DECL_INITIAL (decl) = value;
+ if (value != error_mark_node || TREE_CODE (decl) != FUNCTION_DECL)
+ DECL_INITIAL (decl) = value;
/* ANSI wants warnings about out-of-range constant initializers. */
STRIP_TYPE_NOPS (value);
[(set_attr "type" "neon_minmax<q>")]
)
+(define_expand "<su><maxmin>v2di3"
+ [(parallel [
+ (set (match_operand:V2DI 0 "register_operand" "")
+ (MAXMIN:V2DI (match_operand:V2DI 1 "register_operand" "")
+ (match_operand:V2DI 2 "register_operand" "")))
+ (clobber (reg:CC CC_REGNUM))])]
+ "TARGET_SIMD"
+{
+ enum rtx_code cmp_operator;
+ rtx cmp_fmt;
+
+ switch (<CODE>)
+ {
+ case UMIN:
+ cmp_operator = LTU;
+ break;
+ case SMIN:
+ cmp_operator = LT;
+ break;
+ case UMAX:
+ cmp_operator = GTU;
+ break;
+ case SMAX:
+ cmp_operator = GT;
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ cmp_fmt = gen_rtx_fmt_ee (cmp_operator, V2DImode, operands[1], operands[2]);
+ emit_insn (gen_aarch64_vcond_internalv2div2di (operands[0], operands[1],
+ operands[2], cmp_fmt, operands[1], operands[2]));
+ DONE;
+})
+
;; vec_concat gives a new vector with the low elements from operand 1, and
;; the high elements from operand 2. That is to say, given op1 = { a, b }
;; op2 = { c, d }, vec_concat (op1, op2) = { a, b, c, d }.
#ifdef __OPTIMIZE__
extern __inline __m256i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_bslli_epi128 (__m256i __A, const int __N)
+{
+ return (__m256i)__builtin_ia32_pslldqi256 (__A, __N * 8);
+}
+
+extern __inline __m256i
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_slli_si256 (__m256i __A, const int __N)
{
return (__m256i)__builtin_ia32_pslldqi256 (__A, __N * 8);
}
#else
+#define _mm256_bslli_epi128(A, N) \
+ ((__m256i)__builtin_ia32_pslldqi256 ((__m256i)(A), (int)(N) * 8))
#define _mm256_slli_si256(A, N) \
((__m256i)__builtin_ia32_pslldqi256 ((__m256i)(A), (int)(N) * 8))
#endif
#ifdef __OPTIMIZE__
extern __inline __m256i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+_mm256_bsrli_epi128 (__m256i __A, const int __N)
+{
+ return (__m256i)__builtin_ia32_psrldqi256 (__A, __N * 8);
+}
+
+extern __inline __m256i
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_srli_si256 (__m256i __A, const int __N)
{
return (__m256i)__builtin_ia32_psrldqi256 (__A, __N * 8);
}
#else
+#define _mm256_bsrli_epi128(A, N) \
+ ((__m256i)__builtin_ia32_psrldqi256 ((__m256i)(A), (int)(N) * 8))
#define _mm256_srli_si256(A, N) \
((__m256i)__builtin_ia32_psrldqi256 ((__m256i)(A), (int)(N) * 8))
#endif
cpu = "bonnell";
break;
case 0x37:
+ case 0x4a:
case 0x4d:
+ case 0x5a:
+ case 0x5d:
/* Silvermont. */
cpu = "silvermont";
break;
cpu = "ivybridge";
break;
case 0x3c:
+ case 0x3f:
case 0x45:
case 0x46:
/* Haswell. */
cpu = "haswell";
break;
+ case 0x3d:
+ case 0x4f:
+ case 0x56:
+ /* Broadwell. */
+ cpu = "broadwell";
+ break;
+ case 0x57:
+ /* Knights Landing. */
+ cpu = "knl";
+ break;
default:
if (arch)
{
#ifdef __OPTIMIZE__
extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_bsrli_si128 (__m128i __A, const int __N)
+{
+ return (__m128i)__builtin_ia32_psrldqi128 (__A, __N * 8);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_bslli_si128 (__m128i __A, const int __N)
+{
+ return (__m128i)__builtin_ia32_pslldqi128 (__A, __N * 8);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_srli_si128 (__m128i __A, const int __N)
{
return (__m128i)__builtin_ia32_psrldqi128 (__A, __N * 8);
return (__m128i)__builtin_ia32_pslldqi128 (__A, __N * 8);
}
#else
+#define _mm_bsrli_si128(A, N) \
+ ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(A), (int)(N) * 8))
+#define _mm_bslli_si128(A, N) \
+ ((__m128i)__builtin_ia32_pslldqi128 ((__m128i)(A), (int)(N) * 8))
#define _mm_srli_si128(A, N) \
((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(A), (int)(N) * 8))
#define _mm_slli_si128(A, N) \
if (sp_is_cfa_reg)
m->fs.cfa_offset += UNITS_PER_WORD;
RTX_FRAME_RELATED_P (insn) = 1;
+ add_reg_note (insn, REG_FRAME_RELATED_EXPR,
+ gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
+ -UNITS_PER_WORD)));
}
}
if (sp_is_cfa_reg)
m->fs.cfa_offset += UNITS_PER_WORD;
RTX_FRAME_RELATED_P (insn) = 1;
+ add_reg_note (insn, REG_FRAME_RELATED_EXPR,
+ gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
+ -UNITS_PER_WORD)));
}
}
M_AMDFAM15H_BDVER3,
M_AMDFAM15H_BDVER4,
M_INTEL_COREI7_IVYBRIDGE,
- M_INTEL_COREI7_HASWELL
+ M_INTEL_COREI7_HASWELL,
+ M_INTEL_COREI7_BROADWELL
};
static struct _arch_names_table
{"sandybridge", M_INTEL_COREI7_SANDYBRIDGE},
{"ivybridge", M_INTEL_COREI7_IVYBRIDGE},
{"haswell", M_INTEL_COREI7_HASWELL},
+ {"broadwell", M_INTEL_COREI7_BROADWELL},
{"bonnell", M_INTEL_BONNELL},
{"silvermont", M_INTEL_SILVERMONT},
{"amdfam10h", M_AMDFAM10H},
(const_string "ssemov")
(eq_attr "alternative" "19,20")
(const_string "ssecvt")
- (match_operand 1 "pic_32bit_operand")
+ (and (match_operand 0 "register_operand")
+ (match_operand 1 "pic_32bit_operand"))
(const_string "lea")
]
(const_string "imov")))
(const_string "sselog1")
(eq_attr "alternative" "7,8,9,10,12")
(const_string "ssemov")
- (match_operand 1 "pic_32bit_operand")
+ (and (match_operand 0 "register_operand")
+ (match_operand 1 "pic_32bit_operand"))
(const_string "lea")
]
(const_string "imov")))
(symbol_ref "memory_address_length (operands[0], false)"))
(set_attr "memory" "none")])
-(define_insn "*prefetch_prefetchwt1_<mode>"
- [(prefetch (match_operand:P 0 "address_operand" "p")
+(define_insn "*prefetch_prefetchwt1"
+ [(prefetch (match_operand 0 "address_operand" "p")
(const_int 1)
(const_int 2))]
"TARGET_PREFETCHWT1"
;; a segment override. Defined as a special predicate to allow
;; mode-less const_int operands pass to address_operand.
(define_special_predicate "address_no_seg_operand"
- (match_operand 0 "address_operand")
+ (match_test "address_operand (op, VOIDmode)")
{
struct ix86_address parts;
int ok;
+ if (!CONST_INT_P (op)
+ && mode != VOIDmode
+ && GET_MODE (op) != mode)
+ return false;
+
ok = ix86_decompose_address (op, &parts);
gcc_assert (ok);
return parts.seg == SEG_DEFAULT;
;; Return true if op if a valid base register, displacement or
;; sum of base register and displacement for VSIB addressing.
(define_predicate "vsib_address_operand"
- (match_operand 0 "address_operand")
+ (match_test "address_operand (op, VOIDmode)")
{
struct ix86_address parts;
int ok;
movss\t{%2, %0|%0, %2}
movss\t{%2, %0|%0, %2}
vmovss\t{%2, %1, %0|%0, %1, %2}"
- [(set_attr "isa" "sse2,*,noavx,noavx,avx")
+ [(set_attr "isa" "sse2,sse2,noavx,noavx,avx")
(set_attr "type" "ssemov")
(set_attr "prefix" "maybe_vex,maybe_vex,orig,orig,vex")
(set_attr "mode" "TI,TI,V4SF,SF,SF")])
fprintf (file, ")");
}
+/* Implemet TARGET_ASM_FILE_END. */
+
+static void
+nios2_asm_file_end (void)
+{
+ /* The Nios II Linux stack is mapped non-executable by default, so add a
+ .note.GNU-stack section for switching to executable stacks only when
+ trampolines are generated. */
+ if (TARGET_LINUX_ABI && trampolines_created)
+ file_end_indicate_exec_stack ();
+}
+
/* Implement TARGET_ASM_FUNCTION_PROLOGUE. */
static void
nios2_asm_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
#undef TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA
#define TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA nios2_output_addr_const_extra
+#undef TARGET_ASM_FILE_END
+#define TARGET_ASM_FILE_END nios2_asm_file_end
+
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE nios2_option_override
| OPTION_MASK_PPC_GFXOPT \
| OPTION_MASK_PPC_GPOPT \
| OPTION_MASK_QUAD_MEMORY \
+ | OPTION_MASK_QUAD_MEMORY_ATOMIC \
| OPTION_MASK_RECIP_PRECISION \
| OPTION_MASK_SOFT_FLOAT \
| OPTION_MASK_STRICT_ALIGN_OPTIONAL \
them in again. More importantly, the mask we compute here is
used to generate CLOBBERs in the set_vrsave insn, and we do not
wish the argument registers to die. */
- for (i = crtl->args.info.vregno - 1; i >= ALTIVEC_ARG_MIN_REG; --i)
+ for (i = ALTIVEC_ARG_MIN_REG; i < (unsigned) crtl->args.info.vregno; i++)
mask &= ~ALTIVEC_REG_BIT (i);
/* Similarly, remove the return value from the set. */
static rs6000_stack_t *
rs6000_stack_info (void)
{
+ /* We should never be called for thunks, we are not set up for that. */
+ gcc_assert (!cfun->is_thunk);
+
rs6000_stack_t *info_ptr = &stack_info;
int reg_size = TARGET_32BIT ? 4 : 8;
int ehrd_size;
}
}
-/* Write function prologue. */
+/* Output .extern statements for the save/restore routines we use. */
static void
-rs6000_output_function_prologue (FILE *file,
- HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+rs6000_output_savres_externs (FILE *file)
{
rs6000_stack_t *info = rs6000_stack_info ();
fprintf (file, "\t.extern %s\n", name);
}
}
+}
+
+/* Write function prologue. */
+
+static void
+rs6000_output_function_prologue (FILE *file,
+ HOST_WIDE_INT size ATTRIBUTE_UNUSED)
+{
+ if (!cfun->is_thunk)
+ rs6000_output_savres_externs (file);
/* ELFv2 ABI r2 setup code and local entry point. This must follow
immediately after the global entry point label. */
if (complement_op2_p)
op2 = gen_rtx_NOT (mode, op2);
+ /* For canonical RTL, if only one arm is inverted it is the first. */
+ if (!complement_op1_p && complement_op2_p)
+ {
+ rtx temp = op1;
+ op1 = op2;
+ op2 = temp;
+ }
+
bool_rtx = ((code == NOT)
? gen_rtx_NOT (mode, op1)
: gen_rtx_fmt_ee (code, mode, op1, op2));
[(set (match_operand:BOOL_128 0 "vlogical_operand" "=<BOOL_REGS_OUTPUT>")
(match_operator:BOOL_128 3 "boolean_operator"
[(not:BOOL_128
- (match_operand:BOOL_128 2 "vlogical_operand" "<BOOL_REGS_OP1>"))
- (match_operand:BOOL_128 1 "vlogical_operand" "<BOOL_REGS_OP2>")]))]
+ (match_operand:BOOL_128 2 "vlogical_operand" "<BOOL_REGS_OP2>"))
+ (match_operand:BOOL_128 1 "vlogical_operand" "<BOOL_REGS_OP1>")]))]
"TARGET_P8_VECTOR || (GET_CODE (operands[3]) == AND)"
{
if (TARGET_VSX && vsx_register_operand (operands[0], <MODE>mode))
&& reload_completed && int_reg_operand (operands[0], <MODE>mode)"
[(const_int 0)]
{
- rs6000_split_logical (operands, GET_CODE (operands[3]), false, true, false,
+ rs6000_split_logical (operands, GET_CODE (operands[3]), false, false, true,
NULL_RTX);
DONE;
}
[(set (match_operand:TI2 0 "int_reg_operand" "=&r,r,r")
(match_operator:TI2 3 "boolean_operator"
[(not:TI2
- (match_operand:TI2 1 "int_reg_operand" "r,0,r"))
- (match_operand:TI2 2 "int_reg_operand" "r,r,0")]))]
+ (match_operand:TI2 2 "int_reg_operand" "r,0,r"))
+ (match_operand:TI2 1 "int_reg_operand" "r,r,0")]))]
"!TARGET_P8_VECTOR && (GET_CODE (operands[3]) != AND)"
"#"
"reload_completed && !TARGET_P8_VECTOR && (GET_CODE (operands[3]) != AND)"
[(const_int 0)]
{
- rs6000_split_logical (operands, GET_CODE (operands[3]), false, true, false,
+ rs6000_split_logical (operands, GET_CODE (operands[3]), false, false, true,
NULL_RTX);
DONE;
}
/* Implement TARGET_REGISTER_MOVE_COST. */
static int
-s390_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
+s390_register_move_cost (enum machine_mode mode,
reg_class_t from, reg_class_t to)
{
- /* On s390, copy between fprs and gprs is expensive as long as no
- ldgr/lgdr can be used. */
- if ((!TARGET_Z10 || GET_MODE_SIZE (mode) != 8)
- && ((reg_classes_intersect_p (from, GENERAL_REGS)
- && reg_classes_intersect_p (to, FP_REGS))
- || (reg_classes_intersect_p (from, FP_REGS)
- && reg_classes_intersect_p (to, GENERAL_REGS))))
+ /* On s390, copy between fprs and gprs is expensive. */
+
+ /* It becomes somewhat faster having ldgr/lgdr. */
+ if (TARGET_Z10 && GET_MODE_SIZE (mode) == 8)
+ {
+ /* ldgr is single cycle. */
+ if (reg_classes_intersect_p (from, GENERAL_REGS)
+ && reg_classes_intersect_p (to, FP_REGS))
+ return 1;
+ /* lgdr needs 3 cycles. */
+ if (reg_classes_intersect_p (to, GENERAL_REGS)
+ && reg_classes_intersect_p (from, FP_REGS))
+ return 3;
+ }
+
+ /* Otherwise copying is done via memory. */
+ if ((reg_classes_intersect_p (from, GENERAL_REGS)
+ && reg_classes_intersect_p (to, FP_REGS))
+ || (reg_classes_intersect_p (from, FP_REGS)
+ && reg_classes_intersect_p (to, GENERAL_REGS)))
return 10;
return 1;
reg_class_t rclass ATTRIBUTE_UNUSED,
bool in ATTRIBUTE_UNUSED)
{
- return 1;
+ return 2;
}
/* Compute a (partial) cost for rtx X. Return true if the complete
;; This iterator and attribute allow to combine most atomic operations.
(define_code_iterator ATOMIC [and ior xor plus minus mult])
(define_code_iterator ATOMIC_Z196 [and ior xor plus])
-(define_code_attr atomic [(and "and") (ior "ior") (xor "xor")
+(define_code_attr atomic [(and "and") (ior "or") (xor "xor")
(plus "add") (minus "sub") (mult "nand")])
(define_code_attr noxa [(and "n") (ior "o") (xor "x") (plus "a")])
+2015-02-04 Ville Voutilainen <ville.voutilainen@gmail.com>
+
+ PR c++/64901
+ * decl.c (duplicate_decls): Also duplicate DECL_FINAL_P and
+ DECL_OVERRIDE_P.
+
+2015-01-29 Jason Merrill <jason@redhat.com>
+
+ PR c++/64521
+ * repo.c (repo_emit_p): It's OK for a clone to be extern at this
+ point.
+
+2015-01-13 Jason Merrill <jason@redhat.com>
+
+ PR c++/64514
+ * pt.c (coerce_template_parameter_pack): Return NULL for a
+ zero-length fixed parameter pack with a pack expansion arg.
+
2015-01-07 Jason Merrill <jason@redhat.com>
PR c++/64487
DECL_PURE_VIRTUAL_P (newdecl) |= DECL_PURE_VIRTUAL_P (olddecl);
DECL_VIRTUAL_P (newdecl) |= DECL_VIRTUAL_P (olddecl);
DECL_INVALID_OVERRIDER_P (newdecl) |= DECL_INVALID_OVERRIDER_P (olddecl);
+ DECL_FINAL_P (newdecl) |= DECL_FINAL_P (olddecl);
+ DECL_OVERRIDE_P (newdecl) |= DECL_OVERRIDE_P (olddecl);
DECL_THIS_STATIC (newdecl) |= DECL_THIS_STATIC (olddecl);
if (DECL_OVERLOADED_OPERATOR_P (olddecl) != ERROR_MARK)
SET_OVERLOADED_OPERATOR_CODE
if (invalid_nontype_parm_type_p (t, complain))
return error_mark_node;
}
+ /* We don't know how many args we have yet, just
+ use the unconverted ones for now. */
+ return NULL_TREE;
}
packed_args = make_tree_vec (TREE_VEC_LENGTH (packed_parms));
int ret = 0;
gcc_assert (TREE_PUBLIC (decl));
gcc_assert (VAR_OR_FUNCTION_DECL_P (decl));
- gcc_assert (!DECL_REALLY_EXTERN (decl));
+ gcc_assert (!DECL_REALLY_EXTERN (decl)
+ /* A clone might not have its linkage flags updated yet
+ because we call import_export_decl before
+ maybe_clone_body. */
+ || DECL_ABSTRACT_ORIGIN (decl));
/* When not using the repository, emit everything. */
if (!flag_use_repository)
}
new_elt = insert (exp, class1, hash, mode);
new_elt->in_memory = hash_arg_in_memory;
+ if (GET_CODE (exp) == ASM_OPERANDS && elt->cost == MAX_COST)
+ new_elt->cost = MAX_COST;
}
}
}
{
int i, lim = XVECLEN (x, 0);
- /* Go over the epressions of the PARALLEL in forward order, to
+ /* Go over the expressions of the PARALLEL in forward order, to
put them in the same order in the SETS array. */
for (i = 0; i < lim; i++)
{
&& REGNO (dest) >= FIRST_PSEUDO_REGISTER)
sets[i].src_volatile = 1;
- /* Also do not record result of a non-volatile inline asm with
- more than one result or with clobbers, we do not want CSE to
- break the inline asm apart. */
else if (GET_CODE (src) == ASM_OPERANDS
&& GET_CODE (x) == PARALLEL)
- sets[i].src_volatile = 1;
+ {
+ /* Do not record result of a non-volatile inline asm with
+ more than one result. */
+ if (n_sets > 1)
+ sets[i].src_volatile = 1;
+
+ int j, lim = XVECLEN (x, 0);
+ for (j = 0; j < lim; j++)
+ {
+ rtx y = XVECEXP (x, 0, j);
+ /* And do not record result of a non-volatile inline asm
+ with "memory" clobber. */
+ if (GET_CODE (y) == CLOBBER && MEM_P (XEXP (y, 0)))
+ {
+ sets[i].src_volatile = 1;
+ break;
+ }
+ }
+ }
#if 0
/* It is no longer clear why we used to do this, but it doesn't
;
/* Look for a substitution that makes a valid insn. */
- else if (validate_unshare_change
- (insn, &SET_SRC (sets[i].rtl), trial, 0))
+ else if (validate_unshare_change (insn, &SET_SRC (sets[i].rtl),
+ trial, 0))
{
rtx new_rtx = canon_reg (SET_SRC (sets[i].rtl), insn);
}
elt = insert (src, classp, sets[i].src_hash, mode);
elt->in_memory = sets[i].src_in_memory;
+ /* If inline asm has any clobbers, ensure we only reuse
+ existing inline asms and never try to put the ASM_OPERANDS
+ into an insn that isn't inline asm. */
+ if (GET_CODE (src) == ASM_OPERANDS
+ && GET_CODE (x) == PARALLEL)
+ elt->cost = MAX_COST;
sets[i].src_elt = classp = elt;
}
if (sets[i].src_const && sets[i].src_const_elt == 0
}
src_elt = insert (new_src, classp, src_hash, new_mode);
src_elt->in_memory = elt->in_memory;
+ if (GET_CODE (new_src) == ASM_OPERANDS
+ && elt->cost == MAX_COST)
+ src_elt->cost = MAX_COST;
}
else if (classp && classp != src_elt->first_same_value)
/* Show that two things that we've seen before are
= rtx_group_vec[group_id];
mem_addr = group->canon_base_addr;
}
+ /* get_addr can only handle VALUE but cannot handle expr like:
+ VALUE + OFFSET, so call get_addr to get original addr for
+ mem_addr before plus_constant. */
+ mem_addr = get_addr (mem_addr);
if (offset)
mem_addr = plus_constant (get_address_mode (mem), mem_addr, offset);
}
= rtx_group_vec[group_id];
mem_addr = group->canon_base_addr;
}
+ /* get_addr can only handle VALUE but cannot handle expr like:
+ VALUE + OFFSET, so call get_addr to get original addr for
+ mem_addr before plus_constant. */
+ mem_addr = get_addr (mem_addr);
if (offset)
mem_addr = plus_constant (get_address_mode (mem), mem_addr, offset);
}
/* Return how many bits covers PIECE EXPR_LIST. */
-static int
+static HOST_WIDE_INT
decl_piece_bitsize (rtx piece)
{
int ret = (int) GET_MODE (piece);
static rtx
decl_piece_node (rtx loc_note, HOST_WIDE_INT bitsize, rtx next)
{
- if (bitsize <= (int) MAX_MACHINE_MODE)
+ if (bitsize > 0 && bitsize <= (int) MAX_MACHINE_MODE)
return alloc_EXPR_LIST (bitsize, loc_note, next);
else
return alloc_EXPR_LIST (0, gen_rtx_CONCAT (VOIDmode,
HOST_WIDE_INT bitpos, HOST_WIDE_INT piece_bitpos,
HOST_WIDE_INT bitsize, rtx loc_note)
{
- int diff;
+ HOST_WIDE_INT diff;
bool copy = inner != NULL;
if (copy)
{
struct var_loc_node *last = temp->last, *unused = NULL;
rtx *piece_loc = NULL, last_loc_note;
- int piece_bitpos = 0;
+ HOST_WIDE_INT piece_bitpos = 0;
if (last->next)
{
last = last->next;
piece_loc = &last->loc;
do
{
- int cur_bitsize = decl_piece_bitsize (*piece_loc);
+ HOST_WIDE_INT cur_bitsize = decl_piece_bitsize (*piece_loc);
if (piece_bitpos + cur_bitsize > bitpos)
break;
piece_bitpos += cur_bitsize;
dw_sra_loc_expr (tree decl, rtx loc)
{
rtx p;
- unsigned int padsize = 0;
+ unsigned HOST_WIDE_INT padsize = 0;
dw_loc_descr_ref descr, *descr_tail;
unsigned HOST_WIDE_INT decl_size;
rtx varloc;
for (p = loc; p; p = XEXP (p, 1))
{
- unsigned int bitsize = decl_piece_bitsize (p);
+ unsigned HOST_WIDE_INT bitsize = decl_piece_bitsize (p);
rtx loc_note = *decl_piece_varloc_ptr (p);
dw_loc_descr_ref cur_descr;
dw_loc_descr_ref *tail, last = NULL;
- unsigned int opsize = 0;
+ unsigned HOST_WIDE_INT opsize = 0;
if (loc_note == NULL_RTX
|| NOTE_VAR_LOCATION_LOC (loc_note) == NULL_RTX)
/* Locations in memory are described using a sequence of stack machine
operations. */
-struct GTY(()) dw_loc_descr_node {
+struct GTY((chain_next ("%h.dw_loc_next"))) dw_loc_descr_node {
dw_loc_descr_ref dw_loc_next;
ENUM_BITFIELD (dwarf_location_atom) dw_loc_opc : 8;
/* Used to distinguish DW_OP_addr with a direct symbol relocation
tree tem = get_inner_reference (exp, &bitsize, &bitpos, &offset,
&mode1, &unsignedp, &volatilep, true);
rtx orig_op0, memloc;
- bool mem_attrs_from_type = false;
+ bool clear_mem_expr = false;
/* If we got back the original object, something is wrong. Perhaps
we are evaluating an expression too early. In any event, don't
memloc = assign_temp (TREE_TYPE (tem), 1, 1);
emit_move_insn (memloc, op0);
op0 = memloc;
- mem_attrs_from_type = true;
+ clear_mem_expr = true;
}
if (offset)
if (op0 == orig_op0)
op0 = copy_rtx (op0);
- /* If op0 is a temporary because of forcing to memory, pass only the
- type to set_mem_attributes so that the original expression is never
- marked as ADDRESSABLE through MEM_EXPR of the temporary. */
- if (mem_attrs_from_type)
- set_mem_attributes (op0, type, 0);
- else
- set_mem_attributes (op0, exp, 0);
+ set_mem_attributes (op0, exp, 0);
if (REG_P (XEXP (op0, 0)))
mark_reg_pointer (XEXP (op0, 0), MEM_ALIGN (op0));
+ /* If op0 is a temporary because the original expressions was forced
+ to memory, clear MEM_EXPR so that the original expression cannot
+ be marked as addressable through MEM_EXPR of the temporary. */
+ if (clear_mem_expr)
+ set_mem_expr (op0, NULL_TREE);
+
MEM_VOLATILE_P (op0) |= volatilep;
if (mode == mode1 || mode1 == BLKmode || mode1 == tmode
|| modifier == EXPAND_CONST_ADDRESS
+2015-02-03 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ * intrinsic.texi (CO_ASSOCIATED): c_prt_1 should be c_ptr_1.
+
+2015-01-27 Paul Thomas <pault@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/62044
+ * resolve.c (resolve_allocate_expr): If the default initializer
+ is NULL, keep the original MOLD expression so that the correct
+ typespec is available.
+
+2015-01-27 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/64771
+ * interface.c (check_dummy_characteristics): Fix coarray handling.
+
+2015-01-26 Janus Weil <janus@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/64230
+ * class.c (finalize_component): New argument 'sub_ns'. Insert code to
+ check if 'expr' is associated.
+ (generate_finalization_wrapper): Rename 'ptr' symbols to 'ptr1' and
+ 'ptr2'. Pass 'sub_ns' to finalize_component.
+
+2015-01-24 Thomas Koenig <tkoenig@netcologne.de>
+
+ Backport from trunk
+ PR fortran/57023
+ * dependency.c (callback_dummy_intent_not_int): New function.
+ (dummy_intent_not_in): New function.
+ (gfc_full_array_ref_p): Use dummy_intent_not_in.
+
+2015-01-24 Janus Weil <janus@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/60922
+ * class.c (finalize_component): Apply the check for 'fini_coarray' only
+ to coarray components.
+
+2015-01-14 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-01-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/64528
+ * trans-decl.c (create_function_arglist): Don't set TREE_READONLY
+ on dummy args with VALUE attribute.
+
2015-01-12 Janus Weil <janus@gcc.gnu.org>
Backport from mainline
static void
finalize_component (gfc_expr *expr, gfc_symbol *derived, gfc_component *comp,
- gfc_symbol *stat, gfc_symbol *fini_coarray, gfc_code **code)
+ gfc_symbol *stat, gfc_symbol *fini_coarray, gfc_code **code,
+ gfc_namespace *sub_ns)
{
gfc_expr *e;
gfc_ref *ref;
/* Add IF (fini_coarray). */
if (comp->attr.codimension
|| (comp->ts.type == BT_CLASS && CLASS_DATA (comp)
- && CLASS_DATA (comp)->attr.allocatable))
+ && CLASS_DATA (comp)->attr.codimension))
{
block = gfc_get_code (EXEC_IF);
if (*code)
dealloc->ext.alloc.list->expr = e;
dealloc->expr1 = gfc_lval_expr_from_sym (stat);
+ gfc_code *cond = gfc_get_code (EXEC_IF);
+ cond->block = gfc_get_code (EXEC_IF);
+ cond->block->expr1 = gfc_get_expr ();
+ cond->block->expr1->expr_type = EXPR_FUNCTION;
+ gfc_get_sym_tree ("associated", sub_ns, &cond->block->expr1->symtree, false);
+ cond->block->expr1->symtree->n.sym->attr.flavor = FL_PROCEDURE;
+ cond->block->expr1->symtree->n.sym->attr.intrinsic = 1;
+ cond->block->expr1->symtree->n.sym->result = cond->block->expr1->symtree->n.sym;
+ gfc_commit_symbol (cond->block->expr1->symtree->n.sym);
+ cond->block->expr1->ts.type = BT_LOGICAL;
+ cond->block->expr1->ts.kind = gfc_default_logical_kind;
+ cond->block->expr1->value.function.isym = gfc_intrinsic_function_by_id (GFC_ISYM_ASSOCIATED);
+ cond->block->expr1->value.function.actual = gfc_get_actual_arglist ();
+ cond->block->expr1->value.function.actual->expr = gfc_copy_expr (expr);
+ cond->block->expr1->value.function.actual->next = gfc_get_actual_arglist ();
+ cond->block->next = dealloc;
+
if (block)
- block->next = dealloc;
+ block->next = cond;
else if (*code)
{
- (*code)->next = dealloc;
+ (*code)->next = cond;
(*code) = (*code)->next;
}
else
- (*code) = dealloc;
+ (*code) = cond;
}
else if (comp->ts.type == BT_DERIVED
&& comp->ts.u.derived->f2k_derived
gfc_component *c;
for (c = comp->ts.u.derived->components; c; c = c->next)
- finalize_component (e, comp->ts.u.derived, c, stat, fini_coarray, code);
+ finalize_component (e, comp->ts.u.derived, c, stat, fini_coarray, code,
+ sub_ns);
gfc_free_expr (e);
}
}
{
gfc_finalizer *fini, *fini_elem = NULL;
- gfc_get_symbol ("ptr", sub_ns, &ptr);
+ gfc_get_symbol ("ptr1", sub_ns, &ptr);
ptr->ts.type = BT_DERIVED;
ptr->ts.u.derived = derived;
ptr->attr.flavor = FL_VARIABLE;
if (!ptr)
{
- gfc_get_symbol ("ptr", sub_ns, &ptr);
+ gfc_get_symbol ("ptr2", sub_ns, &ptr);
ptr->ts.type = BT_DERIVED;
ptr->ts.u.derived = derived;
ptr->attr.flavor = FL_VARIABLE;
continue;
finalize_component (gfc_lval_expr_from_sym (ptr), derived, comp,
- stat, fini_coarray, &block);
+ stat, fini_coarray, &block, sub_ns);
if (!last_code->block->next)
last_code->block->next = block;
}
return GFC_DEP_EQUAL;
}
+/* Callback function for checking if an expression depends on a
+ dummy variable which is any other than INTENT(IN). */
+
+static int
+callback_dummy_intent_not_in (gfc_expr **ep,
+ int *walk_subtrees ATTRIBUTE_UNUSED,
+ void *data ATTRIBUTE_UNUSED)
+{
+ gfc_expr *e = *ep;
+
+ if (e->expr_type == EXPR_VARIABLE && e->symtree
+ && e->symtree->n.sym->attr.dummy)
+ return e->symtree->n.sym->attr.intent != INTENT_IN;
+ else
+ return 0;
+}
+
+/* Auxiliary function to check if subexpressions have dummy variables which
+ are not intent(in).
+*/
+
+static bool
+dummy_intent_not_in (gfc_expr **ep)
+{
+ return gfc_expr_walker (ep, callback_dummy_intent_not_in, NULL);
+}
/* Determine if an array ref, usually an array section specifies the
entire array. In addition, if the second, pointer argument is
provided, the function will return true if the reference is
- contiguous; eg. (:, 1) gives true but (1,:) gives false. */
+ contiguous; eg. (:, 1) gives true but (1,:) gives false.
+ If one of the bounds depends on a dummy variable which is
+ not INTENT(IN), also return false, because the user may
+ have changed the variable. */
bool
gfc_full_array_ref_p (gfc_ref *ref, bool *contiguous)
&& (!ref->u.ar.as
|| !ref->u.ar.as->lower[i]
|| gfc_dep_compare_expr (ref->u.ar.start[i],
- ref->u.ar.as->lower[i])))
+ ref->u.ar.as->lower[i])
+ || dummy_intent_not_in (&ref->u.ar.start[i])))
lbound_OK = false;
/* Check the upper bound. */
if (ref->u.ar.end[i]
&& (!ref->u.ar.as
|| !ref->u.ar.as->upper[i]
|| gfc_dep_compare_expr (ref->u.ar.end[i],
- ref->u.ar.as->upper[i])))
+ ref->u.ar.as->upper[i])
+ || dummy_intent_not_in (&ref->u.ar.end[i])))
ubound_OK = false;
/* Check the stride. */
if (ref->u.ar.stride[i]
return false;
}
+ if (s1->as->corank != s2->as->corank)
+ {
+ snprintf (errmsg, err_len, "Corank mismatch in argument '%s' (%i/%i)",
+ s1->name, s1->as->corank, s2->as->corank);
+ return false;
+ }
+
if (s1->as->type == AS_EXPLICIT)
- for (i = 0; i < s1->as->rank + s1->as->corank; i++)
+ for (i = 0; i < s1->as->rank + MAX (0, s1->as->corank-1); i++)
{
shape1 = gfc_subtract (gfc_copy_expr (s1->as->upper[i]),
gfc_copy_expr (s1->as->lower[i]));
case -1:
case 1:
case -3:
- snprintf (errmsg, err_len, "Shape mismatch in dimension %i of "
- "argument '%s'", i + 1, s1->name);
+ if (i < s1->as->rank)
+ snprintf (errmsg, err_len, "Shape mismatch in dimension %i of"
+ " argument '%s'", i + 1, s1->name);
+ else
+ snprintf (errmsg, err_len, "Shape mismatch in codimension %i "
+ "of argument '%s'", i - s1->as->rank + 1, s1->name);
return false;
case -2:
@table @asis
@item @emph{Description}:
-@code{C_ASSOCIATED(c_prt_1[, c_ptr_2])} determines the status of the C pointer
+@code{C_ASSOCIATED(c_ptr_1[, c_ptr_2])} determines the status of the C pointer
@var{c_ptr_1} or if @var{c_ptr_1} is associated with the target @var{c_ptr_2}.
@item @emph{Standard}:
Inquiry function
@item @emph{Syntax}:
-@code{RESULT = C_ASSOCIATED(c_prt_1[, c_ptr_2])}
+@code{RESULT = C_ASSOCIATED(c_ptr_1[, c_ptr_2])}
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
&& sym->ns->proc_name->attr.flavor != FL_MODULE)
{
if (!gfc_notify_std (GFC_STD_F2008, "Internal procedure '%s' is"
- " used as actual argument at %L",
+ " used as actual argument at %L",
sym->name, &e->where))
goto cleanup;
}
if (!gfc_compare_interfaces (sym, def_sym, sym->name, 0, 1,
reason, sizeof(reason), NULL, NULL))
- {
+ {
gfc_error ("Interface mismatch in global procedure '%s' at %L: %s ",
sym->name, &sym->declared_at, reason);
goto done;
if (sym->attr.if_source != IFSRC_IFBODY)
gfc_procedure_use (def_sym, actual, where);
}
-
+
done:
gfc_errors_to_warnings (0);
if (intr)
{
- if (!gfc_convert_to_structure_constructor (expr, intr->sym, NULL,
+ if (!gfc_convert_to_structure_constructor (expr, intr->sym, NULL,
NULL, false))
return false;
return resolve_structure_cons (expr, 0);
no_formal_args = sym && is_external_proc (sym)
&& gfc_sym_get_dummy_args (sym) == NULL;
- if (!resolve_actual_arglist (expr->value.function.actual,
+ if (!resolve_actual_arglist (expr->value.function.actual,
p, no_formal_args))
{
inquiry_argument = false;
}
if (index->ts.type == BT_REAL)
- if (!gfc_notify_std (GFC_STD_LEGACY, "REAL array index at %L",
+ if (!gfc_notify_std (GFC_STD_LEGACY, "REAL array index at %L",
&index->where))
return false;
/* Get the CLASS declared type. */
declared = get_declared_from_expr (&class_ref, &new_ref, e, true);
-
+
if (!resolve_fl_derived (declared))
return false;
c->ext.actual = c->expr1->value.compcall.actual;
- if (!resolve_actual_arglist (c->ext.actual, comp->attr.proc,
- !(comp->ts.interface
+ if (!resolve_actual_arglist (c->ext.actual, comp->attr.proc,
+ !(comp->ts.interface
&& comp->ts.interface->formal)))
return false;
if (!resolve_ref (e))
return false;
- if (!resolve_actual_arglist (e->value.function.actual, comp->attr.proc,
- !(comp->ts.interface
+ if (!resolve_actual_arglist (e->value.function.actual, comp->attr.proc,
+ !(comp->ts.interface
&& comp->ts.interface->formal)))
return false;
if (!gfc_resolve_iterator_expr (iter->var, real_ok, "Loop variable"))
return false;
- if (!gfc_check_vardef_context (iter->var, false, false, own_scope,
+ if (!gfc_check_vardef_context (iter->var, false, false, own_scope,
_("iterator variable")))
return false;
- if (!gfc_resolve_iterator_expr (iter->start, real_ok,
+ if (!gfc_resolve_iterator_expr (iter->start, real_ok,
"Start expression in DO loop"))
return false;
- if (!gfc_resolve_iterator_expr (iter->end, real_ok,
+ if (!gfc_resolve_iterator_expr (iter->end, real_ok,
"End expression in DO loop"))
return false;
- if (!gfc_resolve_iterator_expr (iter->step, real_ok,
+ if (!gfc_resolve_iterator_expr (iter->step, real_ok,
"Step expression in DO loop"))
return false;
}
if (pointer
- && !gfc_check_vardef_context (e, true, true, false,
+ && !gfc_check_vardef_context (e, true, true, false,
_("DEALLOCATE object")))
return false;
- if (!gfc_check_vardef_context (e, false, true, false,
+ if (!gfc_check_vardef_context (e, false, true, false,
_("DEALLOCATE object")))
return false;
e2 = remove_last_array_ref (e);
t = true;
if (t && pointer)
- t = gfc_check_vardef_context (e2, true, true, false,
+ t = gfc_check_vardef_context (e2, true, true, false,
_("ALLOCATE object"));
if (t)
- t = gfc_check_vardef_context (e2, false, true, false,
+ t = gfc_check_vardef_context (e2, false, true, false,
_("ALLOCATE object"));
gfc_free_expr (e2);
if (!t)
{
/* Default initialization via MOLD (non-polymorphic). */
gfc_expr *rhs = gfc_default_initializer (&code->expr3->ts);
- gfc_resolve_expr (rhs);
- gfc_free_expr (code->expr3);
- code->expr3 = rhs;
+ if (rhs != NULL)
+ {
+ gfc_resolve_expr (rhs);
+ gfc_free_expr (code->expr3);
+ code->expr3 = rhs;
+ }
}
if (e->ts.type == BT_CLASS && !unlimited && !UNLIMITED_POLY (code->expr3))
/* Check the stat variable. */
if (stat)
{
- gfc_check_vardef_context (stat, false, false, false,
+ gfc_check_vardef_context (stat, false, false, false,
_("STAT variable"));
if ((stat->ts.type != BT_INTEGER
code->ext.dt may be NULL if the TRANSFER is related to
an INQUIRE statement -- but in this case, we are not reading, either. */
if (code->ext.dt && code->ext.dt->dt_io_kind->value.iokind == M_READ
- && !gfc_check_vardef_context (exp, false, false, false,
+ && !gfc_check_vardef_context (exp, false, false, false,
_("item in READ")))
return;
&code->expr2->where);
if (code->expr2
- && !gfc_check_vardef_context (code->expr2, false, false, false,
+ && !gfc_check_vardef_context (code->expr2, false, false, false,
_("STAT variable")))
return;
&code->expr3->where);
if (code->expr3
- && !gfc_check_vardef_context (code->expr3, false, false, false,
+ && !gfc_check_vardef_context (code->expr3, false, false, false,
_("ERRMSG variable")))
return;
"variable", &code->expr4->where);
if (code->expr4
- && !gfc_check_vardef_context (code->expr4, false, false, false,
+ && !gfc_check_vardef_context (code->expr4, false, false, false,
_("ACQUIRED_LOCK variable")))
return;
}
if (rhs->is_boz
&& !gfc_notify_std (GFC_STD_GNU, "BOZ literal at %L outside "
- "a DATA statement and outside INT/REAL/DBLE/CMPLX",
+ "a DATA statement and outside INT/REAL/DBLE/CMPLX",
&code->loc))
return false;
if (!t)
break;
- if (!gfc_check_vardef_context (code->expr1, false, false, false,
+ if (!gfc_check_vardef_context (code->expr1, false, false, false,
_("assignment")))
break;
return false;
}
else if (!gfc_notify_std (GFC_STD_F2003, "Scalar object "
- "'%s' at %L may not be ALLOCATABLE",
+ "'%s' at %L may not be ALLOCATABLE",
sym->name, &sym->declared_at))
return false;
}
&& !gfc_check_symbol_access (arg->sym->ts.u.derived)
&& !gfc_notify_std (GFC_STD_F2003, "'%s' is of a PRIVATE type "
"and cannot be a dummy argument"
- " of '%s', which is PUBLIC at %L",
- arg->sym->name, sym->name,
+ " of '%s', which is PUBLIC at %L",
+ arg->sym->name, sym->name,
&sym->declared_at))
{
/* Stop this message from recurring. */
&& !gfc_notify_std (GFC_STD_F2003, "Procedure '%s' in "
"PUBLIC interface '%s' at %L "
"takes dummy arguments of '%s' which "
- "is PRIVATE", iface->sym->name,
- sym->name, &iface->sym->declared_at,
+ "is PRIVATE", iface->sym->name,
+ sym->name, &iface->sym->declared_at,
gfc_typename(&arg->sym->ts)))
{
/* Stop this message from recurring. */
&& !gfc_notify_std (GFC_STD_F2003, "Procedure '%s' in "
"PUBLIC interface '%s' at %L takes "
"dummy arguments of '%s' which is "
- "PRIVATE", iface->sym->name,
- sym->name, &iface->sym->declared_at,
+ "PRIVATE", iface->sym->name,
+ sym->name, &iface->sym->declared_at,
gfc_typename(&arg->sym->ts)))
{
/* Stop this message from recurring. */
gfc_formal_arglist *curr_arg;
int has_non_interop_arg = 0;
- if (!verify_bind_c_sym (sym, &(sym->ts), sym->attr.in_common,
+ if (!verify_bind_c_sym (sym, &(sym->ts), sym->attr.in_common,
sym->common_block))
{
/* Clear these to prevent looking at them again if there was an
for (op = 0; op != GFC_INTRINSIC_OPS; ++op)
{
gfc_typebound_proc* p = derived->f2k_derived->tb_op[op];
- if (p && !resolve_typebound_intrinsic_op (derived,
+ if (p && !resolve_typebound_intrinsic_op (derived,
(gfc_intrinsic_op)op, p))
resolve_bindings_result = false;
}
&& !gfc_check_symbol_access (c->ts.u.derived)
&& !gfc_notify_std (GFC_STD_F2003, "the component '%s' is a "
"PRIVATE type and cannot be a component of "
- "'%s', which is PUBLIC at %L", c->name,
+ "'%s', which is PUBLIC at %L", c->name,
sym->name, &sym->declared_at))
return false;
&& sym != c->ts.u.derived)
add_dt_to_dt_list (c->ts.u.derived);
- if (!gfc_resolve_array_spec (c->as,
- !(c->attr.pointer || c->attr.proc_pointer
+ if (!gfc_resolve_array_spec (c->as,
+ !(c->attr.pointer || c->attr.proc_pointer
|| c->attr.allocatable)))
return false;
|| gen_dt->generic->sym->module != gen_dt->generic->next->sym->module)
&& !gfc_notify_std (GFC_STD_F2003, "Generic name '%s' of function "
"'%s' at %L being the same name as derived "
- "type at %L", sym->name,
- gen_dt->generic->sym == sym
- ? gen_dt->generic->next->sym->name
- : gen_dt->generic->sym->name,
- gen_dt->generic->sym == sym
- ? &gen_dt->generic->next->sym->declared_at
- : &gen_dt->generic->sym->declared_at,
+ "type at %L", sym->name,
+ gen_dt->generic->sym == sym
+ ? gen_dt->generic->next->sym->name
+ : gen_dt->generic->sym->name,
+ gen_dt->generic->sym == sym
+ ? &gen_dt->generic->next->sym->declared_at
+ : &gen_dt->generic->sym->declared_at,
&sym->declared_at))
return false;
if (nl->sym->as && nl->sym->as->type == AS_ASSUMED_SHAPE
&& !gfc_notify_std (GFC_STD_F2003, "NAMELIST array object '%s' "
- "with assumed shape in namelist '%s' at %L",
+ "with assumed shape in namelist '%s' at %L",
nl->sym->name, sym->name, &sym->declared_at))
return false;
if (is_non_constant_shape_array (nl->sym)
&& !gfc_notify_std (GFC_STD_F2003, "NAMELIST array object '%s' "
- "with nonconstant shape in namelist '%s' at %L",
+ "with nonconstant shape in namelist '%s' at %L",
nl->sym->name, sym->name, &sym->declared_at))
return false;
|| !gfc_is_constant_expr (nl->sym->ts.u.cl->length))
&& !gfc_notify_std (GFC_STD_F2003, "NAMELIST object '%s' with "
"nonconstant character length in "
- "namelist '%s' at %L", nl->sym->name,
+ "namelist '%s' at %L", nl->sym->name,
sym->name, &sym->declared_at))
return false;
{
if (!gfc_notify_std (GFC_STD_F2003, "NAMELIST object '%s' in "
"namelist '%s' at %L with ALLOCATABLE "
- "or POINTER components", nl->sym->name,
+ "or POINTER components", nl->sym->name,
sym->name, &sym->declared_at))
return false;
&& gfc_check_symbol_access (sym)
&& !gfc_check_symbol_access (sym->ts.u.derived)
&& !gfc_notify_std (GFC_STD_F2003, "PUBLIC %s '%s' at %L of PRIVATE "
- "derived type '%s'",
- (sym->attr.flavor == FL_PARAMETER)
- ? "parameter" : "variable",
- sym->name, &sym->declared_at,
+ "derived type '%s'",
+ (sym->attr.flavor == FL_PARAMETER)
+ ? "parameter" : "variable",
+ sym->name, &sym->declared_at,
sym->ts.u.derived->name))
return;
if (!gfc_logical_kinds[i].c_bool && sym->attr.dummy
&& !gfc_notify_std (GFC_STD_GNU, "LOGICAL dummy argument '%s' at "
"%L with non-C_Bool kind in BIND(C) procedure "
- "'%s'", sym->name, &sym->declared_at,
+ "'%s'", sym->name, &sym->declared_at,
sym->ns->proc_name->name))
return;
else if (!gfc_logical_kinds[i].c_bool
&& !gfc_notify_std (GFC_STD_GNU, "LOGICAL result variable "
"'%s' at %L with non-C_Bool kind in "
- "BIND(C) procedure '%s'", sym->name,
- &sym->declared_at,
- sym->attr.function ? sym->name
+ "BIND(C) procedure '%s'", sym->name,
+ &sym->declared_at,
+ sym->attr.function ? sym->name
: sym->ns->proc_name->name))
return;
}
unsigned letter;
for (letter = 0; letter != GFC_LETTERS; ++letter)
if (ns->set_flag[letter]
- && !resolve_typespec_used (&ns->default_type[letter],
+ && !resolve_typespec_used (&ns->default_type[letter],
&ns->implicit_loc[letter], NULL))
return;
}
/* Fill in arg stuff. */
DECL_CONTEXT (parm) = fndecl;
DECL_ARG_TYPE (parm) = TREE_VALUE (typelist);
- /* All implementation args are read-only. */
- TREE_READONLY (parm) = 1;
+ /* All implementation args except for VALUE are read-only. */
+ if (!f->sym->attr.value)
+ TREE_READONLY (parm) = 1;
if (POINTER_TYPE_P (type)
&& (!f->sym->attr.proc_pointer
&& f->sym->attr.flavor != FL_PROCEDURE))
void
Export::export_globals(const std::string& package_name,
+ const std::string& prefix,
const std::string& pkgpath,
int package_priority,
const std::map<std::string, Package*>& imports,
this->write_string(package_name);
this->write_c_string(";\n");
- // The package path, used for all global symbols.
- this->write_c_string("pkgpath ");
- this->write_string(pkgpath);
+ // The prefix or package path, used for all global symbols.
+ if (prefix.empty())
+ {
+ go_assert(!pkgpath.empty());
+ this->write_c_string("pkgpath ");
+ this->write_string(pkgpath);
+ }
+ else
+ {
+ this->write_c_string("prefix ");
+ this->write_string(prefix);
+ }
this->write_c_string(";\n");
// The package priority.
// Export the identifiers in BINDINGS which are marked for export.
// The exporting is done via a series of calls to THIS->STREAM_. If
// is nothing to export, this->stream_->write will not be called.
- // PKGPATH is the package path.
+ // PREFIX is the package prefix. PKGPATH is the package path.
+ // Only one of PREFIX and PKGPATH will be non-empty.
// PACKAGE_PRIORITY is the priority to use for this package.
+ // IMPORTS is the explicitly imported packages.
// IMPORT_INIT_FN is the name of the import initialization function
// for this package; it will be empty if none is needed.
// IMPORTED_INIT_FNS is the list of initialization functions for
// imported packages.
void
export_globals(const std::string& package_name,
+ const std::string& prefix,
const std::string& pkgpath,
int package_priority,
const std::map<std::string, Package*>& imports,
// Now that we know the name of the package we are compiling, set
// the package path to use for reflect.Type.PkgPath and global
// symbol names.
- if (!this->pkgpath_set_)
+ if (this->pkgpath_set_)
+ this->pkgpath_symbol_ = Gogo::pkgpath_for_symbol(this->pkgpath_);
+ else
{
if (!this->prefix_from_option_ && package_name == "main")
- this->pkgpath_ = package_name;
+ {
+ this->pkgpath_ = package_name;
+ this->pkgpath_symbol_ = Gogo::pkgpath_for_symbol(package_name);
+ }
else
{
if (!this->prefix_from_option_)
this->prefix_ = "go";
this->pkgpath_ = this->prefix_ + '.' + package_name;
+ this->pkgpath_symbol_ = (Gogo::pkgpath_for_symbol(this->prefix_) + '.'
+ + Gogo::pkgpath_for_symbol(package_name));
}
this->pkgpath_set_ = true;
}
- this->pkgpath_symbol_ = Gogo::pkgpath_for_symbol(this->pkgpath_);
-
- this->package_ = this->register_package(this->pkgpath_, location);
+ this->package_ = this->register_package(this->pkgpath_,
+ this->pkgpath_symbol_, location);
this->package_->set_package_name(package_name, location);
if (this->is_main_package())
const std::string& alias_arg,
bool is_alias_exported,
const std::string& pkgpath,
+ const std::string& pkgpath_symbol,
Location location,
bool* padd_to_globals)
{
- Package* ret = this->register_package(pkgpath, location);
+ Package* ret = this->register_package(pkgpath, pkgpath_symbol, location);
ret->set_package_name(real_name, location);
*padd_to_globals = false;
// Register a package. This package may or may not be imported. This
// returns the Package structure for the package, creating if it
// necessary. LOCATION is the location of the import statement that
-// led us to see this package.
+// led us to see this package. PKGPATH_SYMBOL is the symbol to use
+// for names in the package; it may be the empty string, in which case
+// we either get it later or make a guess when we need it.
Package*
-Gogo::register_package(const std::string& pkgpath, Location location)
+Gogo::register_package(const std::string& pkgpath,
+ const std::string& pkgpath_symbol, Location location)
{
Package* package = NULL;
std::pair<Packages::iterator, bool> ins =
// We have seen this package name before.
package = ins.first->second;
go_assert(package != NULL && package->pkgpath() == pkgpath);
+ if (!pkgpath_symbol.empty())
+ package->set_pkgpath_symbol(pkgpath_symbol);
if (Linemap::is_unknown_location(package->location()))
package->set_location(location);
}
else
{
// First time we have seen this package name.
- package = new Package(pkgpath, location);
+ package = new Package(pkgpath, pkgpath_symbol, location);
go_assert(ins.first->second == NULL);
ins.first->second = package;
}
// support streaming to a separate file.
Stream_to_section stream;
+ // Write out either the prefix or pkgpath depending on how we were
+ // invoked.
+ std::string prefix;
+ std::string pkgpath;
+ if (this->pkgpath_from_option_)
+ pkgpath = this->pkgpath_;
+ else if (this->prefix_from_option_)
+ prefix = this->prefix_;
+ else if (this->is_main_package())
+ pkgpath = "main";
+ else
+ prefix = "go";
+
Export exp(&stream);
exp.register_builtin_types(this);
exp.export_globals(this->package_name(),
- this->pkgpath(),
+ prefix,
+ pkgpath,
this->package_priority(),
this->imports_,
(this->need_init_fn_ && !this->is_main_package()
// Class Package.
-Package::Package(const std::string& pkgpath, Location location)
- : pkgpath_(pkgpath), pkgpath_symbol_(Gogo::pkgpath_for_symbol(pkgpath)),
+Package::Package(const std::string& pkgpath,
+ const std::string& pkgpath_symbol, Location location)
+ : pkgpath_(pkgpath), pkgpath_symbol_(pkgpath_symbol),
package_name_(), bindings_(new Bindings(NULL)), priority_(0),
location_(location), used_(false), is_imported_(false),
uses_sink_alias_(false)
package_name.c_str());
}
+// Return the pkgpath symbol, which is a prefix for symbols defined in
+// this package.
+
+std::string
+Package::pkgpath_symbol() const
+{
+ if (this->pkgpath_symbol_.empty())
+ {
+ // In the general case, this is wrong, because the package might
+ // have been compiled with -fprefix. However, it is what we
+ // used to do, so it is no more wrong than we were before.
+ return Gogo::pkgpath_for_symbol(this->pkgpath_);
+ }
+ return this->pkgpath_symbol_;
+}
+
+// Set the package path symbol.
+
+void
+Package::set_pkgpath_symbol(const std::string& pkgpath_symbol)
+{
+ go_assert(!pkgpath_symbol.empty());
+ if (this->pkgpath_symbol_.empty())
+ this->pkgpath_symbol_ = pkgpath_symbol;
+ else
+ go_assert(this->pkgpath_symbol_ == pkgpath_symbol);
+}
+
// Set the priority. We may see multiple priorities for an imported
// package; we want to use the largest one.
add_imported_package(const std::string& real_name, const std::string& alias,
bool is_alias_exported,
const std::string& pkgpath,
+ const std::string& pkgpath_symbol,
Location location,
bool* padd_to_globals);
// This returns the Package structure for the package, creating if
// it necessary.
Package*
- register_package(const std::string& pkgpath, Location);
+ register_package(const std::string& pkgpath,
+ const std::string& pkgpath_symbol, Location);
// Start compiling a function. ADD_METHOD_TO_TYPE is true if a
// method function should be added to the type of its receiver.
class Package
{
public:
- Package(const std::string& pkgpath, Location location);
+ Package(const std::string& pkgpath, const std::string& pkgpath_symbol,
+ Location location);
// Get the package path used for all symbols exported from this
// package.
{ return this->pkgpath_; }
// Return the package path to use for a symbol name.
- const std::string&
- pkgpath_symbol() const
- { return this->pkgpath_symbol_; }
+ std::string
+ pkgpath_symbol() const;
+
+ // Set the package path symbol.
+ void
+ set_pkgpath_symbol(const std::string&);
// Return the location of the import statement.
Location
this->require_c_string(";\n");
std::string pkgpath;
+ std::string pkgpath_symbol;
if (this->match_c_string("prefix "))
{
this->advance(7);
std::string unique_prefix = this->read_identifier();
this->require_c_string(";\n");
pkgpath = unique_prefix + '.' + package_name;
+ pkgpath_symbol = (Gogo::pkgpath_for_symbol(unique_prefix) + '.'
+ + Gogo::pkgpath_for_symbol(package_name));
}
else
{
this->require_c_string("pkgpath ");
pkgpath = this->read_identifier();
this->require_c_string(";\n");
+ pkgpath_symbol = Gogo::pkgpath_for_symbol(pkgpath);
}
this->package_ = gogo->add_imported_package(package_name, local_name,
is_local_name_exported,
- pkgpath,
+ pkgpath, pkgpath_symbol,
this->location_,
&this->add_to_globals_);
if (this->package_ == NULL)
stream->advance(1);
this->require_c_string("\";\n");
- Package* p = this->gogo_->register_package(pkgpath,
+ Package* p = this->gogo_->register_package(pkgpath, "",
Linemap::unknown_location());
p->set_package_name(package_name, this->location());
}
package = this->package_;
else
{
- package = this->gogo_->register_package(pkgpath,
+ package = this->gogo_->register_package(pkgpath, "",
Linemap::unknown_location());
if (!package_name.empty())
package->set_package_name(package_name, this->location());
bool add_to_globals;
Package* package = this->add_imported_package("unsafe", local_name,
is_local_name_exported,
- "unsafe", location,
+ "unsafe", "unsafe", location,
&add_to_globals);
if (package == NULL)
the callgraph so references can point to it. */
return (!node->address_taken
&& !ipa_ref_has_aliases_p (&node->ref_list)
- && !node->used_as_abstract_origin
&& cgraph_can_remove_if_no_direct_calls_p (node)
/* Inlining might enable more devirtualizing, so we want to remove
those only after all devirtualizable virtual calls are processed.
n = cgraph_clone_node (e->callee, e->callee->decl,
e->count, freq_scale, update_original,
vNULL, true, inlining_into, NULL);
+ n->used_as_abstract_origin = e->callee->used_as_abstract_origin;
cgraph_redirect_edge_callee (e, n);
}
}
&& DECL_ABSTRACT_ORIGIN (node->decl))
{
struct cgraph_node *origin_node
- = cgraph_get_create_node (DECL_ABSTRACT_ORIGIN (node->decl));
- origin_node->used_as_abstract_origin = true;
- enqueue_node (origin_node, &first, reachable);
+ = cgraph_get_node (DECL_ABSTRACT_ORIGIN (node->decl));
+ if (origin_node && !origin_node->used_as_abstract_origin)
+ {
+ origin_node->used_as_abstract_origin = true;
+ gcc_assert (!origin_node->prev_sibling_clone);
+ gcc_assert (!origin_node->next_sibling_clone);
+ for (cgraph_node *n = origin_node->clones; n;
+ n = n->next_sibling_clone)
+ if (n->decl == DECL_ABSTRACT_ORIGIN (node->decl))
+ n->used_as_abstract_origin = true;
+ }
}
/* If any symbol in a comdat group is reachable, force
all externally visible symbols in the same comdat
if (BARRIER_P (prev))
delete_insn (insn);
else if (prev != PREV_INSN (insn))
- reorder_insns_nobb (insn, insn, prev);
+ {
+ basic_block bb = BLOCK_FOR_INSN (prev);
+ rtx end = PREV_INSN (insn);
+ reorder_insns_nobb (insn, insn, prev);
+ if (bb)
+ {
+ /* If the backend called in machine reorg compute_bb_for_insn
+ and didn't free_bb_for_insn again, preserve basic block
+ boundaries. Move the end of basic block to PREV since
+ it is followed by a barrier now, and clear BLOCK_FOR_INSN
+ on the following notes.
+ ??? Maybe the proper solution for the targets that have
+ cfg around after machine reorg is not to run cleanup_barriers
+ pass at all. */
+ BB_END (bb) = prev;
+ do
+ {
+ prev = NEXT_INSN (prev);
+ if (prev != insn && BLOCK_FOR_INSN (prev) == bb)
+ BLOCK_FOR_INSN (prev) = NULL;
+ }
+ while (prev != end);
+ }
+ }
}
}
return 0;
if (DECL_ABSTRACT_ORIGIN (node->decl))
{
struct cgraph_node *origin_node
- = cgraph_get_node (DECL_ABSTRACT_ORIGIN (node->decl));
+ = cgraph_get_create_node (DECL_ABSTRACT_ORIGIN (node->decl));
+ origin_node->used_as_abstract_origin = true;
add_node_to (encoder, origin_node, true);
}
}
#pragma omp target data, there is nothing to map for
those. */
if (gimple_omp_target_kind (ctx->stmt) == GF_OMP_TARGET_KIND_DATA
- && !POINTER_TYPE_P (TREE_TYPE (decl)))
+ && !POINTER_TYPE_P (TREE_TYPE (decl))
+ && !OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION (c))
break;
}
if (DECL_P (decl))
}
pp_underscore (&pp);
- pp_string (&pp,
- IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->decl)));
- const char *str = pp_formatted_text (&pp);
+ const char *str = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->decl));
+ if (*str == '*')
+ ++str;
+ pp_string (&pp, str);
+ str = pp_formatted_text (&pp);
/* If there already is a SIMD clone with the same mangled name, don't
add another one. This can happen e.g. for
!= REGNO (get_extended_src_reg (SET_SRC (PATTERN (cand->insn)))));
if (copy_needed)
{
+ /* Considering transformation of
+ (set (reg1) (expression))
+ ...
+ (set (reg2) (any_extend (reg1)))
+
+ into
+
+ (set (reg2) (any_extend (expression)))
+ (set (reg1) (reg2))
+ ... */
+
/* In theory we could handle more than one reaching def, it
just makes the code to update the insn stream more complex. */
if (state->defs_list.length () != 1)
if (state->modified[INSN_UID (cand->insn)].kind != EXT_MODIFIED_NONE)
return false;
- /* Transformation of
- (set (reg1) (expression))
- (set (reg2) (any_extend (reg1)))
- into
- (set (reg2) (any_extend (expression)))
- (set (reg1) (reg2))
- is only valid for scalar integral modes, as it relies on the low
- subreg of reg1 to have the value of (expression), which is not true
- e.g. for vector modes. */
- if (!SCALAR_INT_MODE_P (GET_MODE (SET_DEST (PATTERN (cand->insn)))))
- return false;
-
enum machine_mode dst_mode = GET_MODE (SET_DEST (PATTERN (cand->insn)));
rtx src_reg = get_extended_src_reg (SET_SRC (PATTERN (cand->insn)));
different extension. FIXME: this obviously can be improved. */
for (def = defs; def; def = def->next)
if ((idx = def_map[INSN_UID (DF_REF_INSN (def->ref))])
+ && idx != -1U
&& (cand = &(*insn_list)[idx - 1])
&& cand->code != code)
{
}
return;
}
+ /* For vector mode extensions, ensure that all uses of the
+ XEXP (src, 0) register are the same extension (both code
+ and to which mode), as unlike integral extensions lowpart
+ subreg of the sign/zero extended register are not equal
+ to the original register, so we have to change all uses or
+ none. */
+ else if (VECTOR_MODE_P (GET_MODE (XEXP (src, 0))))
+ {
+ if (idx == 0)
+ {
+ struct df_link *ref_chain, *ref_link;
+
+ ref_chain = DF_REF_CHAIN (def->ref);
+ for (ref_link = ref_chain; ref_link; ref_link = ref_link->next)
+ {
+ if (ref_link->ref == NULL
+ || DF_REF_INSN_INFO (ref_link->ref) == NULL)
+ {
+ idx = -1U;
+ break;
+ }
+ rtx use_insn = DF_REF_INSN (ref_link->ref);
+ const_rtx use_set;
+ if (use_insn == insn || DEBUG_INSN_P (use_insn))
+ continue;
+ if (!(use_set = single_set (use_insn))
+ || !REG_P (SET_DEST (use_set))
+ || GET_MODE (SET_DEST (use_set)) != GET_MODE (dest)
+ || GET_CODE (SET_SRC (use_set)) != code
+ || !rtx_equal_p (XEXP (SET_SRC (use_set), 0),
+ XEXP (src, 0)))
+ {
+ idx = -1U;
+ break;
+ }
+ }
+ if (idx == -1U)
+ def_map[INSN_UID (DF_REF_INSN (def->ref))] = idx;
+ }
+ if (idx == -1U)
+ {
+ if (dump_file)
+ {
+ fprintf (dump_file, "Cannot eliminate extension:\n");
+ print_rtl_single (dump_file, insn);
+ fprintf (dump_file,
+ " because some vector uses aren't extension\n");
+ }
+ return;
+ }
+ }
/* Then add the candidate to the list and insert the reaching definitions
into the definition map. */
int
reg_set_p (const_rtx reg, const_rtx insn)
{
+ /* After delay slot handling, call and branch insns might be in a
+ sequence. Check all the elements there. */
+ if (INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE)
+ {
+ for (int i = 0; i < XVECLEN (PATTERN (insn), 0); ++i)
+ if (reg_set_p (reg, XVECEXP (PATTERN (insn), 0, i)))
+ return true;
+
+ return false;
+ }
+
/* We can be passed an insn or part of one. If we are passed an insn,
check if a side-effect of the insn clobbers REG. */
if (INSN_P (insn)
GET_MODE (reg), REGNO (reg)))
|| MEM_P (reg)
|| find_reg_fusage (insn, CLOBBER, reg)))))
- return 1;
+ return true;
return set_of (reg, insn) != NULL_RTX;
}
+2015-02-04 Matthias Klose <doko@ubuntu.com>
+
+ Backport from mainline
+ 2015-01-15 Martin Liska <mliska@suse.cz>
+
+ * g++.dg/ipa/pr64068.C: New test.
+ * gcc.dg/ipa/PR64559.c: New test.
+
+2015-02-04 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2015-01-31 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/64882
+ * gcc.dg/torture/pr64882.c: New test.
+
+2015-02-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ Backported from mainline
+ 2015-01-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gcc.target/i386/builtin_target.c (check_intel_cpu_model): Add
+ Silvermont, Ivy Bridge, Haswell and Broadwell tests. Update Sandy
+ Bridge test.
+
+2015-02-01 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-01-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/61058
+ * gcc.dg/pr61058.c: New test.
+
+ PR c/64766
+ * gcc.dg/pr64766.c: New test.
+
+ 2015-01-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/64778
+ * gcc.dg/pr64778.c: New test.
+
+ PR middle-end/64421
+ * gcc.dg/vect/pr64421.c: New test.
+
+ 2015-01-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/63637
+ PR rtl-optimization/60663
+ * gcc.dg/pr63637-1.c: New test.
+ * gcc.dg/pr63637-2.c: New test.
+ * gcc.dg/pr63637-3.c: New test.
+ * gcc.dg/pr63637-4.c: New test.
+ * gcc.dg/pr63637-5.c: New test.
+ * gcc.dg/pr63637-6.c: New test.
+ * gcc.target/i386/pr63637-1.c: New test.
+ * gcc.target/i386/pr63637-2.c: New test.
+ * gcc.target/i386/pr63637-3.c: New test.
+ * gcc.target/i386/pr63637-4.c: New test.
+ * gcc.target/i386/pr63637-5.c: New test.
+ * gcc.target/i386/pr63637-6.c: New test.
+
+ 2015-01-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/64663
+ * gcc.dg/pr64663.c: New test.
+
+2015-01-29 Ilya Tocar <ilya.tocar@intel.com>
+
+ * gcc.target/i386/sse-14.c: Test new intrinsic.
+ * gcc.target/i386/sse-22.c: Ditto.
+
+2015-01-27 Paul Thomas <pault@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/62044
+ * gfortran.dg/allocate_with_mold_1.f90: New test
+
+2015-01-27 Janus Weil <janus@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/64230
+ * gfortran.dg/class_allocate_18.f90: Remove -fsanitize option to
+ prevent linking errors.
+
+2015-01-27 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/64771
+ * gfortran.dg/coarray_36.f: New.
+ * gfortran.dg/coarray_37.f90: New.
+
+2015-01-26 Janus Weil <janus@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/64230
+ * gfortran.dg/class_allocate_18.f90: New.
+
+2015-01-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR testsuite/64712
+ * gnat.dg/unchecked_convert1.adb (Unchecked_Convert1): Initialize A.
+
+2015-01-24 Thomas Koenig <tkoenig@netcologne.de>
+
+ Backport from trunk
+ PR fortran/57023
+ * gfortran.dg/internal_pack_15.f90: New test.
+
+2015-01-24 Janus Weil <janus@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/60922
+ * gfortran.dg/class_allocate_17.f90: New.
+
+2015-01-20 Marek Polacek <polacek@redhat.com>
+
+ Backport from mainline
+ 2014-06-23 Marek Polacek <polacek@redhat.com>
+
+ PR c/61553
+ * c-c++-common/pr61553.c: New test.
+
+2015-01-16 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ * c-c++-common/tsan/tsan_barrier.h: New.
+ * c-c++-common/tsan/atomic_stack.c: Reworked to not depend on sleep.
+ * c-c++-common/tsan/fd_pipe_race.c: Likewise.
+ * c-c++-common/tsan/mutexset1.c: Likewise.
+ * c-c++-common/tsan/race_on_barrier.c: Likewise.
+ * c-c++-common/tsan/race_on_mutex.c: Likewise.
+ * c-c++-common/tsan/race_on_mutex2.c: Likewise.
+ * c-c++-common/tsan/simple_race.c: Likewise.
+ * c-c++-common/tsan/simple_stack.c: Likewise.
+ * c-c++-common/tsan/sleep_sync.c: Likewise.
+ * c-c++-common/tsan/tiny_race.c: Likewise.
+ * c-c++-common/tsan/tls_race.c: Likewise.
+ * c-c++-common/tsan/write_in_reader_lock.c: Likewise.
+ * g++.dg/tsan/atomic_free.C: Likewise.
+ * g++.dg/tsan/atomic_free2.C: Likewise.
+ * g++.dg/tsan/cond_race.C: Likewise.
+ * g++.dg/tsan/tsan_barrier.h: Copied from c-c++-common/tsan.
+
+2015-01-15 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/opt47.adb: New test.
+
+2015-01-14 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-01-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/64513
+ * gcc.target/i386/pr64513.c: New test.
+
+ 2015-01-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/64286
+ * gcc.target/i386/avx2-pr64286.c: New test.
+
+ PR fortran/64528
+ * gfortran.dg/pr64528.f90: New test.
+
+ 2015-01-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/64563
+ * gcc.dg/pr64563.c: New test.
+
+2015-01-14 Marek Polacek <polacek@redhat.com>
+
+ Backport from mainline
+ 2015-01-13 Marek Polacek <polacek@redhat.com>
+
+ PR middle-end/64391
+ * gcc.dg/tm/pr64391.c: New test.
+
+2015-01-13 Marc Glisse <marc.glisse@inria.fr>
+
+ PR c++/54442
+ * g++.dg/pr54442.C: New file.
+
+2015-01-13 Renlin Li <renlin.li@arm.com>
+
+ Backported from mainline
+ 2014-11-19 Renlin Li <renlin.li@arm.com>
+
+ PR target/63424
+ * gcc.target/aarch64/pr63424.c: New Test.
+
2015-01-12 Janus Weil <janus@gcc.gnu.org>
Backport from mainline
--- /dev/null
+/* PR c/61553 */
+/* { dg-do compile } */
+
+void
+foo (char *s)
+{
+ __atomic_store (s, (void *) 0, __ATOMIC_SEQ_CST); /* { dg-error "size mismatch" } */
+}
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+static pthread_barrier_t barrier;
int Global;
void *Thread1(void *x) {
- sleep(1);
+ barrier_wait(&barrier);
__atomic_fetch_add(&Global, 1, __ATOMIC_RELAXED);
return NULL;
}
void *Thread2(void *x) {
Global++;
+ barrier_wait(&barrier);
return NULL;
}
int main() {
+ barrier_init(&barrier, 2);
pthread_t t[2];
pthread_create(&t[0], NULL, Thread1, NULL);
pthread_create(&t[1], NULL, Thread2, NULL);
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <stdio.h>
#include <unistd.h>
+#include "tsan_barrier.h"
+static pthread_barrier_t barrier;
int fds[2];
void *Thread1(void *x) {
write(fds[1], "a", 1);
+ barrier_wait(&barrier);
return NULL;
}
void *Thread2(void *x) {
- sleep(1);
+ barrier_wait(&barrier);
close(fds[0]);
close(fds[1]);
return NULL;
}
int main() {
+ barrier_init(&barrier, 2);
pipe(fds);
pthread_t t[2];
pthread_create(&t[0], NULL, Thread1, NULL);
pthread_create(&t[1], NULL, Thread2, NULL);
pthread_join(t[0], NULL);
pthread_join(t[1], NULL);
+ return 0;
}
/* { dg-output "WARNING: ThreadSanitizer: data race.*\n" } */
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <stdio.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+static pthread_barrier_t barrier;
int Global;
pthread_mutex_t mtx;
void *Thread1(void *x) {
- sleep(1);
+ barrier_wait(&barrier);
pthread_mutex_lock(&mtx);
Global++;
pthread_mutex_unlock(&mtx);
void *Thread2(void *x) {
Global--;
+ barrier_wait(&barrier);
return NULL;/* { dg-output ".*" } */
}
int main() {
+ barrier_init(&barrier, 2);
pthread_mutex_init(&mtx, 0);
pthread_t t[2];
pthread_create(&t[0], NULL, Thread1, NULL);
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+static pthread_barrier_t barrier;
pthread_barrier_t B;
int Global;
void *Thread1(void *x) {
pthread_barrier_init(&B, 0, 2);
+ barrier_wait(&barrier);
pthread_barrier_wait(&B);
return NULL;
}
void *Thread2(void *x) {
- sleep(1);
+ barrier_wait(&barrier);
pthread_barrier_wait(&B);
return NULL;
}
int main() {
+ barrier_init(&barrier, 2);
pthread_t t;
pthread_create(&t, NULL, Thread1, NULL);
Thread2(0);
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+static pthread_barrier_t barrier;
pthread_mutex_t Mtx;
int Global;
pthread_mutex_lock(&Mtx);
Global = 42;
pthread_mutex_unlock(&Mtx);
+ barrier_wait(&barrier);
return NULL;
}
void *Thread2(void *x) {
- sleep(1);
+ barrier_wait(&barrier);
pthread_mutex_lock(&Mtx);
Global = 43;
pthread_mutex_unlock(&Mtx);
}
int main() {
+ barrier_init(&barrier, 2);
pthread_t t[2];
pthread_create(&t[0], NULL, Thread1, NULL);
pthread_create(&t[1], NULL, Thread2, NULL);
/* { dg-output "WARNING: ThreadSanitizer: data race.*(\n|\r\n|\r)" } */
/* { dg-output " Atomic read of size 1 at .* by thread T2:(\n|\r\n|\r)" } */
/* { dg-output " #0 pthread_mutex_lock.*" } */
-/* { dg-output " #1 Thread2.* .*(race_on_mutex.c:21|\\?{2}:0) (.*)" } */
+/* { dg-output " #1 Thread2.* .*(race_on_mutex.c:22|\\?{2}:0) (.*)" } */
/* { dg-output " Previous write of size 1 at .* by thread T1:(\n|\r\n|\r)" } */
/* { dg-output " #0 pthread_mutex_init .* (.)*" } */
/* { dg-output " #1 Thread1.* .*(race_on_mutex.c:12|\\?{2}:0) .*" } */
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+
+static pthread_barrier_t barrier;
void *Thread(void *x) {
pthread_mutex_lock((pthread_mutex_t*)x);
pthread_mutex_unlock((pthread_mutex_t*)x);
+ barrier_wait(&barrier);
return 0;
}
int main() {
+ barrier_init(&barrier, 2);
pthread_mutex_t Mtx;
pthread_mutex_init(&Mtx, 0);
pthread_t t;
pthread_create(&t, 0, Thread, &Mtx);
- sleep(1);
+ barrier_wait(&barrier);
pthread_mutex_destroy(&Mtx);
pthread_join(t, 0);
return 0;
/* { dg-set-target-env-var TSAN_OPTIONS "halt_on_error=1" } */
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <stdio.h>
#include <unistd.h>
+#include "tsan_barrier.h"
-#define MAX_ITERATIONS_NUMBER 100
-#define SLEEP_STEP 128000
+#define MAX_ITERATIONS_NUMBER 1
+#define SLEEP_STEP 128000
+static pthread_barrier_t barrier;
unsigned int delay_time = 1000;
static inline void delay () {
extern int main_1();
int main() {
+ barrier_init(&barrier, 2);
int i;
for (i = 0; i < MAX_ITERATIONS_NUMBER; i++) {
main_1();
int Global;
void *Thread1(void *x) {
+ barrier_wait(&barrier);
delay();
Global = 42;
return NULL;
void *Thread2(void *x) {
Global = 43;
+ barrier_wait(&barrier);
return NULL;
}
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <stdio.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+static pthread_barrier_t barrier;
int Global;
void __attribute__((noinline)) foo1() {
}
void *Thread1(void *x) {
- sleep(1);
+ barrier_wait(&barrier);
bar1();
return NULL;
}
void *Thread2(void *x) {
bar2();
+ barrier_wait(&barrier);
return NULL;
}
}
int main() {
+ barrier_init(&barrier, 2);
pthread_t t[2];
StartThread(&t[0], Thread1);
StartThread(&t[1], Thread2);
/* { dg-output "WARNING: ThreadSanitizer: data race.*" } */
/* { dg-output " Write of size 4 at .* by thread T1:(\n|\r\n|\r)" } */
-/* { dg-output " #0 foo1.* .*(simple_stack.c:10|\\?{2}:0) (.*)" } */
-/* { dg-output " #1 bar1.* .*(simple_stack.c:15|\\?{2}:0) (.*)" } */
-/* { dg-output " #2 Thread1.* .*(simple_stack.c:29|\\?{2}:0) (.*)" } */
+/* { dg-output " #0 foo1.* .*(simple_stack.c:11|\\?{2}:0) (.*)" } */
+/* { dg-output " #1 bar1.* .*(simple_stack.c:16|\\?{2}:0) (.*)" } */
+/* { dg-output " #2 Thread1.* .*(simple_stack.c:30|\\?{2}:0) (.*)" } */
/* { dg-output " Previous read of size 4 at .* by thread T2:(\n|\r\n|\r)" } */
-/* { dg-output " #0 foo2.* .*(simple_stack.c:19|\\?{2}:0) (.*)" } */
-/* { dg-output " #1 bar2.* .*(simple_stack.c:24|\\?{2}:0) (.*)" } */
-/* { dg-output " #2 Thread2.* .*(simple_stack.c:34|\\?{2}:0) (.*)" } */
+/* { dg-output " #0 foo2.* .*(simple_stack.c:20|\\?{2}:0) (.*)" } */
+/* { dg-output " #1 bar2.* .*(simple_stack.c:25|\\?{2}:0) (.*)" } */
+/* { dg-output " #2 Thread2.* .*(simple_stack.c:35|\\?{2}:0) (.*)" } */
/* { dg-output " Thread T1 \\(tid=.*, running\\) created by main thread at:(\n|\r\n|\r)" } */
/* { dg-output " #0 pthread_create .* (.*)" } */
-/* { dg-output " #1 StartThread.* .*(simple_stack.c:39|\\?{2}:0) (.*)" } */
+/* { dg-output " #1 StartThread.* .*(simple_stack.c:41|\\?{2}:0) (.*)" } */
/* { dg-output " Thread T2 (.*) created by main thread at:(\n|\r\n|\r)" } */
/* { dg-output " #0 pthread_create .* (.*)" } */
-/* { dg-output " #1 StartThread.* .*(simple_stack.c:39|\\?{2}:0) (.*)" } */
+/* { dg-output " #1 StartThread.* .*(simple_stack.c:41|\\?{2}:0) (.*)" } */
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
#include <unistd.h>
+#include "tsan_barrier.h"
+static pthread_barrier_t barrier;
int X = 0;
void MySleep() {
}
void *Thread(void *p) {
+ barrier_wait(&barrier);
MySleep(); // Assume the main thread has done the write.
X = 42;
return 0;
}
int main() {
+ barrier_init(&barrier, 2);
pthread_t t;
pthread_create(&t, 0, Thread, 0);
X = 43;
+ barrier_wait(&barrier);
pthread_join(t, 0);
return 0;
}
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+static pthread_barrier_t barrier;
int Global;
void *Thread1(void *x) {
- sleep(1);
+ barrier_wait(&barrier);
Global = 42;
return x;
}
int main() {
+ barrier_init(&barrier, 2);
pthread_t t;
pthread_create(&t, 0, Thread1, 0);
Global = 43;
+ barrier_wait(&barrier);
pthread_join(t, 0);
return Global;
}
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <stddef.h>
+#include "tsan_barrier.h"
+
+static pthread_barrier_t barrier;
void *Thread(void *a) {
+ barrier_wait(&barrier);
*(int*)a = 43;
return 0;
}
int main() {
+ barrier_init(&barrier, 2);
static __thread int Var = 42;
pthread_t t;
pthread_create(&t, 0, Thread, &Var);
Var = 43;
+ barrier_wait(&barrier);
pthread_join(t, 0);
}
--- /dev/null
+/* TSAN-invisible barriers. Link with -ldl. */
+#include <pthread.h>
+#include <dlfcn.h>
+
+static __typeof(pthread_barrier_wait) *barrier_wait;
+
+static
+void barrier_init (pthread_barrier_t *barrier, unsigned count)
+{
+ void *h = dlopen ("libpthread.so.0", RTLD_LAZY);
+ barrier_wait = (__typeof (pthread_barrier_wait) *)
+ dlsym (h, "pthread_barrier_wait");
+ pthread_barrier_init (barrier, NULL, count);
+}
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+static pthread_barrier_t barrier;
pthread_rwlock_t rwlock;
int GLOB;
(void)p;
pthread_rwlock_rdlock(&rwlock);
// Write under reader lock.
- sleep(1);
+ barrier_wait(&barrier);
GLOB++;
pthread_rwlock_unlock(&rwlock);
return 0;
}
int main(int argc, char *argv[]) {
+ barrier_init(&barrier, 2);
pthread_rwlock_init(&rwlock, NULL);
pthread_rwlock_rdlock(&rwlock);
pthread_t t;
volatile int x = GLOB;
(void)x;
pthread_rwlock_unlock(&rwlock);
+ barrier_wait(&barrier);
pthread_join(t, 0);
pthread_rwlock_destroy(&rwlock);
return 0;
virtual void f() final {}
virtual void g() {}
virtual void x() const {}
+ virtual void y() final;
};
+void B::y() {} // { dg-error "overriding" }
+
struct B2
{
virtual void h() {}
struct D : B
{
virtual void g() override final {} // { dg-error "overriding" }
+ virtual void y() override final {} // { dg-error "virtual" }
};
template <class T> struct D2 : T
--- /dev/null
+// PR c++/64514
+// { dg-do compile { target c++11 } }
+
+template<typename... T>
+struct Functor
+{
+ template <T...>
+ struct Inner
+ {};
+};
+
+template struct Functor<>::Inner<>;
+
+int main()
+{
+
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef int PROV_ENUMALGS_EX, PCCRYPT_OID_INFO;
+class A {
+ int m_fn2();
+ virtual bool m_fn1(PCCRYPT_OID_INFO);
+};
+int fn1();
+void fn2();
+int A::m_fn2() { m_fn1(0); }
+
+bool fn3() {
+ for (;;) {
+ if (fn1()) {
+ if (fn1() != 259)
+ fn2();
+ break;
+ }
+ return 1;
+ }
+ return 0;
+}
+
+class B {
+public:
+ B() { fn3(); }
+};
+class C : A {
+ bool m_fn1(PCCRYPT_OID_INFO) { m_fn3(); }
+ int isSupportedByProvider_algId;
+ PROV_ENUMALGS_EX isSupportedByProvider_outEnumAlgs;
+ PROV_ENUMALGS_EX isSupportedByProvider_enumAlgs;
+ bool m_fn3() {
+ while (1) {
+ if (fn1()) {
+ if (fn1() != 259)
+ fn2();
+ break;
+ }
+ if (isSupportedByProvider_algId)
+ isSupportedByProvider_outEnumAlgs = isSupportedByProvider_enumAlgs;
+ return 1;
+ }
+ return 0;
+ }
+};
+
+void fn4() { B(); }
--- /dev/null
+/* { dg-do compile } */
+
+struct S
+{
+ void s (int) const throw ();
+ void s (int) throw ();
+};
+
+typedef int index_t;
+
+void (S::*f) (index_t) = &S::s;
+void (S::*g) (index_t) const = &S::s;
--- /dev/null
+// PR c++/64521
+// { dg-options "-frepo -std=c++11" }
+// { dg-require-host-local "" }
+// { dg-skip-if "dkms are not final links" { vxworks_kernel } }
+// { dg-final cleanup-repo-files }
+
+template <typename H> struct J { J(H) {} };
+template <unsigned long, typename...> struct K;
+template <unsigned long I> struct K<I> {};
+template <unsigned long I, typename H, typename... T>
+struct K<I, H, T...> : K<I + 1, T...>, J<H> {
+ K(const H &p1, const T &... p2) : K<I + 1, T...>(p2...), J<H>(p1) {}
+};
+template <typename... E> struct C : K<0, E...> {
+ C(const E &... p1) : K<0, E...>(p1...) {}
+};
+template <typename> struct A {
+ A() = default;
+};
+struct M;
+template <typename> struct L {
+ struct B {
+ template <typename> static M *__test(...);
+ typedef A<int> _Del;
+ typedef decltype(__test<_Del>()) type;
+ };
+ C<typename B::type, A<M>> _M_t;
+ L(typename B::type) : _M_t(0, A<M>()) {}
+};
+struct M {};
+int main() { L<int>(new M); }
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+
+static pthread_barrier_t barrier;
void *Thread(void *a) {
__atomic_fetch_add((int*)a, 1, __ATOMIC_SEQ_CST);
+ barrier_wait(&barrier);
return 0;
}
int main() {
+ barrier_init(&barrier, 2);
int *a = new int(0);
pthread_t t;
pthread_create(&t, 0, Thread, a);
- sleep(1);
+ barrier_wait(&barrier);
delete a;
pthread_join(t, 0);
}
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
#include <pthread.h>
-#include <unistd.h>
+#include "tsan_barrier.h"
+
+static pthread_barrier_t barrier;
void *Thread(void *a) {
- sleep(1);
+ barrier_wait(&barrier);
__atomic_fetch_add((int*)a, 1, __ATOMIC_SEQ_CST);
return 0;
}
int main() {
+ barrier_init(&barrier, 2);
int *a = new int(0);
pthread_t t;
pthread_create(&t, 0, Thread, a);
delete a;
+ barrier_wait(&barrier);
pthread_join(t, 0);
}
/* { dg-shouldfail "tsan" } */
+/* { dg-additional-options "-ldl" } */
/* { dg-output "ThreadSanitizer: data race.*" } */
/* { dg-output "pthread_cond_signal.*" } */
-#include <stdio.h>
-#include <stdlib.h>
#include <pthread.h>
+#include "tsan_barrier.h"
+
+static pthread_barrier_t barrier;
struct Ctx {
pthread_mutex_t m;
c->done = true;
pthread_mutex_unlock(&c->m);
pthread_cond_signal(&c->c);
+ barrier_wait(&barrier);
return 0;
}
int main() {
+ barrier_init(&barrier, 2);
Ctx *c = new Ctx();
pthread_mutex_init(&c->m, 0);
pthread_cond_init(&c->c, 0);
while (!c->done)
pthread_cond_wait(&c->c, &c->m);
pthread_mutex_unlock(&c->m);
+ barrier_wait(&barrier);
delete c;
pthread_join(th, 0);
}
--- /dev/null
+/* TSAN-invisible barriers. Link with -ldl. */
+#include <pthread.h>
+#include <dlfcn.h>
+
+static __typeof(pthread_barrier_wait) *barrier_wait;
+
+static
+void barrier_init (pthread_barrier_t *barrier, unsigned count)
+{
+ void *h = dlopen ("libpthread.so.0", RTLD_LAZY);
+ barrier_wait = (__typeof (pthread_barrier_wait) *)
+ dlsym (h, "pthread_barrier_wait");
+ pthread_barrier_init (barrier, NULL, count);
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-Os" } */
+
+int a, b, c, d;
+
+struct S
+{
+ int f0;
+};
+
+static int
+fn1 (int p)
+{
+ return p == 0 || a;
+}
+
+static int
+fn2 ()
+{
+ d = fn1 (c);
+ return 0;
+}
+
+static int
+fn3 (struct S p)
+{
+ p.f0 || fn2 ();
+ if (fn1 (1))
+ b = 0;
+ return 0;
+}
+
+int
+main ()
+{
+ struct S e = { 1 };
+ fn3 (e);
+ return 0;
+}
--- /dev/null
+/* PR rtl-optimization/61058 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+/* { dg-additional-options "-fno-asynchronous-unwind-tables -mtune=atom" { target i?86-*-* x86_64-*-* } } */
+
+void
+foo (void)
+{
+ __builtin_unreachable ();
+}
--- /dev/null
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c;
+ asm ("# Magic instruction" : "=r" (a));
+ asm ("# Magic instruction" : "=r" (b));
+ asm ("# Magic instruction" : "=r" (c));
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 1 } } */
--- /dev/null
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c;
+ asm ("# Magic instruction" : "=r" (a) : "r" (0));
+ asm ("# Magic instruction" : "=r" (b) : "r" (0));
+ asm ("# Magic instruction" : "=r" (c) : "r" (0));
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 1 } } */
--- /dev/null
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c;
+ asm ("# Magic instruction" : "=r" (a) : : "memory");
+ asm ("# Magic instruction" : "=r" (b) : : "memory");
+ asm ("# Magic instruction" : "=r" (c) : : "memory");
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 3 } } */
--- /dev/null
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c;
+ asm ("# Magic instruction" : "=r" (a) : "r" (0) : "memory");
+ asm ("# Magic instruction" : "=r" (b) : "r" (0) : "memory");
+ asm ("# Magic instruction" : "=r" (c) : "r" (0) : "memory");
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 3 } } */
--- /dev/null
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c, d, e, f;
+ asm ("# Magic instruction" : "=r" (a), "=r" (d));
+ asm ("# Magic instruction" : "=r" (b), "=r" (e));
+ asm ("# Magic instruction" : "=r" (c), "=r" (f));
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 3 } } */
--- /dev/null
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c, d, e, f;
+ asm ("# Magic instruction" : "=r" (a), "=r" (d) : "r" (0));
+ asm ("# Magic instruction" : "=r" (b), "=r" (e) : "r" (0));
+ asm ("# Magic instruction" : "=r" (c), "=r" (f) : "r" (0));
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 3 } } */
--- /dev/null
+/* PR tree-optimization/64563 */
+/* { dg-do compile } */
+/* { dg-options "-Os -Wtype-limits" } */
+
+int a, b, c, d, f;
+unsigned int e;
+
+void
+foo (void)
+{
+ d = b = (a != (e | 4294967288UL));
+ if (!d)
+ c = f || b;
+}
--- /dev/null
+/* PR debug/64663 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -w" } */
+
+void
+foo (void)
+{
+ int a[9];
+ a[-8] = 0;
+}
+
+void
+bar (void)
+{
+ int a[9];
+ a[-9] = 0;
+}
--- /dev/null
+/* PR c/64766 */
+/* { dg-do compile } */
+
+void
+foo ()
+{
+}
+
+void foo () = 0; /* { dg-error "is initialized like a variable|invalid initializer" } */
--- /dev/null
+/* PR c/64778 */
+/* { dg-do compile } */
+
+int
+foo (int p)
+{
+ int a;
+ a ^= foo (,); /* { dg-error "expected expression before|too many arguments" } */
+ return a;
+}
--- /dev/null
+/* PR middle-end/64391 */
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm" } */
+
+void
+foo (void)
+{
+#pragma GCC ivdep
+ while (1);
+}
--- /dev/null
+/* PR middle-end/64421 */
+/* { dg-require-effective-target vect_simd_clones } */
+/* { dg-additional-options "-fopenmp-simd" } */
+/* { dg-additional-options "-mavx" { target avx_runtime } } */
+
+#include "tree-vect.h"
+
+#pragma omp declare simd linear (y) notinbranch
+int foo (int x, int y) __asm ("bar");
+
+#pragma omp declare simd linear (y) notinbranch
+int
+foo (int x, int y)
+{
+ return x + y;
+}
+
+int a[1024] = { 1, 2 };
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ #pragma omp simd
+ for (i = 0; i < 1024; i++)
+ a[i] = foo (a[i], i);
+ if (a[0] != 1 || a[1] != 3)
+ abort ();
+ for (i = 2; i < 1024; i++)
+ if (a[i] != i)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+#include <stdint.h>
+
+uint32_t
+truncate_int (const unsigned long long value)
+{
+ if ( value < 0 )
+ {
+ return 0;
+ }
+ else if ( value > UINT32_MAX )
+ {
+ return UINT32_MAX;
+ }
+ else
+ return (uint32_t)value;
+}
+
+uint32_t
+mul (const unsigned long long x, const unsigned long long y)
+{
+ uint32_t value = truncate_int (x * y);
+ return value;
+}
+
+uint32_t *
+test(unsigned size, uint32_t *a, uint32_t s)
+{
+ unsigned i;
+
+ for (i = 0; i < size; i++)
+ {
+ a[i] = mul (a[i], s);
+ }
+
+ return a;
+}
--- /dev/null
+/* PR rtl-optimization/64286 */
+/* { dg-do run } */
+/* { dg-options "-O2 -mavx2" } */
+/* { dg-require-effective-target avx2 } */
+
+#include <string.h>
+#include <stdlib.h>
+#include <x86intrin.h>
+#include "avx2-check.h"
+
+__m128i v;
+__m256i w;
+
+__attribute__((noinline, noclone)) void
+foo (__m128i *p, __m128i *q)
+{
+ __m128i a = _mm_loadu_si128 (p);
+ __m128i b = _mm_xor_si128 (a, v);
+ w = _mm256_cvtepu8_epi16 (a);
+ *q = b;
+}
+
+static void
+avx2_test (void)
+{
+ v = _mm_set1_epi8 (0x40);
+ __m128i c = _mm_set_epi8 (16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
+ __m128i d;
+ foo (&c, &d);
+ __m128i e = _mm_set_epi8 (0x50, 0x4f, 0x4e, 0x4d, 0x4c, 0x4b, 0x4a, 0x49,
+ 0x48, 0x47, 0x46, 0x45, 0x44, 0x43, 0x42, 0x41);
+ __m256i f = _mm256_set_epi16 (16, 15, 14, 13, 12, 11, 10, 9,
+ 8, 7, 6, 5, 4, 3, 2, 1);
+ if (memcmp (&w, &f, sizeof (w)) != 0
+ || memcmp (&d, &e, sizeof (d)) != 0)
+ abort ();
+}
/* Atom. */
assert (__builtin_cpu_is ("atom"));
break;
+ case 0x37:
+ case 0x4a:
+ case 0x4d:
+ case 0x5a:
+ case 0x5d:
+ /* Silvermont. */
+ assert (__builtin_cpu_is ("silvermont"));
+ break;
case 0x1a:
case 0x1e:
case 0x1f:
assert (__builtin_cpu_is ("westmere"));
break;
case 0x2a:
+ case 0x2d:
/* Sandy Bridge. */
assert (__builtin_cpu_is ("corei7"));
assert (__builtin_cpu_is ("sandybridge"));
break;
+ case 0x3a:
+ case 0x3e:
+ /* Ivy Bridge. */
+ assert (__builtin_cpu_is ("corei7"));
+ assert (__builtin_cpu_is ("ivybridge"));
+ break;
+ case 0x3c:
+ case 0x3f:
+ case 0x45:
+ case 0x46:
+ /* Haswell. */
+ assert (__builtin_cpu_is ("corei7"));
+ assert (__builtin_cpu_is ("haswell"));
+ break;
+ case 0x3d:
+ case 0x4f:
+ case 0x56:
+ /* Broadwell. */
+ assert (__builtin_cpu_is ("corei7"));
+ assert (__builtin_cpu_is ("broadwell"));
+ break;
case 0x17:
case 0x1d:
/* Penryn. */
--- /dev/null
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c;
+ asm ("# Magic instruction" : "=r" (a) : : "eax");
+ asm ("# Magic instruction" : "=r" (b) : : "edx");
+ asm ("# Magic instruction" : "=r" (c) : : "ecx");
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 1 } } */
--- /dev/null
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c;
+ asm ("# Magic instruction" : "=r" (a) : "r" (0) : "eax");
+ asm ("# Magic instruction" : "=r" (b) : "r" (0) : "edx");
+ asm ("# Magic instruction" : "=r" (c) : "r" (0) : "ecx");
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 1 } } */
--- /dev/null
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c;
+ asm ("# Magic instruction" : "=r" (a) : : "eax", "memory");
+ asm ("# Magic instruction" : "=r" (b) : : "edx", "memory");
+ asm ("# Magic instruction" : "=r" (c) : : "ecx", "memory");
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 3 } } */
--- /dev/null
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c;
+ asm ("# Magic instruction" : "=r" (a) : "r" (0) : "eax", "memory");
+ asm ("# Magic instruction" : "=r" (b) : "r" (0) : "edx", "memory");
+ asm ("# Magic instruction" : "=r" (c) : "r" (0) : "ecx", "memory");
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 3 } } */
--- /dev/null
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c, d, e, f;
+ asm ("# Magic instruction" : "=r" (a), "=r" (d) : : "eax");
+ asm ("# Magic instruction" : "=r" (b), "=r" (e) : : "edx");
+ asm ("# Magic instruction" : "=r" (c), "=r" (f) : : "ecx");
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 3 } } */
--- /dev/null
+/* PR rtl-optimization/63637 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a, b, c, d, e, f;
+ asm ("# Magic instruction" : "=r" (a), "=r" (d) : "r" (0) : "eax");
+ asm ("# Magic instruction" : "=r" (b), "=r" (e) : "r" (0) : "edx");
+ asm ("# Magic instruction" : "=r" (c), "=r" (f) : "r" (0) : "ecx");
+ return a + b + c;
+}
+
+/* { dg-final { scan-assembler-times "# Magic instruction" 3 } } */
--- /dev/null
+/* PR target/64513 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mstack-arg-probe" } */
+
+struct A {};
+struct B { struct A y; };
+int foo (struct A);
+
+int
+bar (int x)
+{
+ struct B b;
+ int c;
+ while (x--)
+ c = foo (b.y);
+ return c;
+}
/* emmintrin.h */
test_2 (_mm_shuffle_pd, __m128d, __m128d, __m128d, 1)
+test_1 (_mm_bsrli_si128, __m128i, __m128i, 1)
+test_1 (_mm_bslli_si128, __m128i, __m128i, 1)
test_1 (_mm_srli_si128, __m128i, __m128i, 1)
test_1 (_mm_slli_si128, __m128i, __m128i, 1)
test_1 (_mm_extract_epi16, int, __m128i, 1)
#endif
#include <emmintrin.h>
test_2 (_mm_shuffle_pd, __m128d, __m128d, __m128d, 1)
+test_1 (_mm_bsrli_si128, __m128i, __m128i, 1)
+test_1 (_mm_bslli_si128, __m128i, __m128i, 1)
test_1 (_mm_srli_si128, __m128i, __m128i, 1)
test_1 (_mm_slli_si128, __m128i, __m128i, 1)
test_1 (_mm_extract_epi16, int, __m128i, 1)
test_1 ( _mm256_shuffle_epi32, __m256i, __m256i, 1)
test_1 ( _mm256_shufflehi_epi16, __m256i, __m256i, 1)
test_1 ( _mm256_shufflelo_epi16, __m256i, __m256i, 1)
+test_1 ( _mm256_bslli_epi128, __m256i, __m256i, 8)
+test_1 ( _mm256_bsrli_epi128, __m256i, __m256i, 8)
test_1 ( _mm256_slli_si256, __m256i, __m256i, 8)
test_1 ( _mm256_srli_si256, __m256i, __m256i, 8)
test_2 ( _mm_blend_epi32, __m128i, __m128i, __m128i, 1)
--- /dev/null
+! { dg-do run }
+!
+! Fixes a bug that emerged from the fix of PR62044 - see the PR. When
+! there was no default initializer, code-expr3 was set null and so the
+! vpointer was set to the vtable of the declared type, rather than that
+! of the MOLD expression.
+!
+! Contributed by but based on the original PR62044 testcase by
+! Paul Thomas <pault@gcc.gnu.org>
+!
+module GridImageSilo_Template
+ implicit none
+ type, public, abstract :: GridImageSiloTemplate
+ end type GridImageSiloTemplate
+end module GridImageSilo_Template
+
+module UnstructuredGridImageSilo_Form
+ use GridImageSilo_Template
+ implicit none
+ type, public, extends ( GridImageSiloTemplate ) :: &
+ UnstructuredGridImageSiloForm
+ end type UnstructuredGridImageSiloForm
+end module UnstructuredGridImageSilo_Form
+
+module UnstructuredGridImages
+ use UnstructuredGridImageSilo_Form
+! 5.0 branch contains UnstructuredGridImageForm => UnstructuredGridImageSiloForm
+contains
+ subroutine foo
+ class (GridImageSiloTemplate), allocatable :: a
+ type (UnstructuredGridImageSiloForm) :: b
+ integer :: i = 0
+ allocate (a, mold = b)
+ select type (a)
+ type is (UnstructuredGridImageSiloForm)
+ i = 1
+ class default
+ i = 2
+ end select
+ if (i .ne. 1) call abort
+ end subroutine
+end module UnstructuredGridImages
+
+ use UnstructuredGridImages
+ call foo
+end
+
--- /dev/null
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+!
+! PR 60922: [4.9/5 regression] Memory leak with allocatable CLASS components
+!
+! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
+
+program test_leak
+ implicit none
+
+ type d_base_vect_type
+ end type
+
+ type d_vect_type
+ class(d_base_vect_type), allocatable :: v
+ end type
+
+ call test()
+
+contains
+
+ subroutine test()
+ class(d_vect_type), allocatable :: x
+ allocate(x)
+ allocate(x%v)
+ print *,"allocated!"
+ end subroutine
+
+end
+
+! { dg-final { scan-tree-dump-times "fini_coarray" 1 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
--- /dev/null
+! { dg-do run }
+!
+! PR 64230: [4.9/5 Regression] Invalid memory reference in a compiler-generated finalizer for allocatable component
+!
+! Contributed by Mat Cross <mathewc@nag.co.uk>
+
+Program main
+ Implicit None
+ Type :: t1
+ End Type
+ Type, Extends (t1) :: t2
+ Integer, Allocatable :: i
+ End Type
+ Type, Extends (t2) :: t3
+ Integer, Allocatable :: j
+ End Type
+ Class (t1), Allocatable :: t
+ Allocate (t3 :: t)
+ print *,"allocated!"
+ Deallocate (t)
+End
--- /dev/null
+! { dg-do compile }
+! { dg-options "-fcoarray=lib" }
+!
+! PR fortran/64771
+!
+! Contributed by Alessandro Fanfarill
+!
+! Reduced version of the full NAS CG benchmark
+!
+
+!-------------------------------------------------------------------------!
+! !
+! N A S P A R A L L E L B E N C H M A R K S 3.3 !
+! !
+! C G !
+! !
+!-------------------------------------------------------------------------!
+! !
+! This benchmark is part of the NAS Parallel Benchmark 3.3 suite. !
+! It is described in NAS Technical Reports 95-020 and 02-007 !
+! !
+! Permission to use, copy, distribute and modify this software !
+! for any purpose with or without fee is hereby granted. We !
+! request, however, that all derived work reference the NAS !
+! Parallel Benchmarks 3.3. This software is provided "as is" !
+! without express or implied warranty. !
+! !
+! Information on NPB 3.3, including the technical report, the !
+! original specifications, source code, results and information !
+! on how to submit new results, is available at: !
+! !
+! http://www.nas.nasa.gov/Software/NPB/ !
+! !
+! Send comments or suggestions to npb@nas.nasa.gov !
+! !
+! NAS Parallel Benchmarks Group !
+! NASA Ames Research Center !
+! Mail Stop: T27A-1 !
+! Moffett Field, CA 94035-1000 !
+! !
+! E-mail: npb@nas.nasa.gov !
+! Fax: (650) 604-3957 !
+! !
+!-------------------------------------------------------------------------!
+
+
+c---------------------------------------------------------------------
+c
+c Authors: M. Yarrow
+c C. Kuszmaul
+c R. F. Van der Wijngaart
+c H. Jin
+c
+c---------------------------------------------------------------------
+
+
+c---------------------------------------------------------------------
+c---------------------------------------------------------------------
+ program cg
+c---------------------------------------------------------------------
+c---------------------------------------------------------------------
+ implicit none
+
+ integer na, nonzer, niter
+ double precision shift, rcond
+ parameter( na=75000,
+ > nonzer=13,
+ > niter=75,
+ > shift=60.,
+ > rcond=1.0d-1 )
+
+
+
+ integer num_proc_rows, num_proc_cols
+ parameter( num_proc_rows = 2, num_proc_cols = 2)
+ integer num_procs
+ parameter( num_procs = num_proc_cols * num_proc_rows )
+
+ integer nz
+ parameter( nz = na*(nonzer+1)/num_procs*(nonzer+1)+nonzer
+ > + na*(nonzer+2+num_procs/256)/num_proc_cols )
+
+ common / partit_size / naa, nzz,
+ > npcols, nprows,
+ > proc_col, proc_row,
+ > firstrow,
+ > lastrow,
+ > firstcol,
+ > lastcol,
+ > exch_proc,
+ > exch_recv_length,
+ > send_start,
+ > send_len
+ integer naa, nzz,
+ > npcols, nprows,
+ > proc_col, proc_row,
+ > firstrow,
+ > lastrow,
+ > firstcol,
+ > lastcol,
+ > exch_proc,
+ > exch_recv_length,
+ > send_start,
+ > send_len
+
+
+ common / main_int_mem / colidx, rowstr,
+ > iv, arow, acol
+ integer colidx(nz), rowstr(na+1),
+ > iv(2*na+1), arow(nz), acol(nz)
+
+
+c---------------------------------
+c Coarray Decalarations
+c---------------------------------
+ double precision v(na+1)[0:*], aelt(nz)[0:*], a(nz)[0:*],
+ > x(na/num_proc_rows+2)[0:*],
+ > z(na/num_proc_rows+2)[0:*],
+ > p(na/num_proc_rows+2)[0:*],
+ > q(na/num_proc_rows+2)[0:*],
+ > r(na/num_proc_rows+2)[0:*],
+ > w(na/num_proc_rows+2)[0:*]
+
+
+ common /urando/ amult, tran
+ double precision amult, tran
+
+
+
+ integer l2npcols
+ integer reduce_exch_proc(num_proc_cols)
+ integer reduce_send_starts(num_proc_cols)
+ integer reduce_send_lengths(num_proc_cols)
+ integer reduce_recv_lengths(num_proc_cols)
+ integer reduce_rrecv_starts(num_proc_cols)
+c---------------------------------
+c Coarray Decalarations
+c---------------------------------
+ integer reduce_recv_starts(num_proc_cols)[0:*]
+
+ integer i, j, k, it, me, nprocs, root
+
+ double precision zeta, randlc
+ external randlc
+ double precision rnorm
+c---------------------------------
+c Coarray Decalarations
+c---------------------------------
+ double precision norm_temp1(2)[0:*], norm_temp2(2)[0:*]
+
+ double precision t, tmax, mflops
+ double precision u(1), umax(1)
+ external timer_read
+ double precision timer_read
+ character class
+ logical verified
+ double precision zeta_verify_value, epsilon, err
+
+c---------------------------------------------------------------------
+c Explicit interface for conj_grad, due to coarray args
+c---------------------------------------------------------------------
+ interface
+
+ subroutine conj_grad ( colidx,
+ > rowstr,
+ > x,
+ > z,
+ > a,
+ > p,
+ > q,
+ > r,
+ > w,
+ > rnorm,
+ > l2npcols,
+ > reduce_exch_proc,
+ > reduce_send_starts,
+ > reduce_send_lengths,
+ > reduce_recv_starts,
+ > reduce_recv_lengths,
+ > reduce_rrecv_starts )
+
+ common / partit_size / naa, nzz,
+ > npcols, nprows,
+ > proc_col, proc_row,
+ > firstrow,
+ > lastrow,
+ > firstcol,
+ > lastcol,
+ > exch_proc,
+ > exch_recv_length,
+ > send_start,
+ > send_len
+
+ integer naa, nzz,
+ > npcols, nprows,
+ > proc_col, proc_row,
+ > firstrow,
+ > lastrow,
+ > firstcol,
+ > lastcol,
+ > exch_proc,
+ > exch_recv_length,
+ > send_start,
+ > send_len
+
+ double precision x(*),
+ > z(*),
+ > a(nzz)
+ integer colidx(nzz), rowstr(naa+1)
+
+ double precision p(*),
+ > q(*)[0:*],
+ > r(*)[0:*],
+ > w(*)[0:*] ! used as work temporary
+
+ integer l2npcols
+ integer reduce_exch_proc(l2npcols)
+ integer reduce_send_starts(l2npcols)
+ integer reduce_send_lengths(l2npcols)
+ integer reduce_recv_starts(l2npcols)[0:*]
+ integer reduce_recv_lengths(l2npcols)
+ integer reduce_rrecv_starts(l2npcols)
+
+ double precision rnorm
+
+ end subroutine
+
+ end interface
+
+c---------------------------------------------------------------------
+c The call to the conjugate gradient routine:
+c---------------------------------------------------------------------
+ call conj_grad ( colidx,
+ > rowstr,
+ > x,
+ > z,
+ > a,
+ > p,
+ > q,
+ > r,
+ > w,
+ > rnorm,
+ > l2npcols,
+ > reduce_exch_proc,
+ > reduce_send_starts,
+ > reduce_send_lengths,
+ > reduce_recv_starts,
+ > reduce_recv_lengths,
+ > reduce_rrecv_starts )
+
+
+ sync all
+
+ end ! end main
+
+c---------------------------------------------------------------------
+c---------------------------------------------------------------------
+ subroutine conj_grad ( colidx,
+ > rowstr,
+ > x,
+ > z,
+ > a,
+ > p,
+ > q,
+ > r,
+ > w,
+ > rnorm,
+ > l2npcols,
+ > reduce_exch_proc,
+ > reduce_send_starts,
+ > reduce_send_lengths,
+ > reduce_recv_starts,
+ > reduce_recv_lengths,
+ > reduce_rrecv_starts )
+c---------------------------------------------------------------------
+c---------------------------------------------------------------------
+
+c---------------------------------------------------------------------
+c Floaging point arrays here are named as in NPB1 spec discussion of
+c CG algorithm
+c---------------------------------------------------------------------
+
+ implicit none
+
+c include 'cafnpb.h'
+
+ common / partit_size / naa, nzz,
+ > npcols, nprows,
+ > proc_col, proc_row,
+ > firstrow,
+ > lastrow,
+ > firstcol,
+ > lastcol,
+ > exch_proc,
+ > exch_recv_length,
+ > send_start,
+ > send_len
+ integer naa, nzz,
+ > npcols, nprows,
+ > proc_col, proc_row,
+ > firstrow,
+ > lastrow,
+ > firstcol,
+ > lastcol,
+ > exch_proc,
+ > exch_recv_length,
+ > send_start,
+ > send_len
+
+
+
+ double precision x(*),
+ > z(*),
+ > a(nzz)
+ integer colidx(nzz), rowstr(naa+1)
+
+ double precision p(*),
+ > q(*)[0:*],
+ > r(*)[0:*],
+ > w(*)[0:*] ! used as work temporary
+
+ integer l2npcols
+ integer reduce_exch_proc(l2npcols)
+ integer reduce_send_starts(l2npcols)
+ integer reduce_send_lengths(l2npcols)
+ integer reduce_recv_starts(l2npcols)[0:*]
+ integer reduce_recv_lengths(l2npcols)
+ integer reduce_rrecv_starts(l2npcols)
+
+ integer recv_start_idx, recv_end_idx, send_start_idx,
+ > send_end_idx, recv_length
+
+ integer i, j, k, ierr
+ integer cgit, cgitmax
+
+ double precision, save :: d[0:*], rho[0:*]
+ double precision sum, rho0, alpha, beta, rnorm
+
+ external timer_read
+ double precision timer_read
+
+ data cgitmax / 25 /
+
+
+ return
+ end ! end of routine conj_grad
+
--- /dev/null
+! { dg-do compile }
+! { dg-options "-fcoarray=single" }
+!
+ program cg
+ implicit none
+ integer reduce_recv_starts(2)[1,0:*]
+ interface
+ subroutine conj_grad (reduce_recv_starts) ! { dg-warning "Interface mismatch in global procedure 'conj_grad' at \\(1\\): Corank mismatch in argument 'reduce_recv_starts' \\(2/1\\)" }
+ integer reduce_recv_starts(2)[2, 2:*]
+ end subroutine
+ end interface
+ call conj_grad (reduce_recv_starts) ! Corank mismatch is okay
+ end
+
+ subroutine conj_grad (reduce_recv_starts)
+ implicit none
+ integer reduce_recv_starts(2)[2:*]
+ end
--- /dev/null
+! { dg-do run }
+! { dg-options "-Warray-temporaries" }
+! PR 57023
+! This used to cause wrong packing because a(1:n,1:n) was
+! assumed to be a full array.
+module mymod
+ implicit none
+contains
+ subroutine foo1(a,n)
+ integer, dimension(n,n), intent(inout) :: a
+ integer :: n
+ n = n - 1
+ call baz(a(1:n,1:n),n) ! { dg-warning "array temporary" }
+ end subroutine foo1
+
+ subroutine foo2(a,n)
+ integer, dimension(n,n), intent(inout) :: a
+ integer :: n
+ call decrement(n)
+ call baz(a(1:n,1:n),n) ! { dg-warning "array temporary" }
+ end subroutine foo2
+
+ subroutine foo3(a,n)
+ integer, dimension(n,n), intent(inout) :: a
+ integer :: n, m
+ m = n - 1
+ call baz(a(1:m,1:m),m) ! { dg-warning "array temporary" }
+ end subroutine foo3
+
+ subroutine foo4(a,n)
+ integer, dimension(n,n), intent(inout) :: a
+ integer, intent(in) :: n
+ a(1:n,1:n) = 1
+ end subroutine foo4
+
+ subroutine baz(a,n)
+ integer, dimension(n,n), intent(inout) :: a
+ integer, intent(in) :: n
+ a = 1
+ end subroutine baz
+
+ subroutine decrement(n)
+ integer, intent(inout) :: n
+ n = n - 1
+ end subroutine decrement
+
+end module mymod
+
+program main
+ use mymod
+ implicit none
+ integer, dimension(5,5) :: a, b
+ integer :: n
+
+ b = 0
+ b(1:4,1:4) = 1
+
+ n = 5
+ a = 0
+ call foo1(a,n)
+ if (any(a /= b)) call abort
+
+ n = 5
+ a = 0
+ call foo2(a,n)
+ if (any(a /= b)) call abort
+
+ n = 5
+ a = 0
+ call foo3(a,n)
+ if (any(a /= b)) call abort
+
+ n = 5
+ a = 0
+ call foo4(a,n)
+ if (any(a /= 1)) call abort
+end program main
--- /dev/null
+! PR fortran/64528
+! { dg-do compile }
+! { dg-options "-O -fno-tree-dce -fno-tree-ccp" }
+
+program pr64528
+ interface
+ subroutine foo(x)
+ integer, value :: x
+ end subroutine foo
+ end interface
+ integer :: x
+ x = 10
+ call foo(x)
+ if(x .ne. 10) then
+ endif
+end program pr64528
+subroutine foo(x)
+ integer, value :: x
+ x = 11
+end subroutine foo
--- /dev/null
+-- { dg-do run { target i?86-*-* x86_64-*-* alpha*-*-* ia64-*-* } }
+-- { dg-options "-O2" }
+
+with Ada.Characters.Handling; use Ada.Characters.Handling;
+with Interfaces; use Interfaces;
+with Ada.Unchecked_Conversion;
+
+procedure Opt47 is
+
+ subtype String4 is String (1 .. 4);
+ function To_String4 is new Ada.Unchecked_Conversion (Unsigned_32, String4);
+ type Arr is array (Integer range <>) of Unsigned_32;
+ Leaf : Arr (1 .. 4) := (1349478766, 1948272498, 1702436946, 1702061409);
+ Value : Unsigned_32;
+ Result : String (1 .. 32);
+ Last : Integer := 0;
+
+begin
+ for I in 1 .. 4 loop
+ Value := Leaf (I);
+ for J in reverse String4'Range loop
+ if Is_Graphic (To_String4 (Value)(J)) then
+ Last := Last + 1;
+ Result (Last) := To_String4 (Value)(J);
+ end if;
+ end loop;
+ end loop;
+ if Result (1) /= 'P' then
+ raise Program_Error;
+ end if;
+end;
with Ada.Unchecked_Conversion;
procedure Unchecked_Convert1 is
+
type Byte is mod 2**8;
type Stream is array (Natural range <>) of Byte;
return Do_Sum (To_Chunk (S(S'First .. S'First + Rec'Size / 8 - 1)));
end;
- A : Stream (1..9);
+ A : Stream (1..9) := (others => 0);
I : Integer;
begin
+ A (9) := 1;
I := Sum (A(1..8));
end;
static tree
get_attrs_for (const_tree x)
{
+ if (x == NULL_TREE)
+ return NULL_TREE;
+
switch (TREE_CODE (x))
{
case FUNCTION_DECL:
default:
if (TYPE_P (x))
- return NULL;
+ return NULL_TREE;
x = TREE_TYPE (x);
if (TREE_CODE (x) != POINTER_TYPE)
- return NULL;
+ return NULL_TREE;
/* FALLTHRU */
case POINTER_TYPE:
x = TREE_TYPE (x);
if (TREE_CODE (x) != FUNCTION_TYPE && TREE_CODE (x) != METHOD_TYPE)
- return NULL;
+ return NULL_TREE;
/* FALLTHRU */
case FUNCTION_TYPE:
tree type = TREE_TYPE (op0);
value_range_t *vr0 = get_value_range (op0);
- if (vr0->type != VR_VARYING
+ if (vr0->type == VR_RANGE
&& INTEGRAL_TYPE_P (type)
&& vrp_val_is_min (vr0->min)
&& vrp_val_is_max (vr0->max)
else if (TYPE_CANONICAL (type) != type)
/* Build the underlying canonical type, since it is different
from TYPE. */
- TYPE_CANONICAL (t) = build_qualified_type (TYPE_CANONICAL (type),
- type_quals);
+ {
+ tree c = build_qualified_type (TYPE_CANONICAL (type),
+ type_quals);
+ TYPE_CANONICAL (t) = TYPE_CANONICAL (c);
+ }
else
/* T is its own canonical type. */
TYPE_CANONICAL (t) = t;
+2015-01-21 Andrew Waterman <waterman@cs.berkeley.edu>
+
+ * fop_n.c (libat_fetch_op): Align address to word boundary.
+ (libat_op_fetch): Likewise.
+
2014-10-30 Release Manager
* GCC 4.9.2 released.
pre_barrier (smodel);
- wptr = (UWORD *)mptr;
- shift = 0;
- mask = -1;
+ wptr = (UWORD *)((uintptr_t)mptr & -WORDSIZE);
+ shift = (((uintptr_t)mptr % WORDSIZE) * CHAR_BIT) ^ SIZE(INVERT_MASK);
+ mask = SIZE(MASK) << shift;
wopval = (UWORD)opval << shift;
woldval = __atomic_load_n (wptr, __ATOMIC_RELAXED);
pre_barrier (smodel);
- wptr = (UWORD *)mptr;
- shift = 0;
- mask = -1;
+ wptr = (UWORD *)((uintptr_t)mptr & -WORDSIZE);
+ shift = (((uintptr_t)mptr % WORDSIZE) * CHAR_BIT) ^ SIZE(INVERT_MASK);
+ mask = SIZE(MASK) << shift;
wopval = (UWORD)opval << shift;
woldval = __atomic_load_n (wptr, __ATOMIC_RELAXED);
+2015-01-26 Matthias Klose <doko@ubuntu.com>
+
+ * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
+ * configure: Regenerate.
+
2014-10-30 Release Manager
* GCC 4.9.2 released.
WARN_FLAGS
EXTRA_FLAGS
BACKTRACE_FILE
-multi_basedir
OTOOL64
OTOOL
LIPO
build_vendor
build_cpu
build
+multi_basedir
target_alias
host_alias
build_alias
ac_subst_files=''
ac_user_opts='
enable_option_checking
+enable_multilib
enable_maintainer_mode
with_target_subdir
enable_shared
enable_fast_install
with_gnu_ld
enable_libtool_lock
-enable_multilib
with_system_libunwind
enable_host_shared
'
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-multilib build many library versions (default)
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
--enable-shared[=PKGS] build shared libraries [default=no]
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
- --enable-multilib build many library versions (default)
--enable-host-shared build host code as shared libraries
Optional Packages:
ac_config_headers="$ac_config_headers config.h"
+if test -n "${with_target_subdir}"; then
+ # Default to --enable-multilib
+# Check whether --enable-multilib was given.
+if test "${enable_multilib+set}" = set; then :
+ enableval=$enable_multilib; case "$enableval" in
+ yes) multilib=yes ;;
+ no) multilib=no ;;
+ *) as_fn_error "bad value $enableval for multilib option" "$LINENO" 5 ;;
+ esac
+else
+ multilib=yes
+fi
+
+
+# We may get other options which we leave undocumented:
+# --with-target-subdir, --with-multisrctop, --with-multisubdir
+# See config-ml.in if you want the gory details.
+
+if test "$srcdir" = "."; then
+ if test "$with_target_subdir" != "."; then
+ multi_basedir="$srcdir/$with_multisrctop../.."
+ else
+ multi_basedir="$srcdir/$with_multisrctop.."
+ fi
+else
+ multi_basedir="$srcdir/.."
+fi
+
+
+# Even if the default multilib is not a cross compilation,
+# it may be that some of the other multilibs are.
+if test $cross_compiling = no && test $multilib = yes \
+ && test "x${with_multisubdir}" != x ; then
+ cross_compiling=maybe
+fi
+
+ac_config_commands="$ac_config_commands default-1"
+
+fi
+
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
for ac_t in install-sh install.sh shtool; do
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11092 "configure"
+#line 11132 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11198 "configure"
+#line 11238 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
if test -n "${with_target_subdir}"; then
# We are compiling a GCC library. We can assume that the unwind
# library exists.
- # Default to --enable-multilib
-# Check whether --enable-multilib was given.
-if test "${enable_multilib+set}" = set; then :
- enableval=$enable_multilib; case "$enableval" in
- yes) multilib=yes ;;
- no) multilib=no ;;
- *) as_fn_error "bad value $enableval for multilib option" "$LINENO" 5 ;;
- esac
-else
- multilib=yes
-fi
-
-
-# We may get other options which we leave undocumented:
-# --with-target-subdir, --with-multisrctop, --with-multisubdir
-# See config-ml.in if you want the gory details.
-
-if test "$srcdir" = "."; then
- if test "$with_target_subdir" != "."; then
- multi_basedir="$srcdir/$with_multisrctop../.."
- else
- multi_basedir="$srcdir/$with_multisrctop.."
- fi
-else
- multi_basedir="$srcdir/.."
-fi
-
-
-# Even if the default multilib is not a cross compilation,
-# it may be that some of the other multilibs are.
-if test $cross_compiling = no && test $multilib = yes \
- && test "x${with_multisubdir}" != x ; then
- cross_compiling=maybe
-fi
-
-ac_config_commands="$ac_config_commands default-1"
-
BACKTRACE_FILE="backtrace.lo simple.lo"
else
ac_fn_c_check_header_mongrel "$LINENO" "unwind.h" "ac_cv_header_unwind_h" "$ac_includes_default"
# INIT-COMMANDS
#
+srcdir="$srcdir"
+host="$host"
+target="$target"
+with_multisubdir="$with_multisubdir"
+with_multisrctop="$with_multisrctop"
+with_target_subdir="$with_target_subdir"
+ac_configure_args="${multilib_arg} ${ac_configure_args}"
+multi_basedir="$multi_basedir"
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+CC="$CC"
+CXX="$CXX"
+GFORTRAN="$GFORTRAN"
+GCJ="$GCJ"
+
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
-srcdir="$srcdir"
-host="$host"
-target="$target"
-with_multisubdir="$with_multisubdir"
-with_multisrctop="$with_multisrctop"
-with_target_subdir="$with_target_subdir"
-ac_configure_args="${multilib_arg} ${ac_configure_args}"
-multi_basedir="$multi_basedir"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-CC="$CC"
-CXX="$CXX"
-GFORTRAN="$GFORTRAN"
-GCJ="$GCJ"
-
GCC="$GCC"
CC="$CC"
acx_cv_header_stdint="$acx_cv_header_stdint"
do
case $ac_config_target in
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
- "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
"default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
+ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
"gstdint.h") CONFIG_COMMANDS="$CONFIG_COMMANDS gstdint.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"backtrace-supported.h") CONFIG_FILES="$CONFIG_FILES backtrace-supported.h" ;;
case $ac_file$ac_mode in
+ "default-1":C)
+# Only add multilib support code if we just rebuilt the top-level
+# Makefile.
+case " $CONFIG_FILES " in
+ *" Makefile "*)
+ ac_file=Makefile . ${multi_basedir}/config-ml.in
+ ;;
+esac ;;
"libtool":C)
# See if we are running on zsh, and set the options which allow our
chmod +x "$ofile"
;;
- "default-1":C)
-# Only add multilib support code if we just rebuilt the top-level
-# Makefile.
-case " $CONFIG_FILES " in
- *" Makefile "*)
- ac_file=Makefile . ${multi_basedir}/config-ml.in
- ;;
-esac ;;
"gstdint.h":C)
if test "$GCC" = yes; then
echo "/* generated for " `$CC --version | sed 1q` "*/" > tmp-stdint.h
AC_CONFIG_SRCDIR(backtrace.h)
AC_CONFIG_HEADER(config.h)
+if test -n "${with_target_subdir}"; then
+ AM_ENABLE_MULTILIB(, ..)
+fi
+
AC_CANONICAL_SYSTEM
target_alias=${target_alias-$host_alias}
if test -n "${with_target_subdir}"; then
# We are compiling a GCC library. We can assume that the unwind
# library exists.
- AM_ENABLE_MULTILIB(, ..)
BACKTRACE_FILE="backtrace.lo simple.lo"
else
AC_CHECK_HEADER([unwind.h],
+2015-01-26 Matthias Klose <doko@ubuntu.com>
+
+ * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
+ * configure: Regenerate.
+
2014-10-30 Release Manager
* GCC 4.9.2 released.
GREP
CPP
ALLOCA
-multi_basedir
am__fastdepCXX_FALSE
am__fastdepCXX_TRUE
CXXDEPMODE
LDFLAGS
CFLAGS
CC
+multi_basedir
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
ac_user_opts='
enable_option_checking
enable_maintainer_mode
-enable_dependency_tracking
enable_multilib
+enable_dependency_tracking
enable_version_specific_runtime_libs
enable_shared
enable_static
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
+ --enable-multilib build many library versions (default)
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
- --enable-multilib build many library versions (default)
--enable-version-specific-runtime-libs
Specify that runtime libraries should be installed
in a compi ler-specific directory
+# Default to --enable-multilib
+# Check whether --enable-multilib was given.
+if test "${enable_multilib+set}" = set; then :
+ enableval=$enable_multilib; case "$enableval" in
+ yes) multilib=yes ;;
+ no) multilib=no ;;
+ *) as_fn_error "bad value $enableval for multilib option" "$LINENO" 5 ;;
+ esac
+else
+ multilib=yes
+fi
+
+
+# We may get other options which we leave undocumented:
+# --with-target-subdir, --with-multisrctop, --with-multisubdir
+# See config-ml.in if you want the gory details.
+
+if test "$srcdir" = "."; then
+ if test "$with_target_subdir" != "."; then
+ multi_basedir="$srcdir/$with_multisrctop../.."
+ else
+ multi_basedir="$srcdir/$with_multisrctop.."
+ fi
+else
+ multi_basedir="$srcdir/.."
+fi
+
+
+# Even if the default multilib is not a cross compilation,
+# it may be that some of the other multilibs are.
+if test $cross_compiling = no && test $multilib = yes \
+ && test "x${with_multisubdir}" != x ; then
+ cross_compiling=maybe
+fi
+
+ac_config_commands="$ac_config_commands default-1"
+
+
# Build a DLL on Windows
# AC_LIBTOOL_WIN32_DLL
ac_ext=c
# AC_CONFIG_MACRO_DIR([..])
ac_config_files="$ac_config_files Makefile libcilkrts.spec"
-# Default to --enable-multilib
-# Check whether --enable-multilib was given.
-if test "${enable_multilib+set}" = set; then :
- enableval=$enable_multilib; case "$enableval" in
- yes) multilib=yes ;;
- no) multilib=no ;;
- *) as_fn_error "bad value $enableval for multilib option" "$LINENO" 5 ;;
- esac
-else
- multilib=yes
-fi
-
-
-# We may get other options which we leave undocumented:
-# --with-target-subdir, --with-multisrctop, --with-multisubdir
-# See config-ml.in if you want the gory details.
-
-if test "$srcdir" = "."; then
- if test "$with_target_subdir" != "."; then
- multi_basedir="$srcdir/$with_multisrctop../.."
- else
- multi_basedir="$srcdir/$with_multisrctop.."
- fi
-else
- multi_basedir="$srcdir/.."
-fi
-
-
-# Even if the default multilib is not a cross compilation,
-# it may be that some of the other multilibs are.
-if test $cross_compiling = no && test $multilib = yes \
- && test "x${with_multisubdir}" != x ; then
- cross_compiling=maybe
-fi
-
-ac_config_commands="$ac_config_commands default-1"
-
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11060 "configure"
+#line 11061 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11166 "configure"
+#line 11167 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
#
# INIT-COMMANDS
#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
srcdir="$srcdir"
host="$host"
CXX="$CXX"
GFORTRAN="$GFORTRAN"
GCJ="$GCJ"
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
# The HP-UX ksh and POSIX shell print the target directory to stdout
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
+ "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"libcilkrts.spec") CONFIG_FILES="$CONFIG_FILES libcilkrts.spec" ;;
- "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
*) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
case $ac_file$ac_mode in
+ "default-1":C)
+# Only add multilib support code if we just rebuilt the top-level
+# Makefile.
+case " $CONFIG_FILES " in
+ *" Makefile "*)
+ ac_file=Makefile . ${multi_basedir}/config-ml.in
+ ;;
+esac ;;
"depfiles":C) test x"$AMDEP_TRUE" != x"" || {
# Autoconf 2.62 quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
done
}
;;
- "default-1":C)
-# Only add multilib support code if we just rebuilt the top-level
-# Makefile.
-case " $CONFIG_FILES " in
- *" Makefile "*)
- ac_file=Makefile . ${multi_basedir}/config-ml.in
- ;;
-esac ;;
"libtool":C)
# See if we are running on zsh, and set the options which allow our
AM_MAINTAINER_MODE
+AM_ENABLE_MULTILIB(, ..)
+
# Build a DLL on Windows
# AC_LIBTOOL_WIN32_DLL
AC_PROG_CC
# AC_PROG_LIBTOOL
# AC_CONFIG_MACRO_DIR([..])
AC_CONFIG_FILES([Makefile libcilkrts.spec])
-AM_ENABLE_MULTILIB(, ..)
AC_FUNC_ALLOCA
# Check whether the target supports protected visibility.
+2015-02-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ Backported from mainline
+ 2015-01-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/cpuinfo.c (processor_subtypes): Add
+ INTEL_COREI7_BROADWELL.
+ (get_intel_cpu): Support new Silvermont, Haswell and Broadwell
+ model numbers.
+
+2015-01-31 John David Anglin <danglin@gcc.gnu.org>
+
+ * config/pa/linux-atomic.c (__kernel_cmpxchg2): Change declaration of
+ oldval and newval to const void *. Fix typo.
+ (FETCH_AND_OP_2): Use __atomic_load_n to load value.
+ (FETCH_AND_OP_WORD): Likewise.
+ (OP_AND_FETCH_WORD): Likewise.
+ (COMPARE_AND_SWAP_2): Likewise.
+ (__sync_val_compare_and_swap_4): Likewise.
+ (__sync_lock_test_and_set_4): Likewise.
+ (SYNC_LOCK_RELEASE_2): Likewise.
+ Remove support for long long atomic operations.
+
+2015-01-20 Chung-Lin Tang <cltang@codesourcery.com>
+
+ Backport from mainline
+ * config/nios2/linux-unwind.h (nios2_fallback_frame_state):
+ Update rt_sigframe format and address for current Nios II
+ Linux conventions.
+
2014-12-09 John David Anglin <danglin@gcc.gnu.org>
Backport from mainline
AMDFAM15H_BDVER4,
INTEL_COREI7_IVYBRIDGE,
INTEL_COREI7_HASWELL,
+ INTEL_COREI7_BROADWELL,
CPU_SUBTYPE_MAX
};
__cpu_model.__cpu_type = INTEL_BONNELL;
break;
case 0x37:
+ case 0x4a:
case 0x4d:
+ case 0x5a:
+ case 0x5d:
/* Silvermont. */
__cpu_model.__cpu_type = INTEL_SILVERMONT;
break;
__cpu_model.__cpu_subtype = INTEL_COREI7_IVYBRIDGE;
break;
case 0x3c:
+ case 0x3f:
case 0x45:
case 0x46:
/* Haswell. */
__cpu_model.__cpu_type = INTEL_COREI7;
__cpu_model.__cpu_subtype = INTEL_COREI7_HASWELL;
break;
+ case 0x3d:
+ case 0x4f:
+ case 0x56:
+ /* Broadwell. */
+ __cpu_model.__cpu_type = INTEL_COREI7;
+ __cpu_model.__cpu_subtype = INTEL_COREI7_BROADWELL;
+ break;
case 0x17:
case 0x1d:
/* Penryn. */
if (pc[0] == (0x00800004 | (__NR_rt_sigreturn << 6)))
{
struct rt_sigframe {
- char retcode[12];
siginfo_t info;
struct nios2_ucontext uc;
- } *rt_ = context->ra;
+ } *rt_ = context->cfa;
struct nios2_mcontext *regs = &rt_->uc.uc_mcontext;
int i;
}
static inline long
-__kernel_cmpxchg2 (void * oldval, void * newval, void *mem, int val_size)
+__kernel_cmpxchg2 (const void *oldval, const void *newval, void *mem,
+ int val_size)
{
register unsigned long lws_mem asm("r26") = (unsigned long) (mem);
register long lws_ret asm("r28");
if (__builtin_expect (lws_errno == -EFAULT || lws_errno == -ENOSYS, 0))
__builtin_trap ();
- /* If the kernel LWS call fails, retrun EBUSY */
+ /* If the kernel LWS call fails, return EBUSY */
if (!lws_errno && lws_ret)
lws_errno = -EBUSY;
int failure; \
\
do { \
- tmp = *ptr; \
+ tmp = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \
newval = PFX_OP (tmp INF_OP val); \
failure = __kernel_cmpxchg2 (&tmp, &newval, ptr, INDEX); \
} while (failure != 0); \
return tmp; \
}
-FETCH_AND_OP_2 (add, , +, long long, 8, 3)
-FETCH_AND_OP_2 (sub, , -, long long, 8, 3)
-FETCH_AND_OP_2 (or, , |, long long, 8, 3)
-FETCH_AND_OP_2 (and, , &, long long, 8, 3)
-FETCH_AND_OP_2 (xor, , ^, long long, 8, 3)
-FETCH_AND_OP_2 (nand, ~, &, long long, 8, 3)
-
FETCH_AND_OP_2 (add, , +, short, 2, 1)
FETCH_AND_OP_2 (sub, , -, short, 2, 1)
FETCH_AND_OP_2 (or, , |, short, 2, 1)
int failure; \
\
do { \
- tmp = *ptr; \
+ tmp = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \
newval = PFX_OP (tmp INF_OP val); \
failure = __kernel_cmpxchg2 (&tmp, &newval, ptr, INDEX); \
} while (failure != 0); \
return PFX_OP (tmp INF_OP val); \
}
-OP_AND_FETCH_2 (add, , +, long long, 8, 3)
-OP_AND_FETCH_2 (sub, , -, long long, 8, 3)
-OP_AND_FETCH_2 (or, , |, long long, 8, 3)
-OP_AND_FETCH_2 (and, , &, long long, 8, 3)
-OP_AND_FETCH_2 (xor, , ^, long long, 8, 3)
-OP_AND_FETCH_2 (nand, ~, &, long long, 8, 3)
-
OP_AND_FETCH_2 (add, , +, short, 2, 1)
OP_AND_FETCH_2 (sub, , -, short, 2, 1)
OP_AND_FETCH_2 (or, , |, short, 2, 1)
int failure, tmp; \
\
do { \
- tmp = *ptr; \
+ tmp = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \
failure = __kernel_cmpxchg (tmp, PFX_OP (tmp INF_OP val), ptr); \
} while (failure != 0); \
\
int tmp, failure; \
\
do { \
- tmp = *ptr; \
+ tmp = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \
failure = __kernel_cmpxchg (tmp, PFX_OP (tmp INF_OP val), ptr); \
} while (failure != 0); \
\
\
while (1) \
{ \
- actual_oldval = *ptr; \
+ actual_oldval = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \
\
if (__builtin_expect (oldval != actual_oldval, 0)) \
return actual_oldval; \
\
if (__builtin_expect (!fail, 1)) \
return actual_oldval; \
- } \
+ } \
} \
\
bool HIDDEN \
return (failure != 0); \
}
-COMPARE_AND_SWAP_2 (long long, 8, 3)
COMPARE_AND_SWAP_2 (short, 2, 1)
COMPARE_AND_SWAP_2 (char, 1, 0)
while (1)
{
- actual_oldval = *ptr;
+ actual_oldval = __atomic_load_n (ptr, __ATOMIC_SEQ_CST);
if (__builtin_expect (oldval != actual_oldval, 0))
return actual_oldval;
int failure; \
\
do { \
- oldval = *ptr; \
+ oldval = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \
failure = __kernel_cmpxchg2 (&oldval, &val, ptr, INDEX); \
} while (failure != 0); \
\
return oldval; \
}
-SYNC_LOCK_TEST_AND_SET_2 (long long, 8, 3)
SYNC_LOCK_TEST_AND_SET_2 (short, 2, 1)
SYNC_LOCK_TEST_AND_SET_2 (signed char, 1, 0)
int failure, oldval;
do {
- oldval = *ptr;
+ oldval = __atomic_load_n (ptr, __ATOMIC_SEQ_CST);
failure = __kernel_cmpxchg (oldval, val, ptr);
} while (failure != 0);
TYPE failure, oldval, zero = 0; \
\
do { \
- oldval = *ptr; \
+ oldval = __atomic_load_n (ptr, __ATOMIC_SEQ_CST); \
failure = __kernel_cmpxchg2 (&oldval, &zero, ptr, INDEX); \
} while (failure != 0); \
}
-SYNC_LOCK_RELEASE_2 (long long, 8, 3)
SYNC_LOCK_RELEASE_2 (short, 2, 1)
SYNC_LOCK_RELEASE_2 (signed char, 1, 0)
+2015-01-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/64734
+ * libgomp.c/pr64734.c: New test.
+
2014-12-03 Uros Bizjak <ubizjak@gmail.com>
* configure.tgt (x86_64-*-linux*): Tune -m32 multilib to generic.
--- /dev/null
+/* PR middle-end/64734 */
+
+#include <stdlib.h>
+
+void
+foo (int *x, int *y)
+{
+ #pragma omp target map (alloc:x[0]) map (alloc:y[0:8])
+ {
+ int i;
+ for (i = 0; i < 8; i++)
+ if (y[i] != 2 + i)
+ break;
+ if (i != 8 || *x != 1)
+ *x = 6;
+ else
+ {
+ *x = 8;
+ for (i = 0; i < 8; i++)
+ y[i] = 9 + i;
+ }
+ }
+ #pragma omp target update from (y[0:8]) from (x[0])
+}
+
+void
+bar (void)
+{
+ int x = 1, y[32] = { 0 };
+ #pragma omp target data map (to:y[0:32]) map (to:x)
+ ;
+}
+
+int
+main ()
+{
+ int x = 1, y[8] = { 2, 3, 4, 5, 6, 7, 8, 9 }, i;
+ #pragma omp target data map (to:y[0:8]) map (to:x)
+ ;
+ #pragma omp target data map (to:y[0:8]) map (to:x)
+ {
+ #pragma omp target update from (y[0:8]) from (x)
+ }
+
+ #pragma omp target data map (to:y[0:8]) map (to:x)
+ foo (&x, &y[0]);
+
+ if (x != 8)
+ abort ();
+ for (i = 0; i < 8; i++)
+ if (y[i] != 9 + i)
+ abort ();
+
+ return 0;
+}
+2015-01-26 Matthias Klose <doko@ubuntu.com>
+
+ * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
+ * configure: Regenerate.
+
2014-10-30 Release Manager
* GCC 4.9.2 released.
LIBQUAD_USE_SYMVER_TRUE
toolexeclibdir
toolexecdir
-multi_basedir
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
+multi_basedir
target_noncanonical
target_os
target_vendor
ac_subst_files=''
ac_user_opts='
enable_option_checking
+enable_multilib
enable_version_specific_runtime_libs
enable_dependency_tracking
with_bugurl
with_gnu_ld
enable_libtool_lock
enable_maintainer_mode
-enable_multilib
enable_symvers
enable_generated_files_in_srcdir
'
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-multilib build many library versions (default)
--enable-version-specific-runtime-libs
specify that runtime libraries should be installed
in a compiler-specific directory
--disable-libtool-lock avoid locking (might break parallel builds)
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
- --enable-multilib build many library versions (default)
--disable-symvers disable symbol versioning for libquadmath
--enable-generated-files-in-srcdir
put copies of generated files in source dir intended
+# Default to --enable-multilib
+# Check whether --enable-multilib was given.
+if test "${enable_multilib+set}" = set; then :
+ enableval=$enable_multilib; case "$enableval" in
+ yes) multilib=yes ;;
+ no) multilib=no ;;
+ *) as_fn_error "bad value $enableval for multilib option" "$LINENO" 5 ;;
+ esac
+else
+ multilib=yes
+fi
+
+
+# We may get other options which we leave undocumented:
+# --with-target-subdir, --with-multisrctop, --with-multisubdir
+# See config-ml.in if you want the gory details.
+
+if test "$srcdir" = "."; then
+ if test "$with_target_subdir" != "."; then
+ multi_basedir="$srcdir/$with_multisrctop../.."
+ else
+ multi_basedir="$srcdir/$with_multisrctop.."
+ fi
+else
+ multi_basedir="$srcdir/.."
+fi
+
+
+# Even if the default multilib is not a cross compilation,
+# it may be that some of the other multilibs are.
+if test $cross_compiling = no && test $multilib = yes \
+ && test "x${with_multisubdir}" != x ; then
+ cross_compiling=maybe
+fi
+
+ac_config_commands="$ac_config_commands default-1"
+
+
target_alias=${target_alias-$host_alias}
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10530 "configure"
+#line 10568 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10636 "configure"
+#line 10674 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
MAINT=$MAINTAINER_MODE_TRUE
-# Default to --enable-multilib
-# Check whether --enable-multilib was given.
-if test "${enable_multilib+set}" = set; then :
- enableval=$enable_multilib; case "$enableval" in
- yes) multilib=yes ;;
- no) multilib=no ;;
- *) as_fn_error "bad value $enableval for multilib option" "$LINENO" 5 ;;
- esac
-else
- multilib=yes
-fi
-
-
-# We may get other options which we leave undocumented:
-# --with-target-subdir, --with-multisrctop, --with-multisubdir
-# See config-ml.in if you want the gory details.
-
-if test "$srcdir" = "."; then
- if test "$with_target_subdir" != "."; then
- multi_basedir="$srcdir/$with_multisrctop../.."
- else
- multi_basedir="$srcdir/$with_multisrctop.."
- fi
-else
- multi_basedir="$srcdir/.."
-fi
-
-
-# Even if the default multilib is not a cross compilation,
-# it may be that some of the other multilibs are.
-if test $cross_compiling = no && test $multilib = yes \
- && test "x${with_multisubdir}" != x ; then
- cross_compiling=maybe
-fi
-
-ac_config_commands="$ac_config_commands default-1"
-
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
#
# INIT-COMMANDS
#
+
+srcdir="$srcdir"
+host="$host"
+target="$target"
+with_multisubdir="$with_multisubdir"
+with_multisrctop="$with_multisrctop"
+with_target_subdir="$with_target_subdir"
+ac_configure_args="${multilib_arg} ${ac_configure_args}"
+multi_basedir="$multi_basedir"
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+CC="$CC"
+CXX="$CXX"
+GFORTRAN="$GFORTRAN"
+GCJ="$GCJ"
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-srcdir="$srcdir"
-host="$host"
-target="$target"
-with_multisubdir="$with_multisubdir"
-with_multisrctop="$with_multisrctop"
-with_target_subdir="$with_target_subdir"
-ac_configure_args="${multilib_arg} ${ac_configure_args}"
-multi_basedir="$multi_basedir"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-CC="$CC"
-CXX="$CXX"
-GFORTRAN="$GFORTRAN"
-GCJ="$GCJ"
-
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
do
case $ac_config_target in
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
- "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
*) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
case $ac_file$ac_mode in
+ "default-1":C)
+# Only add multilib support code if we just rebuilt the top-level
+# Makefile.
+case " $CONFIG_FILES " in
+ *" Makefile "*)
+ ac_file=Makefile . ${multi_basedir}/config-ml.in
+ ;;
+esac ;;
"depfiles":C) test x"$AMDEP_TRUE" != x"" || {
# Autoconf 2.62 quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
chmod +x "$ofile"
;;
- "default-1":C)
-# Only add multilib support code if we just rebuilt the top-level
-# Makefile.
-case " $CONFIG_FILES " in
- *" Makefile "*)
- ac_file=Makefile . ${multi_basedir}/config-ml.in
- ;;
-esac ;;
esac
done # for ac_tag
AC_CANONICAL_SYSTEM
ACX_NONCANONICAL_TARGET
+AM_ENABLE_MULTILIB(, ..)
+
target_alias=${target_alias-$host_alias}
AC_SUBST(target_alias)
AC_SUBST(enable_static)
AM_MAINTAINER_MODE
-AM_ENABLE_MULTILIB(, ..)
AC_LANG_C
# The same as in boehm-gc and libstdc++. Have to borrow it from there.
+2015-01-27 Matthias Klose <doko@ubuntu.com>
+
+ * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
+ * configure: Regenerate.
+
2014-10-30 Release Manager
* GCC 4.9.2 released.
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
-multi_basedir
am__fastdepCC_FALSE
am__fastdepCC_TRUE
CCDEPMODE
LDFLAGS
CFLAGS
CC
+multi_basedir
target_alias
host_alias
build_alias
ac_subst_files=''
ac_user_opts='
enable_option_checking
+enable_multilib
enable_version_specific_runtime_libs
enable_dependency_tracking
-enable_multilib
enable_maintainer_mode
enable_shared
enable_static
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-multilib build many library versions (default)
--enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
- --enable-multilib build many library versions (default)
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
--enable-shared[=PKGS] build shared libraries [default=yes]
+# Default to --enable-multilib
+# Check whether --enable-multilib was given.
+if test "${enable_multilib+set}" = set; then :
+ enableval=$enable_multilib; case "$enableval" in
+ yes) multilib=yes ;;
+ no) multilib=no ;;
+ *) as_fn_error "bad value $enableval for multilib option" "$LINENO" 5 ;;
+ esac
+else
+ multilib=yes
+fi
+
+
+# We may get other options which we leave undocumented:
+# --with-target-subdir, --with-multisrctop, --with-multisubdir
+# See config-ml.in if you want the gory details.
+
+if test "$srcdir" = "."; then
+ if test "$with_target_subdir" != "."; then
+ multi_basedir="$srcdir/$with_multisrctop../.."
+ else
+ multi_basedir="$srcdir/$with_multisrctop.."
+ fi
+else
+ multi_basedir="$srcdir/.."
+fi
+
+
+# Even if the default multilib is not a cross compilation,
+# it may be that some of the other multilibs are.
+if test $cross_compiling = no && test $multilib = yes \
+ && test "x${with_multisubdir}" != x ; then
+ cross_compiling=maybe
+fi
+
+ac_config_commands="$ac_config_commands default-1"
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-version-specific-runtime-libs" >&5
$as_echo_n "checking for --enable-version-specific-runtime-libs... " >&6; }
# Check whether --enable-version-specific-runtime-libs was given.
-# Default to --enable-multilib
-# Check whether --enable-multilib was given.
-if test "${enable_multilib+set}" = set; then :
- enableval=$enable_multilib; case "$enableval" in
- yes) multilib=yes ;;
- no) multilib=no ;;
- *) as_fn_error "bad value $enableval for multilib option" "$LINENO" 5 ;;
- esac
-else
- multilib=yes
-fi
-
-
-# We may get other options which we leave undocumented:
-# --with-target-subdir, --with-multisrctop, --with-multisubdir
-# See config-ml.in if you want the gory details.
-
-if test "$srcdir" = "."; then
- if test "$with_target_subdir" != "."; then
- multi_basedir="$srcdir/$with_multisrctop../.."
- else
- multi_basedir="$srcdir/$with_multisrctop.."
- fi
-else
- multi_basedir="$srcdir/.."
-fi
-
-
-# Even if the default multilib is not a cross compilation,
-# it may be that some of the other multilibs are.
-if test $cross_compiling = no && test $multilib = yes \
- && test "x${with_multisubdir}" != x ; then
- cross_compiling=maybe
-fi
-
-ac_config_commands="$ac_config_commands default-1"
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12022 "configure"
+#line 12023 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12128 "configure"
+#line 12129 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
#
# INIT-COMMANDS
#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
srcdir="$srcdir"
host="$host"
CXX="$CXX"
GFORTRAN="$GFORTRAN"
GCJ="$GCJ"
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
# The HP-UX ksh and POSIX shell print the target directory to stdout
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
- "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
"gstdint.h") CONFIG_COMMANDS="$CONFIG_COMMANDS gstdint.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
case $ac_file$ac_mode in
+ "default-1":C)
+# Only add multilib support code if we just rebuilt the top-level
+# Makefile.
+case " $CONFIG_FILES " in
+ *" Makefile "*)
+ ac_file=Makefile . ${multi_basedir}/config-ml.in
+ ;;
+esac ;;
"depfiles":C) test x"$AMDEP_TRUE" != x"" || {
# Autoconf 2.62 quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
done
}
;;
- "default-1":C)
-# Only add multilib support code if we just rebuilt the top-level
-# Makefile.
-case " $CONFIG_FILES " in
- *" Makefile "*)
- ac_file=Makefile . ${multi_basedir}/config-ml.in
- ;;
-esac ;;
"libtool":C)
# See if we are running on zsh, and set the options which allow our
AC_INIT(package-unused, version-unused, libsanitizer)
AC_CONFIG_SRCDIR([include/sanitizer/common_interface_defs.h])
+AM_ENABLE_MULTILIB(, ..)
+
AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
AC_ARG_ENABLE(version-specific-runtime-libs,
[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
GCC_LIBSTDCXX_RAW_CXX_FLAGS
AM_INIT_AUTOMAKE(foreign no-dist)
-AM_ENABLE_MULTILIB(, ..)
AM_MAINTAINER_MODE
# Calculate toolexeclibdir
+2015-02-03 Tim Shen <timshen@google.com>
+
+ PR libstdc++/64680
+ Backported from mainline
+ 2015-01-22 Tim Shen <timshen@google.com>
+
+ * include/bits/regex.h (basic_regex<>::basic_regex,
+ basic_regex<>::operator=, basic_regex<>::imbue): Conform to the
+ standard interface.
+ * testsuite/28_regex/basic_regex/assign/char/cstring.cc: New testcase.
+
+2015-02-03 Tim Shen <timshen@google.com>
+
+ PR libstdc++/64649
+ Backported from mainline
+ 2015-01-22 Tim Shen <timshen@google.com>
+
+ * include/bits/regex.tcc (regex_traits<>::lookup_collatename,
+ regex_traits<>::lookup_classname): Correctly narrow input chars.
+ * testsuite/28_regex/traits/wchar_t/user_defined.cc: New testcase.
+
+2015-01-19 Tim Shen <timshen@google.com>
+
+ PR libstdc++/64649
+ Backported from mainline
+ 2015-01-19 Tim Shen <timshen@google.com>
+
+ * include/bits/regex.tcc (regex_traits<>::lookup_collatename,
+ regex_traits<>::lookup_classname): Support forward iterators.
+ * testsuite/28_regex/traits/char/lookup_classname.cc: New testcases.
+ * testsuite/28_regex/traits/char/lookup_collatename.cc: New testcase.
+
+2015-01-19 Tim Shen <timshen@google.com>
+
+ PR libstdc++/64584
+ PR libstdc++/64585
+ * include/bits/regex.h (basic_regex<>::basic_regex,
+ basic_regex<>::assign, basic_regex<>::imbue,
+ basic_regex<>::swap, basic_regex<>::mark_count): Drop NFA after
+ imbuing basic_regex; Make assign() transactional against exception.
+ * testsuite/28_regex/basic_regex/assign/char/string.cc: New testcase.
+ * testsuite/28_regex/basic_regex/imbue/string.cc: New testcase.
+
+2015-01-18 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/64646
+ * include/bits/stl_algo.h (__is_permutation): Also test for reaching
+ end of the second range.
+ * testsuite/25_algorithms/is_permutation/64646.cc: New.
+
2015-01-09 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/64476
*/
explicit
basic_regex(const _Ch_type* __p, flag_type __f = ECMAScript)
- : basic_regex(__p, __p + _Rx_traits::length(__p), __f)
+ : basic_regex(__p, __p + char_traits<_Ch_type>::length(__p), __f)
{ }
/**
*/
basic_regex(const basic_regex& __rhs)
: _M_flags(__rhs._M_flags), _M_original_str(__rhs._M_original_str)
- { this->imbue(__rhs.getloc()); }
+ {
+ _M_traits.imbue(__rhs.getloc());
+ this->assign(_M_original_str, _M_flags);
+ }
/**
* @brief Move-constructs a basic regular expression.
: _M_flags(__rhs._M_flags),
_M_original_str(std::move(__rhs._M_original_str))
{
- this->imbue(__rhs.getloc());
+ _M_traits.imbue(__rhs.getloc());
+ this->assign(_M_original_str, _M_flags);
__rhs._M_automaton.reset();
}
*/
basic_regex&
operator=(const _Ch_type* __p)
- { return this->assign(__p, flags()); }
+ { return this->assign(__p); }
+
+ /**
+ * @brief Replaces a regular expression with a new one constructed from
+ * an initializer list.
+ *
+ * @param __l The initializer list.
+ *
+ * @throws regex_error if @p __l is not a valid regular expression.
+ */
+ basic_regex&
+ operator=(initializer_list<_Ch_type> __l)
+ { return this->assign(__l.begin(), __l.end()); }
/**
* @brief Replaces a regular expression with a new one constructed from
template<typename _Ch_typeraits, typename _Alloc>
basic_regex&
operator=(const basic_string<_Ch_type, _Ch_typeraits, _Alloc>& __s)
- { return this->assign(__s, flags()); }
+ { return this->assign(__s); }
// [7.8.3] assign
/**
{
_M_flags = __rhs._M_flags;
_M_original_str = __rhs._M_original_str;
- this->imbue(__rhs.getloc());
+ _M_traits.imbue(__rhs.getloc());
+ this->assign(_M_original_str, _M_flags);
return *this;
}
_M_flags = __rhs._M_flags;
_M_original_str = std::move(__rhs._M_original_str);
__rhs._M_automaton.reset();
- this->imbue(__rhs.getloc());
+ _M_traits.imbue(__rhs.getloc());
+ this->assign(_M_original_str, _M_flags);
+ return *this;
}
/**
assign(const basic_string<_Ch_type, _Ch_typeraits, _Alloc>& __s,
flag_type __flags = ECMAScript)
{
+ _M_automaton = __detail::__compile_nfa(
+ __s.data(), __s.data() + __s.size(), _M_traits, __flags);
+ _M_original_str = __s;
_M_flags = __flags;
- _M_original_str.assign(__s.begin(), __s.end());
- auto __p = _M_original_str.c_str();
- _M_automaton = __detail::__compile_nfa(__p,
- __p + _M_original_str.size(),
- _M_traits, _M_flags);
return *this;
}
*/
unsigned int
mark_count() const
- { return _M_automaton->_M_sub_count() - 1; }
+ {
+ if (_M_automaton)
+ return _M_automaton->_M_sub_count() - 1;
+ return 0;
+ }
/**
* @brief Gets the flags used to construct the regular expression
locale_type
imbue(locale_type __loc)
{
- auto __ret = _M_traits.imbue(__loc);
- this->assign(_M_original_str, _M_flags);
- return __ret;
+ _M_automaton.reset();
+ return _M_traits.imbue(__loc);
}
/**
swap(basic_regex& __rhs)
{
std::swap(_M_flags, __rhs._M_flags);
- std::swap(_M_original_str, __rhs._M_original_str);
- this->imbue(__rhs.imbue(this->getloc()));
+ std::swap(_M_traits, __rhs._M_traits);
+ auto __tmp = std::move(_M_original_str);
+ this->assign(__rhs._M_original_str, _M_flags);
+ __rhs.assign(__tmp, __rhs._M_flags);
}
#ifdef _GLIBCXX_DEBUG
{ _M_automaton->_M_dot(__ostr); }
#endif
- protected:
+ private:
typedef std::shared_ptr<__detail::_NFA<_Rx_traits>> _AutomatonPtr;
template<typename _Bp, typename _Ap, typename _Cp, typename _Rp,
"right-curly-bracket",
"tilde",
"DEL",
- ""
};
- // same as boost
- //static const char* __digraphs[] =
- // {
- // "ae",
- // "Ae",
- // "AE",
- // "ch",
- // "Ch",
- // "CH",
- // "ll",
- // "Ll",
- // "LL",
- // "ss",
- // "Ss",
- // "SS",
- // "nj",
- // "Nj",
- // "NJ",
- // "dz",
- // "Dz",
- // "DZ",
- // "lj",
- // "Lj",
- // "LJ",
- // ""
- // };
-
- std::string __s(__last - __first, '?');
- __fctyp.narrow(__first, __last, '?', &*__s.begin());
-
- for (unsigned int __i = 0; *__collatenames[__i]; __i++)
- if (__s == __collatenames[__i])
- return string_type(1, __fctyp.widen(static_cast<char>(__i)));
-
- //for (unsigned int __i = 0; *__digraphs[__i]; __i++)
- // {
- // const char* __now = __digraphs[__i];
- // if (__s == __now)
- // {
- // string_type ret(__s.size(), __fctyp.widen('?'));
- // __fctyp.widen(__now, __now + 2/* ouch */, &*ret.begin());
- // return ret;
- // }
- // }
+ string __s;
+ for (; __first != __last; ++__first)
+ __s += __fctyp.narrow(*__first, 0);
+
+ for (const auto& __it : __collatenames)
+ if (__s == __it)
+ return string_type(1, __fctyp.widen(
+ static_cast<char>(&__it - __collatenames)));
+
+ // TODO Add digraph support:
+ // http://boost.sourceforge.net/libs/regex/doc/collating_names.html
+
return string_type();
}
lookup_classname(_Fwd_iter __first, _Fwd_iter __last, bool __icase) const
{
typedef std::ctype<char_type> __ctype_type;
- typedef std::ctype<char> __cctype_type;
- typedef const pair<const char*, char_class_type> _ClassnameEntry;
const __ctype_type& __fctyp(use_facet<__ctype_type>(_M_locale));
- const __cctype_type& __cctyp(use_facet<__cctype_type>(_M_locale));
- static _ClassnameEntry __classnames[] =
+ // Mappings from class name to class mask.
+ static const pair<const char*, char_class_type> __classnames[] =
{
{"d", ctype_base::digit},
{"w", {ctype_base::alnum, _RegexMask::_S_under}},
{"xdigit", ctype_base::xdigit},
};
- std::string __s(__last - __first, '?');
- __fctyp.narrow(__first, __last, '?', &__s[0]);
- __cctyp.tolower(&*__s.begin(), &*__s.begin() + __s.size());
- for (_ClassnameEntry* __it = __classnames;
- __it < *(&__classnames + 1);
- ++__it)
- {
- if (__s == __it->first)
- {
- if (__icase
- && ((__it->second
- & (ctype_base::lower | ctype_base::upper)) != 0))
- return ctype_base::alpha;
- return __it->second;
- }
- }
+ string __s;
+ for (; __first != __last; ++__first)
+ __s += __fctyp.narrow(__fctyp.tolower(*__first), 0);
+
+ for (const auto& __it : __classnames)
+ if (__s == __it.first)
+ {
+ if (__icase
+ && ((__it.second
+ & (ctype_base::lower | ctype_base::upper)) != 0))
+ return ctype_base::alpha;
+ return __it.second;
+ }
return 0;
}
// Efficiently compare identical prefixes: O(N) if sequences
// have the same elements in the same order.
- for (; __first1 != __last1; ++__first1, ++__first2)
+ for (; __first1 != __last1 && __first2 != __last2;
+ ++__first1, ++__first2)
if (!__pred(__first1, __first2))
break;
--- /dev/null
+// Copyright (C) 2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++14" }
+
+#include <algorithm>
+#include <forward_list>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ std::forward_list<int> l1{0}, l2;
+ VERIFY( !std::is_permutation(l1.begin(), l1.end(), l2.begin(), l2.end()) );
+}
+
+int
+main()
+{
+ test01();
+}
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
+// { dg-options "-std=c++11" }
// 2009-06-05 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
re.assign(cs);
}
+// basic_regex::operator=() resets flags. libstdc++/64680
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::regex re("[[:alnum:]]", std::regex_constants::basic);
+ re = "\\w+";
+}
+
int
main()
{
test01();
+ test02();
return 0;
}
-// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
// Tests C++ string assignment of the basic_regex class.
void test01()
{
+ bool test __attribute__((unused)) = true;
typedef std::basic_regex<char> test_type;
std::string s("a*b");
re.assign(s);
}
+// libstdc++/64584
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+ std::regex re("", std::regex_constants::extended);
+ auto flags = re.flags();
+ try
+ {
+ re.assign("(", std::regex_constants::icase);
+ VERIFY(false);
+ }
+ catch (const std::regex_error& e)
+ {
+ VERIFY(flags == re.flags());
+ }
+}
+
int
main()
{
test01();
+ test02();
return 0;
}
--- /dev/null
+// { dg-options "-std=gnu++11" }
+
+// Copyright (C) 2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// [28.8.5] class template basic_regex locale
+
+#include <string>
+#include <regex>
+#include <testsuite_hooks.h>
+
+// libstdc++/64585
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ static const char s[] = "a";
+ std::regex re("a");
+ VERIFY(std::regex_search(s, re));
+
+ auto loc = re.imbue(re.getloc());
+ VERIFY(!std::regex_search(s, re));
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
// 28.7(9) Class template regex_traits [re.traits]
#include <regex>
+#include <forward_list>
#include <testsuite_hooks.h>
void
VERIFY( c2 == c3 );
}
+// Test forward iterator
+void
+test02()
+{
+ const char strlit[] = "upper";
+ std::forward_list<char> s(strlit, strlit + strlen(strlit));
+ std::regex_traits<char> traits;
+ VERIFY(traits.isctype('C', traits.lookup_classname(s.begin(), s.end(), false)));
+}
+
+// icase
+void
+test03()
+{
+ std::string s("lower");
+ std::regex_traits<char> traits;
+ VERIFY(traits.isctype('C', traits.lookup_classname(s.begin(), s.end(), true)));
+}
+
int main()
{
test01();
+ test02();
+ test03();
return 0;
}
// 28.7 (8) Class template regex_traits [re.traits]
#include <regex>
+#include <forward_list>
#include <testsuite_hooks.h>
void
VERIFY(t.lookup_collatename(name, name+sizeof(name)-1) == "~");
}
+// Test forward iterator.
+void
+test02()
+{
+ const char strlit[] = "tilde";
+ std::forward_list<char> s(strlit, strlit + strlen(strlit));
+ std::regex_traits<char> traits;
+ VERIFY(traits.lookup_collatename(s.begin(), s.end()) == "~");
+}
+
int main()
{
test01();
+ test02();
return 0;
}
VERIFY(!regex_match(L"\u2029", re));
}
+struct MyCtype : std::ctype<wchar_t>
+{
+ char
+ do_narrow(wchar_t c, char dflt) const override
+ {
+ if (c >= 256)
+ return dflt;
+ return ((char)c)+1;
+ }
+};
+
+void
+test02()
+{
+ std::locale loc(std::locale(), new MyCtype);
+ std::regex_traits<wchar_t> traits;
+ traits.imbue(loc);
+ wchar_t wch = L'p';
+ VERIFY(traits.lookup_collatename(&wch, &wch+1) == L"q");
+ std::wstring ws = L"chfhs"; // chars of "digit" shifted by 1.
+ VERIFY(traits.lookup_classname(ws.begin(), ws.end()) != 0);
+}
+
int main()
{
test01();
+ test02();
return 0;
}