Richard Biener [Mon, 9 Dec 2013 15:13:07 +0000 (15:13 +0000)]
re PR middle-end/38474 (compile time explosion in dataflow_set_preserve_mem_locs at -O3)
2013-12-09 Richard Biener <rguenther@suse.de>
PR middle-end/38474
* tree-ssa-structalias.c (set_union_with_increment): Remove
unreachable code.
(do_complex_constraint): Call set_union_with_increment with
the solution delta, not the full solution.
(make_transitive_closure_constraints): Merge the two
constraints.
Marek Polacek [Mon, 9 Dec 2013 14:44:03 +0000 (14:44 +0000)]
re PR sanitizer/59415 (ICE segfault in verify_bb_vtables for g++ -S -fvtable-verify=std -fsanitize=null)
PR sanitizer/59415
* vtable-verify.c (verify_bb_vtables): Check the return value
of gimple_call_fn. Use is_gimple_call instead of gimple_code.
testsuite/
* g++.dg/ubsan/pr59415.C: New test.
Bruce Korb [Sun, 8 Dec 2013 21:55:46 +0000 (21:55 +0000)]
fenv.h on Ubuntu
plus fix the ordering of the patches:
* inclhack.def: many of the headers found under "bits/" are
often stashed under architecture directories. Apply fixes
to those, too. Also, re-ordered misordered fixes.
* tests/base/linux/vt.h: 80 columns in .def file limitation
* tests/base/iso/math_c99.h: adjust ordering
* tests/base/rtldef/string.h: likewise
* tests/base/bits/fenv.h: likewise
* tests/base/pthread.h: likewise
Tobias Burnus [Sun, 8 Dec 2013 21:34:18 +0000 (22:34 +0100)]
re PR fortran/58099 ([F03] over-zealous procedure-pointer error checking)
2013-12-08 Tobias Burnus <burnus@net-b.de>
Janus Weil <janus@gcc.gnu.org>
PR fortran/58099
PR fortran/58676
PR fortran/41724
* resolve.c (gfc_resolve_intrinsic): Set elemental/pure.
(resolve_fl_procedure): Reject pure dummy procedures/procedure
pointers.
(gfc_explicit_interface_required): Don't require a
match of ELEMENTAL for intrinsics.
2013-12-08 Tobias Burnus <burnus@net-b.de>
PR fortran/58099
PR fortran/58676
PR fortran/41724
* gfortran.dg/elemental_subroutine_8.f90: New.
* gfortran.dg/proc_decl_9.f90: Add ELEMENTAL to make valid.
* gfortran.dg/proc_ptr_11.f90: Ditto.
* gfortran.dg/proc_ptr_result_8.f90: Ditto.
* gfortran.dg/proc_ptr_32.f90: Update dg-error.
* gfortran.dg/proc_ptr_33.f90: Ditto.
* gfortran.dg/proc_ptr_result_1.f90: Add abstract interface
which is not elemental.
* gfortran.dg/proc_ptr_result_7.f90: Ditto.
Co-Authored-By: Janus Weil <janus@gcc.gnu.org>
From-SVN: r205791
Maxim Kuvyrkov [Sat, 7 Dec 2013 08:47:33 +0000 (08:47 +0000)]
Cleanup libc selection and Android support.
* config.gcc (*linux*): Split libc selection from Android support.
Add libc selection to all *linux* targets. Add Android support to
architectures that support it.
(arm*-*-linux-*, i[34567]86-*-linux*, x86_64-*-linux*,)
(mips*-*-linux*): Add Android support.
Maxim Kuvyrkov [Sat, 7 Dec 2013 08:46:47 +0000 (08:46 +0000)]
Rename files for libc selection on Linux targets.
* linux-android.c: Rename to linux.c.
* t-linux-android: Rename to t-linux. Update references
to linux-android.c
* config.gcc: Update references to t-linux-android and linux-android.o.
Caroline Tice [Fri, 6 Dec 2013 21:22:14 +0000 (13:22 -0800)]
Fix two small problems...
Fix two small problems: Make the libvtv function
decls globally visible, and update all uses of the
verified vtable poitner with the verification results,
rather than just hte first use.
Jakub Jelinek [Fri, 6 Dec 2013 20:38:15 +0000 (21:38 +0100)]
tree-data-ref.c (struct data_ref_loc_d): Replace pos field with ref.
* tree-data-ref.c (struct data_ref_loc_d): Replace pos field with ref.
(get_references_in_stmt): Don't record operand addresses, but
operands themselves.
(find_data_references_in_stmt, graphite_find_data_references_in_stmt):
Adjust for the pos -> ref change.
Jakub Jelinek [Fri, 6 Dec 2013 14:48:17 +0000 (15:48 +0100)]
elf.c (ET_DYN): Undefine and define again.
* elf.c (ET_DYN): Undefine and define again.
(elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
return early -1 without closing the descriptor.
(struct phdr_data): Add exe_descriptor.
(phdr_callback): If pd->exe_descriptor is not -1, for very first
call if dlpi_name is NULL just call elf_add with the exe_descriptor,
otherwise backtrace_close the exe_descriptor if not -1. Adjust
call to elf_add.
(backtrace_initialize): Adjust call to elf_add. If it returns
-1, set pd.exe_descriptor to descriptor, otherwise set it to -1.
H.J. Lu [Fri, 6 Dec 2013 11:48:24 +0000 (11:48 +0000)]
Use int64 on time and clock for x32
* sanitizer_common/sanitizer_platform_limits_posix.h
(__sanitizer_shmid_ds): Use u64 on time fields for x32.
(__sanitizer_clock_t): Use long long for x32.
H.J. Lu [Fri, 6 Dec 2013 11:44:55 +0000 (11:44 +0000)]
Include <sys/stat.h> if __x86_64__ is defined
* sanitizer_common/sanitizer_platform_limits_linux.cc: Include
<sys/stat.h>, instead of <asm/stat.h>, if __x86_64__ is defined.
(struct___old_kernel_stat_sz): Don't check if __x86_64__ is defined.
Eric Botcazou [Fri, 6 Dec 2013 11:31:56 +0000 (11:31 +0000)]
re PR target/59316 (gcc.dg/atomic/c11-atomic-exec-5.c FAILs on Solaris/SPARC)
PR target/59316
* config/sparc/sparc.h (SPARC_LOW_FE_EXCEPT_VALUES): Define.
* config/sparc/sol2.h (SPARC_LOW_FE_EXCEPT_VALUES): Redefine.
* config/sparc/sparc.c (TARGET_INIT_BUILTINS): Move around.
(TARGET_BUILTIN_DECL): Define.
(TARGET_ATOMIC_ASSIGN_EXPAND_FENV): Likewise.
(sparc32_initialize_trampoline): Adjust call to gen_flush.
(enum sparc_builtins): New enumeral type.
(sparc_builtins): New static array.
(sparc_builtins_icode): Likewise.
(def_builtin): Accept a separate icode and save the result.
(def_builtin_const): Likewise.
(sparc_fpu_init_builtins): New function.
(sparc_vis_init_builtins): Pass the builtin code.
(sparc_init_builtins): Call it if TARGET_FPU.
(sparc_builtin_decl): New function.
(sparc_expand_builtin): Deal with SPARC_BUILTIN_{LD,ST}FSR.
(sparc_handle_vis_mul8x16): Use the builtin code.
(sparc_fold_builtin): Likewise. Deal with SPARC_BUILTIN_{LD,ST}FSR
and SPARC_BUILTIN_PDISTN.
(compound_expr): New helper function.
(sparc_atomic_assign_expand_fenv): New function.
* config/sparc/sparc.md (unspecv): Reorder values, add UNSPECV_LDFSR
and UNSPECV_STFSR.
(flush, flushdi): Merge into single pattern.
(ldfsr): New instruction.
(stfsr): Likewise.
Richard Biener [Fri, 6 Dec 2013 09:23:07 +0000 (09:23 +0000)]
re PR tree-optimization/59058 (wrong code at -O3 on x86_64-linux-gnu (affecting gcc 4.6 to trunk))
2013-12-06 Richard Biener <rguenther@suse.de>
PR tree-optimization/59058
* tree-vectorizer.h (struct _loop_vec_info): Add num_itersm1
member.
(LOOP_VINFO_NITERSM1): New macro.
* tree-vect-loop-manip.c (slpeel_tree_peel_loop_to_edge): Express
the vector loop entry test in terms of scalar latch executions.
(vect_do_peeling_for_alignment): Update LOOP_VINFO_NITERSM1.
* tree-vect-loop.c (vect_get_loop_niters): Also return the
number of latch executions.
(new_loop_vec_info): Initialize LOOP_VINFO_NITERSM1.
(vect_analyze_loop_form): Likewise.
(vect_generate_tmps_on_preheader): Compute the number of
vectorized iterations differently.
alloc.c (backtrace_vector_finish): Add error_callback and data parameters.
* alloc.c (backtrace_vector_finish): Add error_callback and data
parameters. Call backtrace_vector_release. Return address base.
* mmap.c (backtrace_vector_finish): Add error_callback and data
parameters. Return address base.
* dwarf.c (read_function_info): Get new address base from
backtrace_vector_finish.
* internal.h (backtrace_vector_finish): Update declaration.
Marek Polacek [Thu, 5 Dec 2013 18:03:44 +0000 (18:03 +0000)]
re PR sanitizer/59333 (ICE with long long and -m32 -fsanitize=undefined)
PR sanitizer/59333
PR sanitizer/59397
* ubsan.c: Include rtl.h and expr.h.
(ubsan_encode_value): Add new parameter. If expanding, assign
a stack slot for DECL_RTL of the temporary and call expand_assignment.
Handle BOOLEAN_TYPE and ENUMERAL_TYPE.
(ubsan_build_overflow_builtin): Adjust ubsan_encode_value call.
* ubsan.h (ubsan_encode_value): Adjust declaration.
* internal-fn.c (ubsan_expand_si_overflow_addsub_check): Move
ubsan_build_overflow_builtin above expand_normal call. Surround this call
with push_temp_slots and pop_temp_slots.
(ubsan_expand_si_overflow_neg_check): Likewise.
(ubsan_expand_si_overflow_mul_check): Likewise.
testsuite/
* c-c++-common/ubsan/pr59333.c: New test.
* c-c++-common/ubsan/pr59397.c: New test.
Max Ostapenko [Thu, 5 Dec 2013 11:35:09 +0000 (13:35 +0200)]
atomic_stack.c: New test.
2013-12-05 Max Ostapenko <m.ostapenko@partner.samsung.com>
* c-c++-common/tsan/atomic_stack.c: New test.
* c-c++-common/tsan/fd_pipe_race.c: New test.
* c-c++-common/tsan/free_race.c: New test.
* c-c++-common/tsan/mutexset1.c: New test.
* c-c++-common/tsan/race_on_barrier.c: New test.
* c-c++-common/tsan/sleep_sync.c: New test.
* c-c++-common/tsan/thread_leak.c: New test.
* c-c++-common/tsan/thread_leak1.c: New test.
* c-c++-common/tsan/thread_leak2.c: New test.
* c-c++-common/tsan/tiny_race.c: New test.
* c-c++-common/tsan/tls_race.c: New test.
* c-c++-common/tsan/write_in_reader_lock.c: New test.
* lib/tsan-dg.exp: New file.
* gcc.dg/tsan/tsan.exp: New file.
* g++.dg/tsan/tsan.exp: New file.
* g++.dg/dg.exp: Prune tsan subdirectory.
Richard Biener [Thu, 5 Dec 2013 09:12:29 +0000 (09:12 +0000)]
re PR tree-optimization/59374 (-ftree-slp-vectorize breaks unique_ptr's move constructor)
2013-12-05 Richard Biener <rguenther@suse.de>
PR tree-optimization/59374
* tree-vect-data-refs.c (vect_slp_analyze_data_ref_dependence):
Commonize known and unknown dependence case fixing the allowed
read-write dependence case and dropping code that should not
matter.
* gcc.dg/torture/pr59374-1.c: New testcase.
* gcc.dg/torture/pr59374-2.c: Likewise.
Jeff Law [Thu, 5 Dec 2013 03:18:18 +0000 (20:18 -0700)]
common.opt: Split up -fisolate-erroneous-paths into -fisolate-erroneous-paths-dereference...
* common.opt: Split up -fisolate-erroneous-paths into
-fisolate-erroneous-paths-dereference and
-fisolate-erroneous-paths-attribute.
* invoke.texi: Corresponding changes.
* gimple.c (infer_nonnull_range): Add and use new arguments
to control what kind of statements can be used to infer a
non-null range.
* gimple.h (infer_nonnull_range): Update prototype.
* tree-vrp.c (infer_value_range): Corresponding changes.
* opts.c (default_options_table): Update due to option split.
* gimple-ssa-isolate-paths.c: Fix trailing whitespace.
(find_implicit_erroneous_behaviour): Pass additional arguments
to infer_nonnull_range.
(find_explicit_erroneous_behaviour): Similarly.
(gate_isolate_erroneous_paths): Check both of the new
options.
testsuite/
* gcc.dg/pr38984.c: Use -fno-isolate-erroneous-paths-dereference.
* gcc.dg/tree-ssa/isolate-2.c: Explicitly turn on
-fisolate-erroneous-paths-attribute.
* gcc.dg/tree-ssa/isolate-4.c: Likewise.
Joseph Myers [Wed, 4 Dec 2013 22:57:20 +0000 (22:57 +0000)]
re PR c/52023 ([C11] _Alignof (double) yields wrong value on x86)
PR c/52023
c-family:
* c-common.c (c_sizeof_or_alignof_type): Add parameter min_alignof
and check field alignment if set.
* c-common.h (c_sizeof_or_alignof_type): Update prototype.
(c_sizeof, c_alignof): Update calls to c_sizeof_or_alignof_type.
c:
* c-parser.c (c_parser_alignas_specifier): Use
c_sizeof_or_alignof_type instead of c_alignof.
(c_parser_alignof_expression): Likewise, with min_alignof
parameter depending on alignof spelling used.
cp:
* typeck.c (cxx_sizeof_or_alignof_type): Update call to
c_sizeof_or_alignof_type.
objc:
* objc-act.c (objc_synthesize_getter): Update calls to
c_sizeof_or_alignof_type.
* config/arm/bpapi-lib.h (TARGET_HAS_NO_HW_DIVIDE): Define for
architectures that do not have hardware divide instruction.
i.e. architectures that do not define __ARM_ARCH_EXT_IDIV__.
Eric Botcazou [Wed, 4 Dec 2013 11:11:56 +0000 (11:11 +0000)]
trans.c (Case_Statement_to_gnu): Do not push a binding level for each branch if...
* gcc-interface/trans.c (Case_Statement_to_gnu): Do not push a binding
level for each branch if this is a case expression in Ada 2012.
(gnat_to_gnu) <case N_Expression_With_Actions>: Adjust comment.