1. 11 Oct, 2013 1 commit
    • target.c: New file. · acf0174b
      libgomp/
      	* target.c: New file.
      	* Makefile.am (libgomp_la_SOURCES): Add target.c.
      	* Makefile.in: Regenerated.
      	* libgomp_g.h (GOMP_task): Add depend argument.
      	(GOMP_barrier_cancel, GOMP_loop_end_cancel,
      	GOMP_sections_end_cancel, GOMP_target, GOMP_target_data,
      	GOMP_target_end_data, GOMP_target_update, GOMP_teams,
      	GOMP_parallel_loop_static, GOMP_parallel_loop_dynamic,
      	GOMP_parallel_loop_guided, GOMP_parallel_loop_runtime,
      	GOMP_parallel, GOMP_cancel, GOMP_cancellation_point,
      	GOMP_taskgroup_start, GOMP_taskgroup_end,
      	GOMP_parallel_sections): New prototypes.
      	* fortran.c (omp_is_initial_device): Add ialias_redirect.
      	(omp_is_initial_device_): New function.
      	(ULP, STR1, STR2, ialias_redirect): Removed.
      	(omp_get_cancellation_, omp_get_proc_bind_, omp_set_default_device_,
      	omp_set_default_device_8_, omp_get_default_device_,
      	omp_get_num_devices_, omp_get_num_teams_, omp_get_team_num_): New
      	functions.
      	* libgomp.map (GOMP_barrier_cancel, GOMP_loop_end_cancel,
      	GOMP_sections_end_cancel, GOMP_target, GOMP_target_data,
      	GOMP_target_end_data, GOMP_target_update, GOMP_teams): Export
      	@@GOMP_4.0.
      	(omp_is_initial_device, omp_is_initial_device_, omp_get_cancellation,
      	omp_get_cancellation_, omp_get_proc_bind, omp_get_proc_bind_,
      	omp_set_default_device, omp_set_default_device_,
      	omp_set_default_device_8_, omp_get_default_device,
      	omp_get_default_device_, omp_get_num_devices, omp_get_num_devices_,
      	omp_get_num_teams, omp_get_num_teams_, omp_get_team_num,
      	omp_get_team_num_): Export @@OMP_4.0.
      	* team.c (struct gomp_thread_start_data): Add place field.
      	(gomp_thread_start): Clear thr->thread_pool and
      	thr->task before returning.  Use gomp_team_barrier_wait_final
      	instead of gomp_team_barrier_wait.  Initialize thr->place.
      	(gomp_new_team): Initialize work_shares_to_free, work_share_cancelled,
      	team_cancelled and task_queued_count fields.
      	(gomp_free_pool_helper): Clear thr->thread_pool and thr->task
      	before calling pthread_exit.
      	(gomp_free_thread): No longer static.  Use
      	gomp_managed_threads_lock instead of gomp_remaining_threads_lock.
      	(gomp_team_start): Add flags argument.  Set
      	thr->thread_pool->threads_busy to nthreads immediately after creating
      	new pool.  Use gomp_managed_threads_lock instead of
      	gomp_remaining_threads_lock.  Handle OpenMP 4.0 affinity.
      	(gomp_team_end): Use gomp_managed_threads_lock instead of
      	gomp_remaining_threads_lock.  Use gomp_team_barrier_wait_final instead
      	of gomp_team_barrier_wait.  If team->team_cancelled, call
      	gomp_fini_worshare on ws chain starting at team->work_shares_to_free
      	rather than thr->ts.work_share.
      	(initialize_team): Don't call gomp_sem_init here.
      	* sections.c (GOMP_parallel_sections_start): Adjust gomp_team_start
      	caller.
      	(GOMP_parallel_sections, GOMP_sections_end_cancel): New functions.
      	* env.c (gomp_global_icv): Add default_device_var, target_data and
      	bind_var initializers.
      	(gomp_cpu_affinity, gomp_cpu_affinity_len): Remove.
      	(gomp_bind_var_list, gomp_bind_var_list_len, gomp_places_list,
      	gomp_places_list_len): New variables.
      	(parse_bind_var, parse_one_place, parse_places_var): New functions.
      	(parse_affinity): Rewritten to construct OMP_PLACES list with unit
      	sized places.
      	(gomp_cancel_var): New global variable.
      	(parse_int): New function.
      	(handle_omp_display_env): New function.
      	(initialize_env): Use it.  Initialize default_device_var.
      	Parse OMP_CANCELLATION env var.  Use parse_bind_var to parse
      	OMP_PROC_BIND instead of parse_boolean.  Use parse_places_var for
      	OMP_PLACES parsing.  Don't call parse_affinity if OMP_PLACES has
      	been successfully parsed (and call gomp_init_affinity in that case).
      	(omp_get_cancellation, omp_get_proc_bind, omp_set_default_device,
      	omp_get_default_device, omp_get_num_devices, omp_get_num_teams,
      	omp_get_team_num, omp_is_initial_device): New functions.
      	* libgomp.h: Include stdlib.h.
      	(ialias_ulp, ialias_str1, ialias_str2, ialias_redirect, ialias_call):
      	Define.
      	(struct target_mem_desc): Forward declare.
      	(struct gomp_task_icv): Add default_device_var, target_data, bind_var
      	and thread_limit_var fields.
      	(gomp_get_num_devices): New prototype.
      	(gomp_cancel_var): New extern decl.
      	(struct gomp_team): Add work_shares_to_free, work_share_cancelled,
      	team_cancelled and task_queued_count fields.  Add comments about
      	task_{,queued_,running_}count.
      	(gomp_cancel_kind): New enum.
      	(gomp_work_share_end_cancel): New prototype.
      	(struct gomp_task): Add next_taskgroup, prev_taskgroup, taskgroup,
      	copy_ctors_done, dependers, depend_hash, depend_count, num_dependees
      	and depend fields.
      	(struct gomp_taskgroup): New type.
      	(struct gomp_task_depend_entry,
      	struct gomp_dependers_vec): New types.
      	(gomp_finish_task): Free depend_hash if non-NULL.
      	(struct gomp_team_state): Add place_partition_off
      	and place_partition_len fields.
      	(gomp_bind_var_list, gomp_bind_var_list_len, gomp_places_list,
      	gomp_places_list_len): New extern decls.
      	(struct gomp_thread): Add place field.
      	(gomp_cpu_affinity, gomp_cpu_affinity_len): Remove.
      	(gomp_init_thread_affinity): Add place argument.
      	(gomp_affinity_alloc, gomp_affinity_init_place, gomp_affinity_add_cpus,
      	gomp_affinity_remove_cpu, gomp_affinity_copy_place,
      	gomp_affinity_same_place, gomp_affinity_finalize_place_list,
      	gomp_affinity_init_level, gomp_affinity_print_place): New
      	prototypes.
      	(gomp_team_start): Add flags argument.
      	(gomp_thread_limit_var, gomp_remaining_threads_count,
      	gomp_remaining_threads_lock): Remove.
      	(gomp_managed_threads_lock): New variable.
      	(struct gomp_thread_pool): Add threads_busy field.
      	(gomp_free_thread): New prototype.
      	* task.c: Include hashtab.h.
      	(hash_entry_type): New typedef.
      	(htab_alloc, htab_free, htab_hash, htab_eq): New inlines.
      	(gomp_init_task): Clear dependers, depend_hash, depend_count,
      	copy_ctors_done and taskgroup fields.
      	(GOMP_task): Add depend argument, handle depend clauses.  If
      	gomp_team_barrier_cancelled or if it's taskgroup has been
      	cancelled, don't queue or start new tasks.  Set copy_ctors_done
      	field if needed.  Initialize taskgroup field.  If copy_ctors_done
      	and already cancelled, don't discard the task.  If taskgroup is
      	non-NULL, enqueue the task into taskgroup queue.  Increment
      	num_children field in taskgroup.  Increment task_queued_count.
      	(gomp_task_run_pre, gomp_task_run_post_remove_parent,
      	gomp_task_run_post_remove_taskgroup): New inline functions.
      	(gomp_task_run_post_handle_depend_hash,
      	gomp_task_run_post_handle_dependers,
      	gomp_task_run_post_handle_depend): New functions.
      	(GOMP_taskwait): Use them.  If more than one new tasks
      	have been queued, wake other threads if needed.
      	(gomp_barrier_handle_tasks): Likewise.  If
      	gomp_team_barrier_cancelled, don't start any new tasks, just free
      	all tasks.
      	(GOMP_taskgroup_start, GOMP_taskgroup_end): New functions.
      	* omp_lib.f90.in
      	(omp_proc_bind_kind, omp_proc_bind_false,
      	omp_proc_bind_true, omp_proc_bind_master, omp_proc_bind_close,
      	omp_proc_bind_spread): New params.
      	(omp_get_cancellation, omp_get_proc_bind, omp_set_default_device,
      	omp_get_default_device, omp_get_num_devices, omp_get_num_teams,
      	omp_get_team_num, omp_is_initial_device): New interfaces.
      	(omp_get_dynamic, omp_get_nested, omp_in_parallel,
      	omp_get_max_threads, omp_get_num_procs, omp_get_num_threads,
      	omp_get_thread_num, omp_get_thread_limit, omp_set_max_active_levels,
      	omp_get_max_active_levels, omp_get_level, omp_get_ancestor_thread_num,
      	omp_get_team_size, omp_get_active_level, omp_in_final): Remove
      	useless use omp_lib_kinds.
      	* omp.h.in (omp_proc_bind_t): New typedef.
      	(omp_get_cancellation, omp_get_proc_bind, omp_set_default_device,
      	omp_get_default_device, omp_get_num_devices, omp_get_num_teams,
      	omp_get_team_num, omp_is_initial_device): New prototypes.
      	* loop.c (gomp_parallel_loop_start): Add flags argument, pass it
      	through to gomp_team_start.
      	(GOMP_parallel_loop_static_start, GOMP_parallel_loop_dynamic_start,
      	GOMP_parallel_loop_guided_start, GOMP_parallel_loop_runtime_start):
      	Adjust gomp_parallel_loop_start callers.
      	(GOMP_parallel_loop_static, GOMP_parallel_loop_dynamic,
      	GOMP_parallel_loop_guided, GOMP_parallel_loop_runtime,
      	GOMP_loop_end_cancel): New functions.
      	(GOMP_parallel_end): Add ialias_redirect.
      	* hashtab.h: New file.
      	* libgomp.texi (Environment Variables): Minor cleanup,
      	update section refs to OpenMP 4.0rc2.
      	(OMP_DISPLAY_ENV, GOMP_SPINCOUNT): Document these
      	environment variables.
      	* work.c (gomp_work_share_end, gomp_work_share_end_nowait): Set
      	team->work_shares_to_free to thr->ts.work_share before calling
      	free_work_share.
      	(gomp_work_share_end_cancel): New function.
      	* config/linux/proc.c: Include errno.h.
      	(gomp_get_cpuset_size, gomp_cpuset_size, gomp_cpusetp): New variables.
      	(gomp_cpuset_popcount): Add cpusetsize argument, use it instead of
      	sizeof (cpu_set_t) to determine number of iterations.  Fix up check
      	extern decl.  Use CPU_COUNT_S if available, or CPU_COUNT if
      	gomp_cpuset_size is sizeof (cpu_set_t).
      	(gomp_init_num_threads): Initialize gomp_cpuset_size,
      	gomp_get_cpuset_size and gomp_cpusetp here, use gomp_cpusetp instead
      	of &cpuset and pass gomp_cpuset_size instead of sizeof (cpu_set_t)
      	to pthread_getaffinity_np.  Free and clear gomp_cpusetp if it didn't
      	contain any logical CPUs.
      	(get_num_procs): Don't call pthread_getaffinity_np if gomp_cpusetp
      	is NULL.  Use gomp_cpusetp instead of &cpuset and pass
      	gomp_get_cpuset_size instead of sizeof (cpu_set_t) to
      	pthread_getaffinity_np.  Check gomp_places_list instead of
      	gomp_cpu_affinity.  Adjust gomp_cpuset_popcount caller.
      	* config/linux/bar.c (gomp_barrier_wait_end,
      	gomp_barrier_wait_last): Use BAR_* defines.
      	(gomp_team_barrier_wait_end): Likewise.  Clear BAR_CANCELLED
      	from state where needed.  Set work_share_cancelled to 0 on last
      	thread.
      	(gomp_team_barrier_wait_final, gomp_team_barrier_wait_cancel_end,
      	gomp_team_barrier_wait_cancel, gomp_team_barrier_cancel): New
      	functions.
      	* config/linux/proc.h (gomp_cpuset_popcount): Add attribute_hidden.
      	Add cpusetsize argument.
      	(gomp_cpuset_size, gomp_cpusetp): Declare.
      	* config/linux/affinity.c: Include errno.h, stdio.h and string.h.
      	(affinity_counter): Remove.
      	(CPU_ISSET_S, CPU_ZERO_S, CPU_SET_S, CPU_CLR_S): Define
      	if CPU_ALLOC_SIZE isn't defined.
      	(gomp_init_affinity): Rewritten, if gomp_places_list is NULL, try
      	silently create OMP_PLACES=threads, if it is non-NULL afterwards,
      	bind current thread to the first place.
      	(gomp_init_thread_affinity): Rewritten.  Add place argument, just
      	pthread_setaffinity_np to gomp_places_list[place].
      	(gomp_affinity_alloc, gomp_affinity_init_place, gomp_affinity_add_cpus,
      	gomp_affinity_remove_cpu, gomp_affinity_copy_place,
      	gomp_affinity_same_place, gomp_affinity_finalize_place_list,
      	gomp_affinity_init_level, gomp_affinity_print_place): New functions.
      	* config/linux/bar.h (BAR_TASK_PENDING, BAR_WAS_LAST,
      	BAR_WAITING_FOR_TASK, BAR_INCR, BAR_CANCELLED): Define.
      	(gomp_barrier_t): Add awaited_final field.
      	(gomp_barrier_init): Initialize awaited_final field.
      	(gomp_team_barrier_wait_final, gomp_team_barrier_wait_cancel,
      	gomp_team_barrier_wait_cancel_end, gomp_team_barrier_cancel): New
      	prototypes.
      	(gomp_barrier_wait_start): Preserve BAR_CANCELLED bit.  Use BAR_*
      	defines.
      	(gomp_barrier_wait_cancel_start, gomp_team_barrier_wait_final_start,
      	gomp_team_barrier_cancelled): New inline functions.
      	(gomp_barrier_last_thread,
      	gomp_team_barrier_set_task_pending,
      	gomp_team_barrier_clear_task_pending,
      	gomp_team_barrier_set_waiting_for_tasks,
      	gomp_team_barrier_waiting_for_tasks,
      	gomp_team_barrier_done): Use BAR_* defines.
      	* config/posix/bar.c (gomp_barrier_init): Clear cancellable field.
      	(gomp_barrier_wait_end): Use BAR_* defines.
      	(gomp_team_barrier_wait_end): Clear BAR_CANCELLED from state.
      	Set work_share_cancelled to 0 on last thread, use __atomic_load_n.
      	Use BAR_* defines.
      	(gomp_team_barrier_wait_cancel_end, gomp_team_barrier_wait_cancel,
      	gomp_team_barrier_cancel): New functions.
      	* config/posix/affinity.c (gomp_init_thread_affinity): Add place
      	argument.
      	(gomp_affinity_alloc, gomp_affinity_init_place, gomp_affinity_add_cpus,
      	gomp_affinity_remove_cpu, gomp_affinity_copy_place,
      	gomp_affinity_same_place, gomp_affinity_finalize_place_list,
      	gomp_affinity_init_level, gomp_affinity_print_place): New stubs.
      	* config/posix/bar.h (BAR_TASK_PENDING, BAR_WAS_LAST,
      	BAR_WAITING_FOR_TASK, BAR_INCR, BAR_CANCELLED): Define.
      	(gomp_barrier_t): Add cancellable field.
      	(gomp_team_barrier_wait_cancel, gomp_team_barrier_wait_cancel_end,
      	gomp_team_barrier_cancel): New prototypes.
      	(gomp_barrier_wait_start): Preserve BAR_CANCELLED bit.
      	(gomp_barrier_wait_cancel_start, gomp_team_barrier_wait_final,
      	gomp_team_barrier_cancelled): New inline functions.
      	(gomp_barrier_wait_start, gomp_barrier_last_thread,
      	gomp_team_barrier_set_task_pending,
      	gomp_team_barrier_clear_task_pending,
      	gomp_team_barrier_set_waiting_for_tasks,
      	gomp_team_barrier_waiting_for_tasks,
      	gomp_team_barrier_done): Use BAR_* defines.
      	* barrier.c (GOMP_barrier_cancel): New function.
      	* omp_lib.h.in (omp_proc_bind_kind, omp_proc_bind_false,
      	omp_proc_bind_true, omp_proc_bind_master, omp_proc_bind_close,
      	omp_proc_bind_spread): New params.
      	(omp_get_cancellation, omp_get_proc_bind, omp_set_default_device,
      	omp_get_default_device, omp_get_num_devices, omp_get_num_teams,
      	omp_get_team_num, omp_is_initial_device): New externals.
      	* parallel.c (GOMP_parallel, GOMP_cancel, GOMP_cancellation_point):
      	New functions.
      	(gomp_resolve_num_threads): Adjust for thread_limit now being in
      	icv->thread_limit_var.  Use UINT_MAX instead of ULONG_MAX as
      	infinity.  If not nested, just return minimum of max_num_threads
      	and icv->thread_limit_var and if thr->thread_pool, set threads_busy
      	to the returned value.  Otherwise, don't update atomically
      	gomp_remaining_threads_count, but instead thr->thread_pool->threads_busy.
      	(GOMP_parallel_end): Adjust for thread_limit now being in
      	icv->thread_limit_var.  Use UINT_MAX instead of ULONG_MAX as
      	infinity.  Adjust threads_busy in the pool rather than
      	gomp_remaining_threads_count.  Remember team->nthreads and call
      	gomp_team_end before adjusting threads_busy, if not nested
      	afterwards, just set it to 1 non-atomically.  Add ialias.
      	(GOMP_parallel_start): Adjust gomp_team_start caller.
      	* testsuite/libgomp.c/atomic-14.c: Add parens to make it valid.
      	* testsuite/libgomp.c/affinity-1.c: New test.
      	* testsuite/libgomp.c/atomic-15.c: New test.
      	* testsuite/libgomp.c/atomic-16.c: New test.
      	* testsuite/libgomp.c/atomic-17.c: New test.
      	* testsuite/libgomp.c/cancel-for-1.c: New test.
      	* testsuite/libgomp.c/cancel-for-2.c: New test.
      	* testsuite/libgomp.c/cancel-parallel-1.c: New test.
      	* testsuite/libgomp.c/cancel-parallel-2.c: New test.
      	* testsuite/libgomp.c/cancel-parallel-3.c: New test.
      	* testsuite/libgomp.c/cancel-sections-1.c: New test.
      	* testsuite/libgomp.c/cancel-taskgroup-1.c: New test.
      	* testsuite/libgomp.c/cancel-taskgroup-2.c: New test.
      	* testsuite/libgomp.c/depend-1.c: New test.
      	* testsuite/libgomp.c/depend-2.c: New test.
      	* testsuite/libgomp.c/depend-3.c: New test.
      	* testsuite/libgomp.c/depend-4.c: New test.
      	* testsuite/libgomp.c/for-1.c: New test.
      	* testsuite/libgomp.c/for-1.h: New file.
      	* testsuite/libgomp.c/for-2.c: New test.
      	* testsuite/libgomp.c/for-2.h: New file.
      	* testsuite/libgomp.c/for-3.c: New test.
      	* testsuite/libgomp.c/pr58392.c: New test.
      	* testsuite/libgomp.c/simd-1.c: New test.
      	* testsuite/libgomp.c/simd-2.c: New test.
      	* testsuite/libgomp.c/simd-3.c: New test.
      	* testsuite/libgomp.c/simd-4.c: New test.
      	* testsuite/libgomp.c/simd-5.c: New test.
      	* testsuite/libgomp.c/simd-6.c: New test.
      	* testsuite/libgomp.c/target-1.c: New test.
      	* testsuite/libgomp.c/target-2.c: New test.
      	* testsuite/libgomp.c/target-3.c: New test.
      	* testsuite/libgomp.c/target-4.c: New test.
      	* testsuite/libgomp.c/target-5.c: New test.
      	* testsuite/libgomp.c/target-6.c: New test.
      	* testsuite/libgomp.c/target-7.c: New test.
      	* testsuite/libgomp.c/taskgroup-1.c: New test.
      	* testsuite/libgomp.c/thread-limit-1.c: New test.
      	* testsuite/libgomp.c/thread-limit-2.c: New test.
      	* testsuite/libgomp.c/thread-limit-3.c: New test.
      	* testsuite/libgomp.c/udr-1.c: New test.
      	* testsuite/libgomp.c/udr-2.c: New test.
      	* testsuite/libgomp.c/udr-3.c: New test.
      	* testsuite/libgomp.c++/affinity-1.C: New test.
      	* testsuite/libgomp.c++/atomic-10.C: New test.
      	* testsuite/libgomp.c++/atomic-11.C: New test.
      	* testsuite/libgomp.c++/atomic-12.C: New test.
      	* testsuite/libgomp.c++/atomic-13.C: New test.
      	* testsuite/libgomp.c++/atomic-14.C: New test.
      	* testsuite/libgomp.c++/atomic-15.C: New test.
      	* testsuite/libgomp.c++/cancel-for-1.C: New test.
      	* testsuite/libgomp.c++/cancel-for-2.C: New test.
      	* testsuite/libgomp.c++/cancel-parallel-1.C: New test.
      	* testsuite/libgomp.c++/cancel-parallel-2.C: New test.
      	* testsuite/libgomp.c++/cancel-parallel-3.C: New test.
      	* testsuite/libgomp.c++/cancel-sections-1.C: New test.
      	* testsuite/libgomp.c++/cancel-taskgroup-1.C: New test.
      	* testsuite/libgomp.c++/cancel-taskgroup-2.C: New test.
      	* testsuite/libgomp.c++/cancel-taskgroup-3.C: New test.
      	* testsuite/libgomp.c++/cancel-test.h: New file.
      	* testsuite/libgomp.c++/for-9.C: New test.
      	* testsuite/libgomp.c++/for-10.C: New test.
      	* testsuite/libgomp.c++/for-11.C: New test.
      	* testsuite/libgomp.c++/simd-1.C: New test.
      	* testsuite/libgomp.c++/simd-2.C: New test.
      	* testsuite/libgomp.c++/simd-3.C: New test.
      	* testsuite/libgomp.c++/simd-4.C: New test.
      	* testsuite/libgomp.c++/simd-5.C: New test.
      	* testsuite/libgomp.c++/simd-6.C: New test.
      	* testsuite/libgomp.c++/simd-7.C: New test.
      	* testsuite/libgomp.c++/simd-8.C: New test.
      	* testsuite/libgomp.c++/target-1.C: New test.
      	* testsuite/libgomp.c++/target-2.C: New test.
      	* testsuite/libgomp.c++/target-2-aux.cc: New file.
      	* testsuite/libgomp.c++/target-3.C: New test.
      	* testsuite/libgomp.c++/taskgroup-1.C: New test.
      	* testsuite/libgomp.c++/udr-1.C: New test.
      	* testsuite/libgomp.c++/udr-2.C: New test.
      	* testsuite/libgomp.c++/udr-3.C: New test.
      	* testsuite/libgomp.c++/udr-4.C: New test.
      	* testsuite/libgomp.c++/udr-5.C: New test.
      	* testsuite/libgomp.c++/udr-6.C: New test.
      	* testsuite/libgomp.c++/udr-7.C: New test.
      	* testsuite/libgomp.c++/udr-8.C: New test.
      	* testsuite/libgomp.c++/udr-9.C: New test.
      gcc/
      	* tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE__LOOPTEMP_
      	and new OpenMP 4.0 clauses, handle UDR OMP_CLAUSE_REDUCTION,
      	formatting fixes, use pp_colon instead of pp_character (..., ':'),
      	similarly pp_right_paren.
      	(dump_generic_node): Handle OMP_DISTRIBUTE, OMP_TEAMS,
      	OMP_TARGET_DATA, OMP_TARGET, OMP_TARGET_UPDATE, OMP_TASKGROUP,
      	allow OMP_FOR_INIT to be NULL, handle OMP_ATOMIC_SEQ_CST.
      	* tree.c (omp_clause_num_ops, omp_clause_code_name): Add OpenMP 4.0
      	clauses.
      	(omp_declare_simd_clauses_equal,
      	omp_remove_redundant_declare_simd_attrs): New functions.
      	(attribute_value_equal): Use omp_declare_simd_clauses_equal.
      	(walk_tree_1): Handle new OpenMP 4.0 clauses.
      	* tree.h (OMP_LOOP_CHECK): Define.
      	(OMP_FOR_BODY, OMP_FOR_CLAUSES, OMP_FOR_INIT, OMP_FOR_COND,
      	OMP_FOR_INCR, OMP_FOR_PRE_BODY): Use it.
      	(OMP_TASKGROUP_BODY, OMP_TEAMS_BODY, OMP_TEAMS_CLAUSES,
      	OMP_TARGET_DATA_BODY, OMP_TARGET_DATA_CLAUSES, OMP_TARGET_BODY,
      	OMP_TARGET_CLAUSES, OMP_TARGET_UPDATE_CLAUSES, OMP_CLAUSE_SIZE,
      	OMP_ATOMIC_SEQ_CST, OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_MAP_KIND,
      	OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION, OMP_CLAUSE_PROC_BIND_KIND,
      	OMP_CLAUSE_REDUCTION_OMP_ORIG_REF, OMP_CLAUSE_ALIGNED_ALIGNMENT,
      	OMP_CLAUSE_NUM_TEAMS_EXPR, OMP_CLAUSE_THREAD_LIMIT_EXPR,
      	OMP_CLAUSE_DEVICE_ID, OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR,
      	OMP_CLAUSE_SIMDLEN_EXPR): Define.
      	(OMP_CLAUSE_DECL): Change range up to OMP_CLAUSE__LOOPTEMP_.
      	(omp_remove_redundant_declare_simd_attrs): New prototype.
      	* gimple.def (GIMPLE_OMP_TASKGROUP, GIMPLE_OMP_TARGET,
      	GIMPLE_OMP_TEAMS): New codes.
      	(GIMPLE_OMP_RETURN): Use GSS_OMP_ATOMIC_STORE instead of GSS_BASE.
      	* omp-low.c (struct omp_context): Add cancel_label and cancellable
      	fields.
      	(target_nesting_level): New variable.
      	(extract_omp_for_data): Handle GF_OMP_FOR_KIND_DISTRIBUTE and
      	OMP_CLAUSE_DIST_SCHEDULE.  Don't fallback to library implementation
      	for collapse > 1 static schedule unless ordered.
      	(get_ws_args_for): Add par_stmt argument.  Handle combined loops.
      	(determine_parallel_type): Adjust get_ws_args_for caller.
      	(install_var_field): Handle mask & 4 for double indirection.
      	(scan_sharing_clauses): Ignore shared clause on teams construct.
      	Handle OMP_CLAUSE__LOOPTEMP_ and new OpenMP 4.0 clauses.
      	(create_omp_child_function): If inside target or declare target
      	constructs, set "omp declare target" attribute on the child
      	function.
      	(find_combined_for): New function.
      	(scan_omp_parallel): Handle combined loops.
      	(scan_omp_target, scan_omp_teams): New functions.
      	(check_omp_nesting_restrictions): Check new OpenMP 4.0 nesting
      	restrictions and set ctx->cancellable for cancellable constructs.
      	(scan_omp_1_stmt): Call check_omp_nesting_restrictions also on
      	selected builtin calls.  Handle GIMPLE_OMP_TASKGROUP,
      	GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS.
      	(build_omp_barrier): Add lhs argument, return gimple rather than
      	tree.
      	(omp_clause_aligned_alignment): New function.
      	(lower_rec_simd_input_clauses): Only call SET_DECL_VALUE_EXPR
      	on decls.
      	(lower_rec_input_clauses): Add FD argument.  Ignore shared clauses
      	on teams constructs.  Handle user defined reductions and new
      	OpenMP 4.0 clauses.
      	(lower_reduction_clauses): Don't set placeholder to address of ref
      	if it has already the right type.
      	(lower_send_clauses): Handle OMP_CLAUSE__LOOPTEMP_.
      	(expand_parallel_call): Use the new non-_start suffixed builtins,
      	handle OMP_CLAUSE_PROC_BIND, don't call the outlined function
      	and GOMP_parallel_end after the call.
      	(expand_task_call): Handle OMP_CLAUSE_DEPEND.
      	(expand_omp_for_init_counts): Handle combined loops.
      	(expand_omp_for_init_vars): Add inner_stmt argument, handle combined
      	loops.
      	(expand_omp_for_generic): Likewise.  Use GOMP_loop_end_cancel at the
      	end of cancellable loops.
      	(expand_omp_for_static_nochunk, expand_omp_for_static_chunk):
      	Likewise.  Handle collapse > 1 loops.
      	(expand_omp_simd): Handle combined loops.
      	(expand_omp_for): Add inner_stmt argument, adjust callers of
      	expand_omp_for* functions, use expand_omp_for_static*chunk even
      	for collapse > 1 unless ordered.
      	(expand_omp_sections): Use GOMP_sections_end_cancel at the end
      	of cancellable sections.
      	(expand_omp_single): Remove need_barrier variable, just rely on
      	gimple_omp_return_nowait_p.  Adjust build_omp_barrier caller.
      	(expand_omp_synch): Allow GIMPLE_OMP_TASKGROUP and GIMPLE_OMP_TEAMS.
      	(expand_omp_atomic_load, expand_omp_atomic_store,
      	expand_omp_atomic_fetch_op): Handle gimple_omp_atomic_seq_cst_p.
      	(expand_omp_target): New function.
      	(expand_omp): Handle combined loops.  Handle GIMPLE_OMP_TASKGROUP,
      	GIMPLE_OMP_TEAMS, GIMPLE_OMP_TARGET.
      	(build_omp_regions_1): Immediately close region for
      	GF_OMP_TARGET_KIND_UPDATE.
      	(maybe_add_implicit_barrier_cancel): New function.
      	(lower_omp_sections): Adjust lower_rec_input_clauses caller.  Handle
      	cancellation.
      	(lower_omp_single): Likewise.  Add clobber after the barrier.
      	(lower_omp_taskgroup): New function.
      	(lower_omp_for): Handle combined loops.  Adjust
      	lower_rec_input_clauses caller.  Handle cancellation.
      	(lower_depend_clauses): New function.
      	(lower_omp_taskreg): Lower depend clauses.  Adjust
      	lower_rec_input_clauses caller.  Add clobber after the call.  Handle
      	cancellation.
      	(lower_omp_target, lower_omp_teams): New functions.
      	(lower_omp_1): Handle cancellation.  Handle GIMPLE_OMP_TASKGROUP,
      	GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS and GOMP_barrier, GOMP_cancel
      	and GOMP_cancellation_point calls.
      	(lower_omp): Fold stmts inside of target region.
      	(diagnose_sb_1, diagnose_sb_2): Handle GIMPLE_OMP_TASKGROUP,
      	GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
      	* builtin-types.def (DEF_FUNCTION_TYPE_8): Document.
      	(BT_FN_VOID_OMPFN_PTR_UINT,
      	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG,
      	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG,
      	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT): Remove.
      	(BT_FN_VOID_OMPFN_PTR_UINT_UINT_UINT,
      	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_UINT,
      	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT,
      	BT_FN_BOOL_INT, BT_FN_BOOL_INT_BOOL, BT_FN_VOID_UINT_UINT,
      	BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR,
      	BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR,
      	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR): New.
      	* tree-ssa-alias.c (ref_maybe_used_by_call_p_1,
      	call_may_clobber_ref_p_1): Handle BUILT_IN_GOMP_BARRIER_CANCEL,
      	BUILT_IN_GOMP_TASKGROUP_END, BUILT_IN_GOMP_LOOP_END_CANCEL,
      	BUILT_IN_GOMP_SECTIONS_END_CANCEL.  Don't handle
      	BUILT_IN_GOMP_PARALLEL_END.
      	* gimple-low.c (lower_stmt): Handle GIMPLE_OMP_TASKGROUP,
      	GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
      	* gimple-pretty-print.c (dump_gimple_omp_for): Handle
      	GF_OMP_FOR_KIND_DISTRIBUTE.
      	(dump_gimple_omp_target, dump_gimple_omp_teams): New functions.
      	(dump_gimple_omp_block): Handle GIMPLE_OMP_TASKGROUP.
      	(dump_gimple_omp_return): Print lhs if it has any.
      	(dump_gimple_omp_atomic_load, dump_gimple_omp_atomic_store): Handle
      	gimple_omp_atomic_seq_cst_p.
      	(pp_gimple_stmt_1): Handle GIMPLE_OMP_TASKGROUP, GIMPLE_OMP_TARGET
      	and GIMPLE_OMP_TEAMS.
      	* langhooks.c (lhd_omp_mappable_type): New function.
      	* tree-vectorizer.c (struct simd_array_to_simduid): Fix up comment.
      	* langhooks.h (struct lang_hooks_for_types): Add omp_mappable_type
      	hook.
      	* gimplify.c (enum gimplify_omp_var_data): Add GOVD_MAP,
      	GOVD_ALIGNED and GOVD_MAP_TO_ONLY.
      	(enum omp_region_type): Add ORT_TEAMS, ORT_TARGET_DATA and
      	ORT_TARGET.
      	(struct gimplify_omp_ctx): Add combined_loop field.
      	(gimplify_call_expr, gimplify_modify_expr): Don't call fold_stmt
      	on stmts inside of target region.
      	(is_gimple_stmt): Return true for OMP_DISTRIBUTE and OMP_TASKGROUP.
      	(omp_firstprivatize_variable): Handle GOVD_MAP, GOVD_ALIGNED,
      	ORT_TARGET and ORT_TARGET_DATA.
      	(omp_add_variable): Avoid checks on readding var for GOVD_ALIGNED.
      	Handle GOVD_MAP.
      	(omp_notice_threadprivate_variable): Complain about threadprivate
      	variables in target region.
      	(omp_notice_variable): Complain about vars with non-mappable type
      	in target region.  Handle ORT_TEAMS, ORT_TARGET and ORT_TARGET_DATA.
      	(omp_check_private): Ignore ORT_TARGET* regions.
      	(gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1,
      	gimplify_adjust_omp_clauses): Handle new OpenMP 4.0 clauses.
      	(find_combined_omp_for): New function.
      	(gimplify_omp_for): Handle gimplification of combined loops.
      	(gimplify_omp_workshare): Gimplify also OMP_TARGET, OMP_TARGET_DATA,
      	OMP_TEAMS.
      	(gimplify_omp_target_update): New function.
      	(gimplify_omp_atomic): Handle OMP_ATOMIC_SEQ_CST.
      	(gimplify_expr): Handle OMP_DISTRIBUTE, OMP_TARGET, OMP_TARGET_DATA,
      	OMP_TARGET_UPDATE, OMP_TEAMS, OMP_TASKGROUP.
      	(gimplify_body): If fndecl has "omp declare target" attribute, add
      	implicit ORT_TARGET context around it.
      	* tree.def (OMP_DISTRIBUTE, OMP_TEAMS, OMP_TARGET_DATA, OMP_TARGET,
      	OMP_TASKGROUP, OMP_TARGET_UPDATE): New tree codes.
      	* tree-nested.c (convert_nonlocal_reference_stmt,
      	convert_local_reference_stmt, convert_gimple_call): Handle
      	GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS and GIMPLE_OMP_TASKGROUP.
      	* omp-builtins.def (BUILT_IN_GOMP_TASK): Use
      	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR
      	instead of BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT.
      	(BUILT_IN_GOMP_TARGET, BUILT_IN_GOMP_TARGET_DATA,
      	BUILT_IN_GOMP_TARGET_END_DATA, BUILT_IN_GOMP_TARGET_UPDATE,
      	BUILT_IN_GOMP_TEAMS, BUILT_IN_BARRIER_CANCEL,
      	BUILT_IN_GOMP_LOOP_END_CANCEL,
      	BUILT_IN_GOMP_SECTIONS_END_CANCEL, BUILT_IN_OMP_GET_TEAM_NUM,
      	BUILT_IN_OMP_GET_NUM_TEAMS, BUILT_IN_GOMP_TASKGROUP_START,
      	BUILT_IN_GOMP_TASKGROUP_END, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC,
      	BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC,
      	BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED,
      	BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME, BUILT_IN_GOMP_PARALLEL,
      	BUILT_IN_GOMP_PARALLEL_SECTIONS, BUILT_IN_GOMP_CANCEL,
      	BUILT_IN_GOMP_CANCELLATION_POINT): New built-ins.
      	(BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START,
      	BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START,
      	BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START,
      	BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START,
      	BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END,
      	BUILT_IN_GOMP_PARALLEL_SECTIONS_START): Remove.
      	* tree-inline.c (remap_gimple_stmt, estimate_num_insns):
      	Handle GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS and GIMPLE_OMP_TASKGROUP.
      	* gimple.c (gimple_build_omp_taskgroup, gimple_build_omp_target,
      	gimple_build_omp_teams): New functions.
      	(walk_gimple_op): Handle GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS and
      	GIMPLE_OMP_TASKGROUP.  Walk optional lhs on GIMPLE_OMP_RETURN.
      	(walk_gimple_stmt, gimple_copy): Handle GIMPLE_OMP_TARGET,
      	GIMPLE_OMP_TEAMS and GIMPLE_OMP_TASKGROUP.
      	* gimple.h (enum gf_mask): GF_OMP_FOR_KIND_DISTRIBUTE,
      	GF_OMP_FOR_COMBINED, GF_OMP_FOR_COMBINED_INTO,
      	GF_OMP_TARGET_KIND_MASK, GF_OMP_TARGET_KIND_REGION,
      	GF_OMP_TARGET_KIND_DATA, GF_OMP_TARGET_KIND_UPDATE,
      	GF_OMP_ATOMIC_SEQ_CST): New.
      	(gimple_build_omp_taskgroup, gimple_build_omp_target,
      	gimple_build_omp_teams): New prototypes.
      	(gimple_has_substatements): Handle GIMPLE_OMP_TARGET,
      	GIMPLE_OMP_TEAMS and GIMPLE_OMP_TASKGROUP.
      	(gimple_omp_subcode): Use GIMPLE_OMP_TEAMS instead of
      	GIMPLE_OMP_SINGLE as end of range.
      	(gimple_omp_return_set_lhs, gimple_omp_return_lhs,
      	gimple_omp_return_lhs_ptr, gimple_omp_atomic_seq_cst_p,
      	gimple_omp_atomic_set_seq_cst, gimple_omp_for_combined_p,
      	gimple_omp_for_set_combined_p, gimple_omp_for_combined_into_p,
      	gimple_omp_for_set_combined_into_p, gimple_omp_target_clauses,
      	gimple_omp_target_clauses_ptr, gimple_omp_target_set_clauses,
      	gimple_omp_target_kind, gimple_omp_target_set_kind,
      	gimple_omp_target_child_fn, gimple_omp_target_child_fn_ptr,
      	gimple_omp_target_set_child_fn, gimple_omp_target_data_arg,
      	gimple_omp_target_data_arg_ptr, gimple_omp_target_set_data_arg,
      	gimple_omp_teams_clauses, gimple_omp_teams_clauses_ptr,
      	gimple_omp_teams_set_clauses): New inlines.
      	(CASE_GIMPLE_OMP): Add GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS
      	and GIMPLE_OMP_TASKGROUP.
      	* tree-core.h (enum omp_clause_code): Add new OpenMP 4.0 clause
      	codes.
      	(enum omp_clause_depend_kind, enum omp_clause_map_kind,
      	enum omp_clause_proc_bind_kind): New.
      	(union omp_clause_subcode): Add depend_kind, map_kind and
      	proc_bind_kind fields.
      	* tree-cfg.c (make_edges): Handle GIMPLE_OMP_TARGET,
      	GIMPLE_OMP_TEAMS and GIMPLE_OMP_TASKGROUP.
      	* langhooks-def.h (lhd_omp_mappable_type): New prototype.
      	(LANG_HOOKS_OMP_MAPPABLE_TYPE): Define.
      	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Add it.
      gcc/c-family/
      	* c-cppbuiltin.c (c_cpp_builtins): Predefine _OPENMP to
      	201307 instead of 201107.
      	* c-common.c (DEF_FUNCTION_TYPE_8): Define.
      	(c_common_attribute_table): Add "omp declare target" and
      	"omp declare simd" attributes.
      	(handle_omp_declare_target_attribute,
      	handle_omp_declare_simd_attribute): New functions.
      	* c-omp.c: Include c-pragma.h.
      	(c_finish_omp_taskgroup): New function.
      	(c_finish_omp_atomic): Add swapped argument, if true,
      	build the operation first with rhs, lhs arguments and use NOP_EXPR
      	build_modify_expr.
      	(c_finish_omp_for): Add code argument, pass it down to make_code.
      	(c_omp_split_clauses): New function.
      	(c_split_parallel_clauses): Removed.
      	(c_omp_declare_simd_clause_cmp, c_omp_declare_simd_clauses_to_numbers,
      	c_omp_declare_simd_clauses_to_decls): New functions.
      	* c-common.h (omp_clause_mask): New type.
      	(OMP_CLAUSE_MASK_1): Define.
      	(omp_clause_mask::omp_clause_mask, omp_clause_mask::operator &=,
      	omp_clause_mask::operator |=, omp_clause_mask::operator ~,
      	omp_clause_mask::operator |, omp_clause_mask::operator &,
      	omp_clause_mask::operator <<, omp_clause_mask::operator >>,
      	omp_clause_mask::operator ==): New methods.
      	(enum c_omp_clause_split): New.
      	(c_finish_omp_taskgroup): New prototype.
      	(c_finish_omp_atomic): Add swapped argument.
      	(c_finish_omp_for): Add code argument.
      	(c_omp_split_clauses): New prototype.
      	(c_split_parallel_clauses): Removed.
      	(c_omp_declare_simd_clauses_to_numbers,
      	c_omp_declare_simd_clauses_to_decls): New prototypes.
      	* c-pragma.c (omp_pragmas): Add new OpenMP 4.0 constructs.
      	* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_CANCEL,
      	PRAGMA_OMP_CANCELLATION_POINT, PRAGMA_OMP_DECLARE_REDUCTION,
      	PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_END_DECLARE_TARGET, PRAGMA_OMP_SIMD,
      	PRAGMA_OMP_TARGET, PRAGMA_OMP_TASKGROUP and PRAGMA_OMP_TEAMS.
      	Remove PRAGMA_OMP_PARALLEL_FOR and PRAGMA_OMP_PARALLEL_SECTIONS.
      	(enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_ALIGNED,
      	PRAGMA_OMP_CLAUSE_DEPEND, PRAGMA_OMP_CLAUSE_DEVICE,
      	PRAGMA_OMP_CLAUSE_DIST_SCHEDULE, PRAGMA_OMP_CLAUSE_FOR,
      	PRAGMA_OMP_CLAUSE_FROM, PRAGMA_OMP_CLAUSE_INBRANCH,
      	PRAGMA_OMP_CLAUSE_LINEAR, PRAGMA_OMP_CLAUSE_MAP,
      	PRAGMA_OMP_CLAUSE_NOTINBRANCH, PRAGMA_OMP_CLAUSE_NUM_TEAMS,
      	PRAGMA_OMP_CLAUSE_PARALLEL, PRAGMA_OMP_CLAUSE_PROC_BIND,
      	PRAGMA_OMP_CLAUSE_SAFELEN, PRAGMA_OMP_CLAUSE_SECTIONS,
      	PRAGMA_OMP_CLAUSE_SIMDLEN, PRAGMA_OMP_CLAUSE_TASKGROUP,
      	PRAGMA_OMP_CLAUSE_THREAD_LIMIT, PRAGMA_OMP_CLAUSE_TO and
      	PRAGMA_OMP_CLAUSE_UNIFORM.
      gcc/ada/
      	* gcc-interface/utils.c (DEF_FUNCTION_TYPE_8): Define.
      gcc/fortran/
      	* trans-openmp.c (gfc_omp_clause_default_ctor,
      	gfc_omp_clause_dtor): Return NULL for OMP_CLAUSE_REDUCTION.
      	* f95-lang.c (ATTR_NULL, DEF_FUNCTION_TYPE_8): Define.
      	* types.def (DEF_FUNCTION_TYPE_8): Document.
      	(BT_FN_VOID_OMPFN_PTR_UINT,
      	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG,
      	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG,
      	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT): Remove.
      	(BT_FN_VOID_OMPFN_PTR_UINT_UINT_UINT,
      	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_UINT,
      	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT,
      	BT_FN_BOOL_INT, BT_FN_BOOL_INT_BOOL, BT_FN_VOID_UINT_UINT,
      	BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR,
      	BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR,
      	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR): New.
      gcc/lto/
      	* lto-lang.c (DEF_FUNCTION_TYPE_8): Define.
      gcc/c/
      	* c-lang.h (current_omp_declare_target_attribute): New extern
      	decl.
      	* c-parser.c: Include c-lang.h.
      	(struct c_parser): Change tokens to c_token *.
      	Add tokens_buf field.  Change tokens_avail type to unsigned int.
      	(c_parser_consume_token): If parser->tokens isn't
      	&parser->tokens_buf[0], increment parser->tokens.
      	(c_parser_consume_pragma): Likewise.
      	(enum pragma_context): Add pragma_struct and pragma_param.
      	(c_parser_external_declaration): Adjust
      	c_parser_declaration_or_fndef caller.
      	(c_parser_declaration_or_fndef): Add omp_declare_simd_clauses
      	argument, if it is non-vNULL vector, call c_finish_omp_declare_simd.
      	Adjust recursive call.
      	(c_parser_struct_or_union_specifier): Use pragma_struct instead
      	of pragma_external.
      	(c_parser_parameter_declaration): Use pragma_param instead of
      	pragma_external.
      	(c_parser_compound_statement_nostart, c_parser_label,
      	c_parser_for_statement): Adjust
      	c_parser_declaration_or_fndef callers.
      	(c_parser_expr_no_commas): Add omp_atomic_lhs argument, pass
      	it through to c_parser_conditional_expression.
      	(c_parser_conditional_expression): Add omp_atomic_lhs argument,
      	pass it through to c_parser_binary_expression.  Adjust recursive
      	call.
      	(c_parser_binary_expression): Remove prec argument, add
      	omp_atomic_lhs argument instead.  Always start from PREC_NONE, if
      	omp_atomic_lhs is non-NULL and one of the arguments of toplevel
      	binop matches it, use build2 instead of parser_build_binary_op.
      	(c_parser_pragma): Handle PRAGMA_OMP_CANCEL,
      	PRAGMA_OMP_CANCELLATION_POINT, PRAGMA_OMP_TARGET,
      	PRAGMA_OMP_END_DECLARE_TARGET, PRAGMA_OMP_DECLARE_REDUCTION.
      	Handle pragma_struct and pragma_param the same as pragma_external.
      	(c_parser_omp_clause_name): Parse new OpenMP 4.0 clause names.
      	(c_parser_omp_variable_list): Parse array sections for
      	OMP_CLAUSE_{DEPEND,MAP,TO,FROM} clauses.
      	(c_parser_omp_clause_collapse): Fully fold collapse expression.
      	(c_parser_omp_clause_reduction): Handle user defined reductions.
      	(c_parser_omp_clause_branch, c_parser_omp_clause_cancelkind,
      	c_parser_omp_clause_num_teams, c_parser_omp_clause_thread_limit,
      	c_parser_omp_clause_aligned, c_parser_omp_clause_linear,
      	c_parser_omp_clause_safelen, c_parser_omp_clause_simdlen,
      	c_parser_omp_clause_depend, c_parser_omp_clause_map,
      	c_parser_omp_clause_device, c_parser_omp_clause_dist_schedule,
      	c_parser_omp_clause_proc_bind, c_parser_omp_clause_to,
      	c_parser_omp_clause_from, c_parser_omp_clause_uniform): New functions.
      	(c_parser_omp_all_clauses): Add finish_p argument.  Don't call
      	c_finish_omp_clauses if it is false.  Handle new OpenMP 4.0 clauses.
      	(c_parser_omp_atomic): Parse seq_cst clause, pass true if it is
      	present to c_finish_omp_atomic.  Handle OpenMP 4.0 atomic forms.
      	(c_parser_omp_for_loop): Add CODE argument, pass it through
      	to c_finish_omp_for.  Change last argument to cclauses,
      	and adjust uses to grab parallel clauses from the array of all
      	the split clauses.  Adjust c_parser_binary_expression,
      	c_parser_declaration_or_fndef and c_finish_omp_for callers.
      	(omp_split_clauses): New function.
      	(c_parser_omp_simd): New function.
      	(c_parser_omp_for): Add p_name, mask and cclauses arguments.
      	Allow the function to be called also when parsing combined constructs,
      	and call c_parser_omp_simd when parsing for simd.
      	(c_parser_omp_sections_scope): If section-sequence doesn't start with
      	#pragma omp section, require exactly one structured-block instead of
      	sequence of statements.
      	(c_parser_omp_sections): Add p_name, mask and cclauses arguments.
      	Allow the function to be called also when parsing combined constructs.
      	(c_parser_omp_parallel): Add p_name, mask and cclauses arguments.
      	Allow the function to be called also when parsing combined
      	constructs.
      	(c_parser_omp_taskgroup, c_parser_omp_cancel,
      	c_parser_omp_cancellation_point, c_parser_omp_distribute,
      	c_parser_omp_teams, c_parser_omp_target_data,
      	c_parser_omp_target_update, c_parser_omp_target,
      	c_parser_omp_declare_simd, c_finish_omp_declare_simd,
      	c_parser_omp_declare_target, c_parser_omp_end_declare_target,
      	c_parser_omp_declare_reduction, c_parser_omp_declare): New functions.
      	(c_parser_omp_construct): Add p_name and mask vars.  Handle
      	PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
      	PRAGMA_OMP_TEAMS.  Adjust c_parser_omp_for, c_parser_omp_parallel
      	and c_parser_omp_sections callers.
      	(c_parse_file): Initialize tparser.tokens and the_parser->tokens here.
      	(OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
      	OMP_SINGLE_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.
      	(OMP_PARALLEL_CLAUSE_MASK): Likewise.  Add OMP_CLAUSE_PROC_BIND.
      	(OMP_TASK_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.  Add
      	OMP_CLAUSE_DEPEND.
      	(OMP_SIMD_CLAUSE_MASK, OMP_CANCEL_CLAUSE_MASK,
      	OMP_CANCELLATION_POINT_CLAUSE_MASK, OMP_DISTRIBUTE_CLAUSE_MASK,
      	OMP_TEAMS_CLAUSE_MASK, OMP_TARGET_DATA_CLAUSE_MASK,
      	OMP_TARGET_UPDATE_CLAUSE_MASK, OMP_TARGET_CLAUSE_MASK,
      	OMP_DECLARE_SIMD_CLAUSE_MASK): Define.
      	* c-typeck.c: Include tree-inline.h.
      	(c_finish_omp_cancel, c_finish_omp_cancellation_point,
      	handle_omp_array_sections_1, handle_omp_array_sections,
      	c_clone_omp_udr, c_find_omp_placeholder_r): New functions.
      	(c_finish_omp_clauses): Handle new OpenMP 4.0 clauses and
      	user defined reductions.
      	(c_tree_equal): New function.
      	* c-tree.h (temp_store_parm_decls, temp_pop_parm_decls,
      	c_finish_omp_cancel, c_finish_omp_cancellation_point, c_tree_equal,
      	c_omp_reduction_id, c_omp_reduction_decl, c_omp_reduction_lookup,
      	c_check_omp_declare_reduction_r): New prototypes.
      	* c-decl.c (current_omp_declare_target_attribute): New variable.
      	(c_decl_attributes): New function.
      	(start_decl, start_function): Use it instead of decl_attributes.
      	(temp_store_parm_decls, temp_pop_parm_decls, c_omp_reduction_id,
      	c_omp_reduction_decl, c_omp_reduction_lookup,
      	c_check_omp_declare_reduction_r): New functions.
      gcc/cp/
      	* decl.c (duplicate_decls): Error out for redeclaration of UDRs.
      	(declare_simd_adjust_this): New function.
      	(grokfndecl): If "omp declare simd" attribute is present,
      	call declare_simd_adjust_this if needed and
      	c_omp_declare_simd_clauses_to_numbers.
      	* cp-array-notation.c (expand_array_notation_exprs): Handle
      	OMP_TASKGROUP.
      	* cp-gimplify.c (cp_gimplify_expr): Handle OMP_SIMD and
      	OMP_DISTRIBUTE.  Handle is_invisiref_parm decls in
      	OMP_CLAUSE_REDUCTION.
      	(cp_genericize_r): Handle OMP_SIMD and OMP_DISTRIBUTE like
      	OMP_FOR.
      	(cxx_omp_privatize_by_reference): Return true for
      	is_invisiref_parm decls.
      	(cxx_omp_finish_clause): Adjust cxx_omp_create_clause_info
      	caller.
      	* pt.c (apply_late_template_attributes): For "omp declare simd"
      	attribute call tsubst_omp_clauses,
      	c_omp_declare_simd_clauses_to_decls, finish_omp_clauses
      	and c_omp_declare_simd_clauses_to_numbers.
      	(instantiate_class_template_1): Call cp_check_omp_declare_reduction
      	for UDRs.
      	(tsubst_decl): Handle UDRs.
      	(tsubst_omp_clauses): Add declare_simd argument, if true don't
      	call finish_omp_clauses.  Handle new OpenMP 4.0 clauses.
      	Handle non-NULL OMP_CLAUSE_REDUCTION_PLACEHOLDER on
      	OMP_CLAUSE_REDUCTION.
      	(tsubst_expr): For UDRs call pushdecl and
      	cp_check_omp_declare_reduction.  Adjust tsubst_omp_clauses
      	callers.  Handle OMP_SIMD, OMP_DISTRIBUTE, OMP_TEAMS,
      	OMP_TARGET_DATA, OMP_TARGET_UPDATE, OMP_TARGET, OMP_TASKGROUP.
      	Adjust finish_omp_atomic caller.
      	(tsubst_omp_udr): New function.
      	(instantiate_decl): For UDRs at block scope, don't call
      	start_preparsed_function/finish_function.  Call tsubst_omp_udr.
      	* semantics.c (cxx_omp_create_clause_info): Add need_dtor argument,
      	use it instead of need_default_ctor || need_copy_ctor.
      	(struct cp_check_omp_declare_reduction_data): New type.
      	(handle_omp_array_sections_1, handle_omp_array_sections,
      	omp_reduction_id, omp_reduction_lookup,
      	cp_remove_omp_priv_cleanup_stmt, cp_check_omp_declare_reduction_r,
      	cp_check_omp_declare_reduction, clone_omp_udr,
      	find_omp_placeholder_r, finish_omp_reduction_clause): New functions.
      	(finish_omp_clauses): Handle new OpenMP 4.0 clauses and user defined
      	reductions.
      	(finish_omp_for): Add CODE argument, use it instead of hardcoded
      	OMP_FOR.  Adjust c_finish_omp_for caller.
      	(finish_omp_atomic): Add seq_cst argument, adjust
      	c_finish_omp_atomic callers, handle seq_cst and new OpenMP 4.0
      	atomic variants.
      	(finish_omp_cancel, finish_omp_cancellation_point): New functions.
      	* decl2.c (mark_used): Force immediate instantiation of
      	DECL_OMP_DECLARE_REDUCTION_P decls.
      	(is_late_template_attribute): Return true for "omp declare simd"
      	attribute.
      	(cp_omp_mappable_type): New function.
      	(cplus_decl_attributes): Add implicit "omp declare target" attribute
      	if requested.
      	* parser.c (cp_debug_parser): Print
      	parser->colon_doesnt_start_class_def_p.
      	(cp_ensure_no_omp_declare_simd, cp_finalize_omp_declare_simd): New
      	functions.
      	(enum pragma_context): Add pragma_member and pragma_objc_icode.
      	(cp_parser_binary_expression): Handle no_toplevel_fold_p
      	even for binary operations other than comparison.
      	(cp_parser_linkage_specification): Call
      	cp_ensure_no_omp_declare_simd if needed.
      	(cp_parser_namespace_definition): Likewise.
      	(cp_parser_init_declarator): Call cp_finalize_omp_declare_simd.
      	(cp_parser_direct_declarator): Pass declarator to
      	cp_parser_late_return_type_opt.
      	(cp_parser_late_return_type_opt): Add declarator argument,
      	call cp_parser_late_parsing_omp_declare_simd for declare simd.
      	(cp_parser_class_specifier_1): Call cp_ensure_no_omp_declare_simd.
      	Parse UDRs before all other methods.
      	(cp_parser_member_specification_opt): Use pragma_member instead of
      	pragma_external.
      	(cp_parser_member_declaration): Call cp_finalize_omp_declare_simd.
      	(cp_parser_function_definition_from_specifiers_and_declarator,
      	cp_parser_save_member_function_body): Likewise.
      	(cp_parser_late_parsing_for_member): Handle UDRs specially.
      	(cp_parser_next_token_starts_class_definition_p): Don't allow
      	CPP_COLON if colon_doesnt_start_class_def_p flag is true.
      	(cp_parser_objc_interstitial_code): Use pragma_objc_icode
      	instead of pragma_external.
      	(cp_parser_omp_clause_name): Parse new OpenMP 4.0 clause names.
      	(cp_parser_omp_var_list_no_open): Parse array sections for
      	OMP_CLAUSE_{DEPEND,MAP,TO,FROM} clauses.  Add COLON argument,
      	if non-NULL, allow parsing to end with a colon rather than close
      	paren.
      	(cp_parser_omp_var_list): Adjust cp_parser_omp_var_list_no_open
      	caller.
      	(cp_parser_omp_clause_reduction): Handle user defined reductions.
      	(cp_parser_omp_clause_branch, cp_parser_omp_clause_cancelkind,
      	cp_parser_omp_clause_num_teams, cp_parser_omp_clause_thread_limit,
      	cp_parser_omp_clause_aligned, cp_parser_omp_clause_linear,
      	cp_parser_omp_clause_safelen, cp_parser_omp_clause_simdlen,
      	cp_parser_omp_clause_depend, cp_parser_omp_clause_map,
      	cp_parser_omp_clause_device, cp_parser_omp_clause_dist_schedule,
      	cp_parser_omp_clause_proc_bind, cp_parser_omp_clause_to,
      	cp_parser_omp_clause_from, cp_parser_omp_clause_uniform): New
      	functions.
      	(cp_parser_omp_all_clauses): Add finish_p argument.  Don't call
      	finish_omp_clauses if it is false.  Handle new OpenMP 4.0 clauses.
      	(cp_parser_omp_atomic): Parse seq_cst clause, pass
      	true if it is present to finish_omp_atomic.  Handle new OpenMP 4.0
      	atomic forms.
      	(cp_parser_omp_for_loop): Add CODE argument, pass it through
      	to finish_omp_for.  Change last argument to cclauses,
      	and adjust uses to grab parallel clauses from the array of all
      	the split clauses.
      	(cp_omp_split_clauses): New function.
      	(cp_parser_omp_simd): New function.
      	(cp_parser_omp_for): Add p_name, mask and cclauses arguments.
      	Allow the function to be called also when parsing combined constructs,
      	and call c_parser_omp_simd when parsing for simd.
      	(cp_parser_omp_sections_scope): If section-sequence doesn't start with
      	#pragma omp section, require exactly one structured-block instead of
      	sequence of statements.
      	(cp_parser_omp_sections): Add p_name, mask and cclauses arguments.
      	Allow the function to be called also when parsing combined constructs.
      	(cp_parser_omp_parallel): Add p_name, mask and cclauses arguments.
      	Allow the function to be called also when parsing combined
      	constructs.
      	(cp_parser_omp_taskgroup, cp_parser_omp_cancel,
      	cp_parser_omp_cancellation_point, cp_parser_omp_distribute,
      	cp_parser_omp_teams, cp_parser_omp_target_data,
      	cp_parser_omp_target_update, cp_parser_omp_target,
      	cp_parser_omp_declare_simd, cp_parser_late_parsing_omp_declare_simd,
      	cp_parser_omp_declare_target, cp_parser_omp_end_declare_target,
      	cp_parser_omp_declare_reduction_exprs, cp_parser_omp_declare_reduction,
      	cp_parser_omp_declare): New functions.
      	(cp_parser_omp_construct): Add p_name and mask vars.  Handle
      	PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
      	PRAGMA_OMP_TEAMS.  Adjust cp_parser_omp_for, cp_parser_omp_parallel
      	and cp_parser_omp_sections callers.
      	(cp_parser_pragma): Handle PRAGMA_OMP_CANCEL,
      	PRAGMA_OMP_CANCELLATION_POINT, PRAGMA_OMP_DECLARE_REDUCTION,
      	PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
      	PRAGMA_OMP_TEAMS, PRAGMA_OMP_TARGET, PRAGMA_OMP_END_DECLARE_TARGET.
      	Handle pragma_member and pragma_objc_icode like pragma_external.
      	(OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
      	OMP_SINGLE_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.
      	(OMP_PARALLEL_CLAUSE_MASK): Likewise.  Add OMP_CLAUSE_PROC_BIND.
      	(OMP_TASK_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.  Add
      	OMP_CLAUSE_DEPEND.
      	(OMP_SIMD_CLAUSE_MASK, OMP_CANCEL_CLAUSE_MASK,
      	OMP_CANCELLATION_POINT_CLAUSE_MASK, OMP_DISTRIBUTE_CLAUSE_MASK,
      	OMP_TEAMS_CLAUSE_MASK, OMP_TARGET_DATA_CLAUSE_MASK,
      	OMP_TARGET_UPDATE_CLAUSE_MASK, OMP_TARGET_CLAUSE_MASK,
      	OMP_DECLARE_SIMD_CLAUSE_MASK): Define.
      	* parser.h (struct cp_omp_declare_simd_data): New type.
      	(struct cp_parser): Add colon_doesnt_start_class_def_p and
      	omp_declare_simd fields.
      	* cp-objcp-common.h (LANG_HOOKS_OMP_MAPPABLE_TYPE): Define.
      	* cp-tree.h (struct lang_decl_fn): Add omp_declare_reduction_p
      	bit.
      	(DECL_OMP_DECLARE_REDUCTION_P): Define.
      	(OMP_FOR_GIMPLIFYING_P): Use OMP_LOOP_CHECK macro.
      	(struct saved_scope): Add omp_declare_target_attribute field.
      	(cp_omp_mappable_type, omp_reduction_id,
      	cp_remove_omp_priv_cleanup_stmt, cp_check_omp_declare_reduction,
      	finish_omp_cancel, finish_omp_cancellation_point): New prototypes.
      	(finish_omp_for): Add CODE argument.
      	(finish_omp_atomic): Add seq_cst argument.
      	(cxx_omp_create_clause_info): Add need_dtor argument.
      gcc/testsuite/
      	* c-c++-common/gomp/atomic-15.c: Adjust for C diagnostics.
      	Remove error test that is now valid in OpenMP 4.0.
      	* c-c++-common/gomp/atomic-16.c: New test.
      	* c-c++-common/gomp/cancel-1.c: New test.
      	* c-c++-common/gomp/depend-1.c: New test.
      	* c-c++-common/gomp/depend-2.c: New test.
      	* c-c++-common/gomp/map-1.c: New test.
      	* c-c++-common/gomp/pr58472.c: New test.
      	* c-c++-common/gomp/sections1.c: New test.
      	* c-c++-common/gomp/simd1.c: New test.
      	* c-c++-common/gomp/simd2.c: New test.
      	* c-c++-common/gomp/simd3.c: New test.
      	* c-c++-common/gomp/simd4.c: New test.
      	* c-c++-common/gomp/simd5.c: New test.
      	* c-c++-common/gomp/single1.c: New test.
      	* g++.dg/gomp/block-0.C: Adjust for stricter #pragma omp sections
      	parser.
      	* g++.dg/gomp/block-3.C: Likewise.
      	* g++.dg/gomp/clause-3.C: Adjust error messages.
      	* g++.dg/gomp/declare-simd-1.C: New test.
      	* g++.dg/gomp/declare-simd-2.C: New test.
      	* g++.dg/gomp/depend-1.C: New test.
      	* g++.dg/gomp/depend-2.C: New test.
      	* g++.dg/gomp/target-1.C: New test.
      	* g++.dg/gomp/target-2.C: New test.
      	* g++.dg/gomp/taskgroup-1.C: New test.
      	* g++.dg/gomp/teams-1.C: New test.
      	* g++.dg/gomp/udr-1.C: New test.
      	* g++.dg/gomp/udr-2.C: New test.
      	* g++.dg/gomp/udr-3.C: New test.
      	* g++.dg/gomp/udr-4.C: New test.
      	* g++.dg/gomp/udr-5.C: New test.
      	* g++.dg/gomp/udr-6.C: New test.
      	* gcc.dg/autopar/outer-1.c: Expect 4 instead of 5 loopfn matches.
      	* gcc.dg/autopar/outer-2.c: Likewise.
      	* gcc.dg/autopar/outer-3.c: Likewise.
      	* gcc.dg/autopar/outer-4.c: Likewise.
      	* gcc.dg/autopar/outer-5.c: Likewise.
      	* gcc.dg/autopar/outer-6.c: Likewise.
      	* gcc.dg/autopar/parallelization-1.c: Likewise.
      	* gcc.dg/gomp/block-3.c: Adjust for stricter #pragma omp sections
      	parser.
      	* gcc.dg/gomp/clause-1.c: Adjust error messages.
      	* gcc.dg/gomp/combined-1.c: Look for GOMP_parallel_loop_runtime
      	instead of GOMP_parallel_loop_runtime_start.
      	* gcc.dg/gomp/declare-simd-1.c: New test.
      	* gcc.dg/gomp/declare-simd-2.c: New test.
      	* gcc.dg/gomp/nesting-1.c: Adjust for stricter #pragma omp sections
      	parser.  Add further #pragma omp sections nesting tests.
      	* gcc.dg/gomp/target-1.c: New test.
      	* gcc.dg/gomp/target-2.c: New test.
      	* gcc.dg/gomp/taskgroup-1.c: New test.
      	* gcc.dg/gomp/teams-1.c: New test.
      	* gcc.dg/gomp/udr-1.c: New test.
      	* gcc.dg/gomp/udr-2.c: New test.
      	* gcc.dg/gomp/udr-3.c: New test.
      	* gcc.dg/gomp/udr-4.c: New test.
      	* gfortran.dg/gomp/appendix-a/a.35.5.f90: Add dg-error.
      
      Co-Authored-By: Richard Henderson <rth@redhat.com>
      Co-Authored-By: Tobias Burnus <burnus@net-b.de>
      
      From-SVN: r203408
      Jakub Jelinek committed
  2. 27 Aug, 2013 1 commit
    • Makefile.in (omp-low.o): Depend on $(TARGET_H). · 74bf76ed
      	* Makefile.in (omp-low.o): Depend on $(TARGET_H).
      	* cfgloop.h (struct loop): Add safelen, force_vect, simduid.
      	* function.h (struct function): Add has_force_vect_loops and
      	has_simduid_loops.
      	* gimple-pretty-print.c (dump_gimple_omp_for): Handle
      	GF_OMP_FOR_KIND*.
      	* gimple.c (gimple_build_omp_critical): Add KIND argument and
      	handle it.
      	* gimple.def: Update CLAUSES comments.
      	* gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}.
      	(gimple_build_omp_for): Add argument to prototype.
      	(gimple_omp_for_kind): New.
      	(gimple_omp_for_set_kind): New.
      	* gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to
      	GOVD_DATA_SHARE_CLASS.
      	(enum omp_region_type): Add ORT_SIMD.
      	(gimple_add_tmp_var): Handle ORT_SIMD.
      	(gimplify_var_or_parm_decl): Same.
      	(is_gimple_stmt): Same.
      	(omp_firstprivatize_variable): Same.
      	(omp_add_variable): Only use splay_tree_insert if lookup failed.
      	(omp_notice_variable): Handle ORT_SIMD.
      	(omp_is_private): Add SIMD argument and handle it as well as
      	ORT_SIMD.
      	(omp_check_private): Handle ORT_SIMD.
      	(gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and
      	OMP_CLAUSE_SAFELEN.
      	(gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR.
      	Handle OMP_CLAUSE_LASTPRIVATE.
      	(gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and
      	OMP_CLAUSE_SAFELEN.
      	(gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR.
      	(gimplify_expr): Handle OMP_SIMD.
      	* internal-fn.c (expand_GOMP_SIMD_LANE): New.
      	(expand_GOMP_SIMD_VF): New.
      	(expand_GOMP_SIMD_LAST_LANE): New.
      	* internal-fn.def (GOMP_SIMD_LANE): New.
      	(GOMP_SIMD_VF): New.
      	(GOMP_SIMD_LAST_LANE): New.
      	* omp-low.c: Include target.h.
      	(extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR,
      	OMP_CLAUSE_SAFELEN.
      	(check_omp_nesting_restrictions): Same.
      	(omp_max_vf): New.
      	(lower_rec_simd_input_clauses): New.
      	(lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD,
      	OMP_CLAUSE_LINEAR.
      	(lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR,
      	GF_OMP_FOR_KIND_SIMD, OMP_SIMD.
      	(expand_omp_build_assign): New.
      	(expand_omp_for_init_counts): New.
      	(expand_omp_for_init_vars): New.
      	(extract_omp_for_update_vars): New.
      	(expand_omp_for_generic): Use expand_omp_for_{init,update}_vars
      	and rewrite accordingly.
      	(expand_omp_simd): New.
      	(expand_omp_for): Use expand_omp_simd.
      	(lower_omp_for_lastprivate): Unshare vinit when appropriate.
      	(lower_omp_for): Do not lower the body.
      	* tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE
      	in their own loops.
      	* tree-flow.h (find_omp_clause): Remove prototype.
      	* tree-if-conv.c (main_tree_if_conversion): Run if doing if
      	conversion, forcing vectorization of the loop, or if
      	flag_tree_vectorize.
      	(gate_tree_if_conversion): Similarly.
      	* tree-inline.c (remap_gimple_stmt): Pass for kind argument to
      	gimple_build_omp_for.
      	(copy_cfg_body): set has_force_vect_loops and has_simduid_loops.
      	* tree-parloops (create_parallel_loop): Pass kind argument to
      	gimple_build_omp_for.
      	* tree-pretty-print.c (dump_omp_clause): Add cases for
      	OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN,
      	OMP_CLAUSE__SIMDUID_.
      	(dump_generic_node): Handle OMP_SIMD.
      	* tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*.
      	* tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not
      	unroll OMP_SIMD loops here.
      	* tree-ssa-loop.c (gate_tree_vectorize): Run if
      	has_force_vect_loops.
      	* tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle
      	loop->safelen
      	(vect_analyze_data_refs): Handle simd loops.
      	* tree-vect-loop.c (vectorizable_live_operation): Handle
      	IFN_GOMP_SIMD*.
      	* tree-vect-stmts.c (vectorizable_call): Handle
      	IFN_GOMP_SIMD_LANE.
      	(vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P.
      	(vectorizable_load): Same.
      	* tree-vectorizer.c: Include hash-table.h and
      	tree-ssa-propagate.h.
      	(struct simduid_to_vf): New.
      	(simduid_to_vf::hash): New.
      	(simduid_to-vf::equal): New.
      	(struct simd_array_to_simduid): New.
      	(simd_array_to_simduid::hash): New.
      	(simd_array_to_simduid::equal): New.
      	(adjust_simduid_builtins): New.
      	(struct note_simd_array_uses_struct): New.
      	(note_simd_array_uses_cb): New.
      	(note_simd_array_uses): New.
      	(vectorize_loops): Handle simd hints and adjust simd builtins
      	accordingly.
      	* tree-vectorizer.h (struct _stmt_vec_info): Add
      	simd_lane_access_p field.
      	(STMT_VINFO_SIMD_LANE_ACCESS_P): New macro.
      	* tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR,
      	OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM.
      	(omp_clause_code_name): Same.
      	(walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN,
      	OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR.
      	* tree.def (OMP_SIMD): New entry.
      	* tree.h (enum omp_clause_code): Add entries for
      	OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN,
      	OMP_CLAUSE__SIMDUID_.
      	(OMP_CLAUSE_DECL): Adjust range for new clauses.
      	(OMP_CLAUSE_LINEAR_NO_COPYIN): New.
      	(OMP_CLAUSE_LINEAR_NO_COPYOUT): New.
      	(OMP_CLAUSE_LINEAR_STEP): New.
      	(OMP_CLAUSE_SAFELEN_EXPR): New.
      	(OMP_CLAUSE__SIMDUID__DECL): New.
      	(find_omp_clause): New prototype.
      cp/
      	* cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses.
      
      Co-Authored-By: Aldy Hernandez <aldyh@redhat.com>
      
      From-SVN: r202029
      Jakub Jelinek committed
  3. 10 Jan, 2013 1 commit
  4. 04 Jan, 2013 1 commit
  5. 11 Oct, 2012 1 commit
  6. 10 Jul, 2012 1 commit
    • Add VEC_WIDEN_MULT_EVEN/ODD_EXPR · 3f30a9a6
              * tree.def (VEC_WIDEN_MULT_EVEN_EXPR, VEC_WIDEN_MULT_ODD_EXPR): New.
              * cfgexpand.c (expand_debug_expr): Handle them.
              * expr.c (expand_expr_real_2): Likewise.
              * fold-const.c (fold_binary_loc): Likewise.
              * gimple-pretty-print.c (dump_binary_rhs): Likewise.
              * optabs.c (optab_for_tree_code): Likewise.
              * tree-cfg.c (verify_gimple_assign_binary): Likewise.
              * tree-inline.c (estimate_operator_cost): Likewise.
              * tree-pretty-print.c (dump_generic_node): Likewise.
              * tree.c (commutative_tree_code): Likewise.
              * tree-vect-generic.c (expand_vector_operations_1): Likewise.
              Handle type change before looking up optab.
              * optabs.h (OTI_vec_widen_umult_even, OTI_vec_widen_umult_odd): New.
              (OTI_vec_widen_smult_even, OTI_vec_widen_smult_odd): New.
              (vec_widen_umult_even_optab, vec_widen_umult_odd_optab): New.
              (vec_widen_smult_even_optab, vec_widen_smult_odd_optab): New.
              * genopinit.c (optabs): Initialize them.
              * doc/md.texi: Document them.
      
      From-SVN: r189403
      Richard Henderson committed
  7. 27 Jun, 2012 1 commit
    • Add MULT_HIGHPART_EXPR · 98449720
              * tree.def (MULT_HIGHPART_EXPR): New.
              * cfgexpand.c (expand_debug_expr): Ignore it.
              * expr.c (expand_expr_real_2): Handle it.
              * fold-const.c (int_const_binop_1): Likewise.
              * optabs.c (optab_for_tree_code): Likewise.
              * tree-cfg.c (verify_gimple_assign_binary): Likewise.
              * tree-inline.c (estimate_operator_cost): Likewise.
              * tree-pretty-print.c (dump_generic_node): Likewise.
              (op_code_prio, op_symbol_code): Likewise.
              * tree.c (commutative_tree_code): Likewise.  Also handle
              WIDEN_MULT_EXPR, VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR.
      
      From-SVN: r189027
      Richard Henderson committed
  8. 18 Apr, 2012 1 commit
  9. 19 Mar, 2012 1 commit
    • tree.def (REALPART_EXPR, [...]): Move. · b199074d
      	* tree.def (REALPART_EXPR, IMAGPART_EXPR, VIEW_CONVERT_EXPR): Move.
      	* tree.h (handled_component_p): Reorder cases.
      	* dwarf2out.c (loc_list_for_address_of_addr_expr_of_indirect_ref): Do
      	not initialize unsignedp.
      	(loc_list_from_tree): Likewise.
      	(fortran_common): Likewise.
      	* simplify-rtx.c (delegitimize_mem_from_attrs): Likewise.
      
      From-SVN: r185522
      Eric Botcazou committed
  10. 23 Dec, 2011 2 commits
    • Delete VEC_EXTRACT_EVEN/ODD_EXPR. · e2c83630
      	* tree.def (VEC_EXTRACT_EVEN_EXPR, VEC_EXTRACT_ODD_EXPR): Remove.
      	* cfgexpand.c (expand_debug_expr): Don't handle them.
      	* expr.c (expand_expr_real_2): Likewise.
      	* fold-const.c (fold_binary_loc): Likewise.
      	* gimple-pretty-print.c (dump_binary_rhs): Likewise.
      	* tree-cfg.c (verify_gimple_assign_binary): Likewise.
      	* tree-inline.c (estimate_operator_cost): Likewise.
      	* tree-pretty-print.c (dump_generic_node): Likewise.
      	* tree-vect-generic.c (expand_vector_operations_1): Likewise.
      	* optabs.c (optab_for_tree_code): Likewise.
      	(can_vec_perm_for_code_p): Remove.
      	(expand_binop): Don't try it.
      	(init_optabs): Don't init vec_extract_even/odd_optab.
      	* genopinit.c (optabs): Likewise.
      	* optabs.h (OTI_vec_extract_even, OTI_vec_extract_odd): Remove.
      	(vec_extract_even_optab, vec_extract_odd_optab): Remove.
      	* tree-vect-data-refs.c (vect_strided_store_supported): Tidy code.
      	(vect_permute_store_chain): Use TYPE_VECTOR_SUBPARTS instead of
      	GET_MODE_NUNITS; check vect_gen_perm_mask return value instead of
      	asserting vect_strided_store_supported.
      	(vect_strided_load_supported): Use can_vec_perm_p.
      	(vect_permute_load_chain): Use VEC_PERM_EXPR.
      
      	* doc/generic.texi (VEC_EXTRACT_EVEN_EXPR): Remove.
      	(VEC_EXTRACT_ODD_EXPR): Remove.
      	* doc/md.texi (vec_extract_even, vec_extract_odd): Remove.
      
      From-SVN: r182669
      Richard Henderson committed
    • Delete VEC_INTERLEAVE_*_EXPR. · 3fcc1b55
      	* tree.def (VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR): Remove.
      	* gimple-pretty-print.c (dump_binary_rhs): Don't handle
      	VEC_INTERLEAVE_HIGH_EXPR and VEC_INTERLEAVE_LOW_EXPR.
      	* expr.c (expand_expr_real_2): Likewise.
      	* tree-cfg.c (verify_gimple_assign_binary): Likewise.
      	* cfgexpand.c (expand_debug_expr): Likewise.
      	* tree-inline.c (estimate_operator_cost): Likewise.
      	* tree-pretty-print.c (dump_generic_node): Likewise.
      	* tree-vect-generic.c (expand_vector_operations_1): Likewise.
      	* fold-const.c (fold_binary_loc): Likewise.
      	* doc/generic.texi (VEC_INTERLEAVE_HIGH_EXPR,
      	VEC_INTERLEAVE_LOW_EXPR): Remove documentation.
      	* optabs.c (optab_for_tree_code): Don't handle
      	VEC_INTERLEAVE_HIGH_EXPR and VEC_INTERLEAVE_LOW_EXPR.
      	(expand_binop, init_optabs): Remove vec_interleave_high_optab
      	and vec_interleave_low_optab.
      	* genopinit.c (optabs): Likewise.
      	* optabs.h (OTI_vec_interleave_high, OTI_vec_interleave_low): Remove.
      	(vec_interleave_high_optab, vec_interleave_low_optab): Remove.
      	* doc/md.texi (vec_interleave_high, vec_interleave_low): Remove
      	documentation.
      	* tree-vect-stmts.c (gen_perm_mask): Renamed to...
      	(vect_gen_perm_mask): ... this.  No longer static.
      	(perm_mask_for_reverse, vectorizable_load): Adjust callers.
      	* tree-vectorizer.h (vect_gen_perm_mask): New prototype.
      	* tree-vect-data-refs.c (vect_strided_store_supported): Don't try
      	VEC_INTERLEAVE_*_EXPR, use can_vec_perm_p instead of
      	can_vec_perm_for_code_p.
      	(vect_permute_store_chain): Generate VEC_PERM_EXPR with interleaving
      	masks instead of VEC_INTERLEAVE_HIGH_EXPR and VEC_INTERLEAVE_LOW_EXPR.
      	* config/i386/i386.c (expand_vec_perm_interleave2): If
      	expand_vec_perm_interleave3 would handle it, return false.
      	(expand_vec_perm_broadcast_1): Don't use vec_interleave_*_optab.
      
      From-SVN: r182663
      Jakub Jelinek committed
  11. 13 Dec, 2011 2 commits
    • Revert two unintended commits · b826bea7
      From-SVN: r182301
      Richard Henderson committed
    • Delete VEC_INTERLEAVE_*_EXPR. · 8c75d41b
      	* tree.def (VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR): Remove.
      	* gimple-pretty-print.c (dump_binary_rhs): Don't handle
      	VEC_INTERLEAVE_HIGH_EXPR and VEC_INTERLEAVE_LOW_EXPR.
      	* expr.c (expand_expr_real_2): Likewise.
      	* tree-cfg.c (verify_gimple_assign_binary): Likewise.
      	* cfgexpand.c (expand_debug_expr): Likewise.
      	* tree-inline.c (estimate_operator_cost): Likewise.
      	* tree-pretty-print.c (dump_generic_node): Likewise.
      	* tree-vect-generic.c (expand_vector_operations_1): Likewise.
      	* fold-const.c (fold_binary_loc): Likewise.
      	* doc/generic.texi (VEC_INTERLEAVE_HIGH_EXPR,
      	VEC_INTERLEAVE_LOW_EXPR): Remove documentation.
      	* optabs.c (optab_for_tree_code): Don't handle
      	VEC_INTERLEAVE_HIGH_EXPR and VEC_INTERLEAVE_LOW_EXPR.
      	(expand_binop, init_optabs): Remove vec_interleave_high_optab
      	and vec_interleave_low_optab.
      	* genopinit.c (optabs): Likewise.
      	* optabs.h (OTI_vec_interleave_high, OTI_vec_interleave_low): Remove.
      	(vec_interleave_high_optab, vec_interleave_low_optab): Remove.
      	* doc/md.texi (vec_interleave_high, vec_interleave_low): Remove
      	documentation.
      	* tree-vect-stmts.c (gen_perm_mask): Renamed to...
      	(vect_gen_perm_mask): ... this.  No longer static.
      	(perm_mask_for_reverse, vectorizable_load): Adjust callers.
      	* tree-vectorizer.h (vect_gen_perm_mask): New prototype.
      	* tree-vect-data-refs.c (vect_strided_store_supported): Don't try
      	VEC_INTERLEAVE_*_EXPR, use can_vec_perm_p instead of
      	can_vec_perm_for_code_p.
      	(vect_permute_store_chain): Generate VEC_PERM_EXPR with interleaving
      	masks instead of VEC_INTERLEAVE_HIGH_EXPR and VEC_INTERLEAVE_LOW_EXPR.
      	* config/i386/i386.c (expand_vec_perm_interleave2): If
      	expand_vec_perm_interleave3 would handle it, return false.
      	(expand_vec_perm_broadcast_1): Don't use vec_interleave_*_optab.
      
      From-SVN: r182298
      Richard Henderson committed
  12. 22 Nov, 2011 1 commit
  13. 08 Nov, 2011 1 commit
  14. 25 Oct, 2011 1 commit
  15. 18 Oct, 2011 1 commit
    • md.texi (vec_widen_ushiftl_hi, [...]): Document. · 36ba4aae
      	* doc/md.texi (vec_widen_ushiftl_hi, vec_widen_ushiftl_lo,
      	vec_widen_sshiftl_hi, vec_widen_sshiftl_lo): Document.
      	* tree-pretty-print.c (dump_generic_node): Handle WIDEN_LSHIFT_EXPR,
      	VEC_WIDEN_LSHIFT_HI_EXPR and VEC_WIDEN_LSHIFT_LO_EXPR.
      	(op_code_prio): Likewise.
      	(op_symbol_code): Handle WIDEN_LSHIFT_EXPR.
      	* optabs.c (optab_for_tree_code): Handle
      	VEC_WIDEN_LSHIFT_HI_EXPR and VEC_WIDEN_LSHIFT_LO_EXPR.
      	(init-optabs): Initialize optab codes for vec_widen_u/sshiftl_hi/lo.
      	* optabs.h (enum optab_index): Add OTI_vec_widen_u/sshiftl_hi/lo.
      	* genopinit.c (optabs): Initialize the new optabs.
      	* expr.c (expand_expr_real_2): Handle
      	VEC_WIDEN_LSHIFT_HI_EXPR and VEC_WIDEN_LSHIFT_LO_EXPR.
      	* gimple-pretty-print.c (dump_binary_rhs): Likewise.
      	* tree-vectorizer.h (NUM_PATTERNS): Increase to 8.
      	* tree.def (WIDEN_LSHIFT_EXPR, VEC_WIDEN_LSHIFT_HI_EXPR,
      	VEC_WIDEN_LSHIFT_LO_EXPR): New.
      	* cfgexpand.c (expand_debug_expr): Handle new tree codes.
      	* tree-vect-patterns.c (vect_vect_recog_func_ptrs): Add
      	vect_recog_widen_shift_pattern.
      	(vect_handle_widen_mult_by_const): Rename...
      	(vect_handle_widen_op_by_const): ...to this.  Handle shifts.
      	Add a new argument, update documentation.
      	(vect_recog_widen_mult_pattern): Assume that only second
      	operand can be constant.  Update call to
      	vect_handle_widen_op_by_const.
      	(vect_recog_over_widening_pattern): Fix typo.
      	(vect_recog_widen_shift_pattern): New.
      	* tree-vect-stmts.c (vectorizable_type_promotion): Handle
      	widening shifts.
      	(supportable_widening_operation): Likewise.
      	* tree-inline.c (estimate_operator_cost): Handle new tree codes.
      	* tree-vect-generic.c (expand_vector_operations_1): Likewise.
      	* tree-cfg.c (verify_gimple_assign_binary): Likewise.
      	* config/arm/neon.md (neon_vec_<US>shiftl_<mode>): New.
      	(vec_widen_<US>shiftl_lo_<mode>, neon_vec_<US>shiftl_hi_<mode>,
      	vec_widen_<US>shiftl_hi_<mode>, neon_vec_<US>shift_left_<mode>):
      	Likewise.
      	* config/arm/predicates.md (const_neon_scalar_shift_amount_operand):
      	New.
      	* config/arm/iterators.md (V_innermode): New.
      	* tree-vect-slp.c (vect_build_slp_tree): Require same shift operand
      	for widening shift.
      
      From-SVN: r180128
      Ira Rosen committed
  16. 07 Oct, 2011 1 commit
    • Rename vshuffle/vec_shuffle to vec_perm. · 2205ed25
              * doc/extend.texi (__builtin_shuffle): Improve the description to
              include the modulus of the selector.  Mention OpenCL.
              * doc/md.texi (vec_perm, vec_perm_const): Document named patterns.
      
              * tree.def (VEC_PERM_EXPR): Rename from VEC_SHUFFLE_EXPR.
              * genopinit.c (optabs): Rename vshuffle to vec_perm.
              * c-typeck.c (c_build_vec_perm_expr): Rename from
              c_build_vec_shuffle_expr.  Update for name changes.
              * optabs.c (expand_vec_perm_expr_p): Rename from
              expand_vec_shuffle_expr_p.
              (expand_vec_perm_expr): Rename from expand_vec_shuffle_expr.
              * optabs.h (OTI_vec_perm): Rename from DOI_vshuffle.
              (vec_perm_optab): Rename from vshuffle_optab.
              * expr.c, gimple-pretty-print.c, gimple.c, gimplify.c,
              c-tree.h, c-parser.c, tree-cfg.c, tree-inline.c, tree-pretty-print.c,
              tree-ssa-operands.c, tree-vect-generic.c: Update for name changes.
      
              * config/i386/i386.c (ix86_expand_vec_perm): Rename from
              ix86_expand_vshuffle.
              * config/i386/i386-protos.h: Update.
              * config/i386/sse.md (VEC_PERM_AVX2): Rename from VSHUFFLE_AVX2.
              (vec_perm<VEC_PERM_AVX2>): Rename from vshuffle<VSHUFFLE_AVX2>.
      
      From-SVN: r179701
      Richard Henderson committed
  17. 03 Oct, 2011 1 commit
  18. 29 Aug, 2011 1 commit
    • 20011-08-29 Artjoms Sinkarovs <artyom.shinkaroff@gmail.com> · 544d960a
      	Richard Guenther  <rguenther@suse.de>
      
      	* tree.h (constant_boolean_node): Adjust prototype.
      	* fold-const.c (fold_convert_loc): Move aggregate conversion
      	leeway down.
      	(constant_boolean_node): Make value parameter boolean, add
      	vector type handling.
      	(fold_unary_loc): Use constant_boolean_node.
      	(fold_binary_loc): Preserve types properly when folding
      	COMPLEX_EXPR <__real x, __imag x>.
      	* gimplify.c (gimplify_expr): Handle vector comparison.
      	* tree.def (EQ_EXPR, ...): Document behavior on vector typed
      	comparison.
      	* tree-cfg.c (verify_gimple_comparison): Verify vector typed
      	comparisons.
      
      From-SVN: r178209
      Artjoms Sinkarovs committed
  19. 02 Aug, 2011 1 commit
    • backport: re PR fortran/46752 (OpenMP - Seg fault for unallocated allocatable… · 20906c66
      backport: re PR fortran/46752 (OpenMP - Seg fault for unallocated allocatable array in firstprivate clause)
      
      Merge from gomp-3_1-branch branch:
      
      2011-08-02  Jakub Jelinek  <jakub@redhat.com>
      
      gcc/
      	* c-parser.c (enum c_parser_prec): New enum, moved from within
      	c_parser_binary_expression.
      	(c_parser_binary_expression): Add PREC argument.  Stop parsing
      	if operator has lower or equal precedence than PREC.
      	(c_parser_conditional_expression, c_parser_omp_for_loop): Adjust
      	callers.
      	(c_parser_omp_atomic): Handle parsing OpenMP 3.1 atomics.
      	Adjust c_finish_omp_atomic caller.
      	(c_parser_omp_taskyield): New function.
      	(c_parser_pragma): Handle PRAGMA_OMP_TASKYIELD.
      	(c_parser_omp_clause_name): Handle final and mergeable clauses.
      	(c_parser_omp_clause_final, c_parser_omp_clause_mergeable): New
      	functions.
      	(c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FINAL
      	and PRAGMA_OMP_CLAUSE_MERGEABLE.
      	(OMP_TASK_CLAUSE_MASK): Allow final and mergeable clauses.
      	(c_parser_omp_clause_reduction): Handle min and max.
      	* c-typeck.c (c_finish_omp_clauses): Don't complain about
      	const qualified predetermined vars in firstprivate clause.
      	andle OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE.
      	Handle MIN_EXPR and MAX_EXPR.
      	* tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_FINAL
      	and OMP_CLAUSE_MERGEABLE.
      	(dump_generic_node): Handle OMP_ATOMIC_READ, OMP_ATOMIC_CAPTURE_OLD
      	and OMP_ATOMIC_CAPTURE_NEW.
      	* tree.c (omp_clause_num_ops): Add OMP_CLAUSE_FINAL and
      	OMP_CLAUSE_MERGEABLE.
      	(omp_clause_code_name): Likewise.
      	(walk_tree_1): Handle OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE.
      	* tree.h (enum omp_clause_code): Add OMP_CLAUSE_FINAL
      	and OMP_CLAUSE_MERGEABLE.
      	(OMP_CLAUSE_FINAL_EXPR): Define.
      	* omp-low.c (scan_sharing_clauses): Handle OMP_CLAUSE_FINAL and
      	OMP_CLAUSE_MERGEABLE.
      	(expand_task_call): Likewise.
      	(expand_omp_atomic_load, expand_omp_atomic_store): New functions.
      	(expand_omp_atomic_fetch_op): Handle cases where old or new
      	value is needed afterwards.
      	(expand_omp_atomic): Call expand_omp_atomic_load resp.
      	expand_omp_atomic_store.
      	* gimplify.c (gimplify_omp_atomic, gimplify_expr): Handle
      	OMP_ATOMIC_READ, OMP_ATOMIC_CAPTURE_OLD and OMP_ATOMIC_CAPTURE_NEW.
      	(gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses): Handle
      	OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE.
      	* tree-nested.c (convert_nonlocal_omp_clauses,
      	convert_local_omp_clauses): Likewise.
      	* tree.def (OMP_ATOMIC_READ, OMP_ATOMIC_CAPTURE_OLD,
      	OMP_ATOMIC_CAPTURE_NEW): New.
      	* gimple.h (GF_OMP_ATOMIC_NEED_VALUE): New.
      	(gimple_omp_atomic_need_value_p, gimple_omp_atomic_set_need_value):
      	New inlines.
      	* omp-builtins.def (BUILT_IN_GOMP_TASKYIELD): New builtin.
      	* doc/generic.texi: Mention OMP_CLAUSE_COLLAPSE,
      	OMP_CLAUSE_UNTIED, OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE.
      gcc/c-family/
      	* c-common.h (c_finish_omp_atomic): Adjust prototype.
      	(c_finish_omp_taskyield): New prototype.
      	* c-omp.c (c_finish_omp_atomic): Add OPCODE, V, LHS1 and RHS1
      	arguments. Handle OMP_ATOMIC_READ, OMP_ATOMIC_CAPTURE_OLD and
      	OMP_ATOMIC_CAPTURE_NEW in addition to OMP_ATOMIC.  If LHS1
      	or RHS1 have side-effects, evaluate those too in the right spot,
      	if it is a decl and LHS is also a decl, error out if they
      	aren't the same.
      	(c_finish_omp_taskyield): New function.
      	* c-cppbuiltin.c (c_cpp_builtins): Change _OPENMP to 201107.
      	* c-pragma.c (omp_pragmas): Add taskyield.
      	* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_TASKYIELD.
      	(enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_FINAL and
      	PRAGMA_OMP_CLAUSE_MERGEABLE.
      gcc/cp/
      	* cp-tree.h (finish_omp_atomic): Adjust prototype.
      	(cxx_omp_const_qual_no_mutable): New prototype.
      	(finish_omp_taskyield): New prototype.
      	* parser.c (cp_parser_omp_atomic): (cp_parser_omp_atomic): Handle
      	parsing OpenMP 3.1 atomics.  Adjust finish_omp_atomic caller.
      	(cp_parser_omp_clause_name): Handle final and mergeable clauses.
      	(cp_parser_omp_clause_final, cp_parser_omp_clause_mergeable): New
      	functions.
      	(cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FINAL
      	and PRAGMA_OMP_CLAUSE_MERGEABLE.
      	(OMP_TASK_CLAUSE_MASK): Allow final and mergeable clauses.
      	(cp_parser_omp_taskyield): New function.
      	(cp_parser_pragma): Handle PRAGMA_OMP_TASKYIELD.
      	(cp_parser_omp_clause_reduction): Handle min and max.
      	* pt.c (tsubst_expr) <case OMP_ATOMIC>: Handle OpenMP 3.1 atomics.
      	(tsubst_omp_clauses): Handle OMP_CLAUSE_FINAL and
      	OMP_CLAUSE_MERGEABLE.
      	* semantics.c (finish_omp_atomic): Add OPCODE, V, LHS1 and RHS1
      	arguments.  Handle OpenMP 3.1 atomics.  Adjust c_finish_omp_atomic
      	caller.
      	(finish_omp_clauses): Don't complain about const qualified
      	predetermined vars and static data members in firstprivate clause.
      	Handle OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE. Handle MIN_EXPR
      	and MAX_EXPR.
      	(finish_omp_taskyield): New function.
      	* cp-gimplify.c (cxx_omp_const_qual_no_mutable): New function.
      	(cxx_omp_predetermined_sharing): Use it.
      gcc/fortran/
      	PR fortran/46752
      	* cpp.c (cpp_define_builtins): Change _OPENMP to 201107.
      	* openmp.c (gfc_free_omp_clauses): Free also final_expr.
      	(OMP_CLAUSE_FINAL, OMP_CLAUSE_MERGEABLE): Define.
      	(gfc_match_omp_clauses): Handle parsing final and mergeable
      	clauses.
      	(OMP_TASK_CLAUSES): Allow final and mergeable clauses.
      	(gfc_match_omp_taskyield): New function.
      	(resolve_omp_clauses): Resolve final clause.  Allow POINTERs and
      	Cray pointers in clauses other than REDUCTION.
      	(gfc_match_omp_atomic): Match optional
      	read/write/update/capture keywords after !$omp atomic.
      	(resolve_omp_atomic): Handle all OpenMP 3.1 atomic forms.
      	* dump-parse-tree.c (show_omp_node): Handle EXEC_OMP_TASKYIELD,
      	print final and mergeable clauses.
      	(show_code_node): Handle EXEC_OMP_TASKYIELD.
      	* trans-openmp.c (gfc_trans_omp_clauses): Handle final and
      	mergeable clauses.
      	(gfc_trans_omp_taskyield): New function.
      	(gfc_trans_omp_directive): Handle EXEC_OMP_TASKYIELD.
      	(gfc_trans_omp_atomic): Handle all OpenMP 3.1 atomic forms.
      	(gfc_omp_clause_copy_ctor): Handle non-allocated allocatable.
      	(gfc_omp_predetermined_sharing): Adjust comment.
      	* gfortran.h (gfc_statement): Add ST_OMP_TASKYIELD and
      	ST_OMP_END_ATOMIC.
      	(gfc_omp_clauses): Add final_expr and mergeable fields.
      	(gfc_exec_op): Add EXEC_OMP_TASKYIELD.
      	(gfc_omp_atomic_op): New enum typedef.
      	(struct gfc_code): Add ext.omp_atomic.
      	* trans.c (trans_code): Handle EXEC_OMP_TASKYIELD.
      	* frontend-passes.c (gfc_code_walker): Also walk final_expr.
      	* resolve.c (gfc_resolve_blocks, resolve_code): Handle
      	EXEC_OMP_TASKYIELD.
      	* st.c (gfc_free_statement): Likewise.
      	* match.h (gfc_match_omp_taskyield): New prototype.
      	* parse.c (decode_omp_directive): Handle taskyield directive.
      	Handle !$omp end atomic.
      	(case_executable): Add ST_OMP_TASKYIELD case.
      	(gfc_ascii_statement): Handle ST_OMP_TASKYIELD.
      	(parse_omp_atomic): Return gfc_statement instead of void.
      	For !$omp atomic capture parse two assignments instead of
      	just one and require !$omp end atomic afterwards, for
      	other !$omp atomic forms just allow !$omp end atomic at the
      	end.
      	(parse_omp_structured_block, parse_executable): Adjust
      	parse_omp_atomic callers.
      
      2011-08-02  Tobias Burnus  <burnus@net-b.de>
      
      	* intrinsic.c (OMP_LIB): Updated openmp_version's
      	value to 201107.
      	* gfortran.texi (OpenMP): Update ref to OpenMP 3.1.
      	* intrinsic.texi (OpenMP Modules): Update ref to OpenMP 3.1;
      	remove deleted omp_integer_kind and omp_logical_kind constants.
      gcc/testsuite/
      	PR fortran/46752
      	* gcc.dg/gomp/atomic-5.c: Adjust expected diagnostics.
      	* gcc.dg/gomp/atomic-15.c: New test.
      	* g++.dg/gomp/atomic-5.C: Adjust expected diagnostics.
      	* g++.dg/gomp/atomic-15.C: New test.
      	* g++.dg/gomp/private-1.C: New test.
      	* g++.dg/gomp/sharing-2.C: New test.
      	* gfortran.dg/gomp/crayptr1.f90: Don't expect error
      	about Cray pointer in FIRSTPRIVATE/LASTPRIVATE.
      	* gfortran.dg/gomp/omp_atomic2.f90: New test.
      libgomp/
      	PR fortran/42041
      	PR fortran/46752
      	* omp.h.in (omp_in_final): New prototype.
      	* omp_lib.f90.in (omp_in_final): New interface.
      	(omp_integer_kind, omp_logical_kind): Remove
      	and replace all its uses in the module with 4.
      	(openmp_version): Change to 201107.
      	* omp_lib.h.in (omp_sched_static, omp_sched_dynamic,
      	omp_sched_guided, omp_sched_auto): Use omp_sched_kind
      	kind for the parameters.
      	(omp_in_final): New external.
      	(openmp_version): Change to 201107.
      	* task.c (omp_in_final): New function.
      	(gomp_init_task): Initialize final_task.
      	(GOMP_task): Remove unused attribute from flags.  Handle final
      	tasks.
      	(GOMP_taskyield): New function.
      	(omp_in_final): Return true if if (false) or final (true) task
      	or descendant of final (true).
      	* fortran.c (omp_in_final_): New function.
      	* libgomp.map (OMP_3.1): Export omp_in_final and omp_in_final_.
      	(GOMP_3.0): Export GOMP_taskyield.
      	* env.c (gomp_nthreads_var_list, gomp_nthreads_var_list_len): New
      	variables.
      	(parse_unsigned_long_list): New function.
      	(initialize_env): Use it for OMP_NUM_THREADS.  Call parse_boolean
      	with "OMP_PROC_BIND".  If OMP_PROC_BIND=true, call gomp_init_affinity
      	even if parse_affinity returned false.
      	* config/linux/affinity.c (gomp_init_affinity): Handle
      	gomp_cpu_affinity_len == 0.
      	* libgomp_g.h (GOMP_taskyield): New prototype.
      	* libgomp.h (struct gomp_task): Add final_task field.
      	(gomp_nthreads_var_list, gomp_nthreads_var_list_len): New externs.
      	* team.c (gomp_team_start): Override new task's nthreads_var icv
      	if list form OMP_NUM_THREADS has been used and it has value for
      	the new nesting level.
      
      	* testsuite/libgomp.c/atomic-11.c: New test.
      	* testsuite/libgomp.c/atomic-12.c: New test.
      	* testsuite/libgomp.c/atomic-13.c: New test.
      	* testsuite/libgomp.c/atomic-14.c: New test.
      	* testsuite/libgomp.c/reduction-6.c: New test.
      	* testsuite/libgomp.c/task-5.c: New test.
      	* testsuite/libgomp.c++/atomic-2.C: New test.
      	* testsuite/libgomp.c++/atomic-3.C: New test.
      	* testsuite/libgomp.c++/atomic-4.C: New test.
      	* testsuite/libgomp.c++/atomic-5.C: New test.
      	* testsuite/libgomp.c++/atomic-6.C: New test.
      	* testsuite/libgomp.c++/atomic-7.C: New test.
      	* testsuite/libgomp.c++/atomic-8.C: New test.
      	* testsuite/libgomp.c++/atomic-9.C: New test.
      	* testsuite/libgomp.c++/task-8.C: New test.
      	* testsuite/libgomp.c++/reduction-4.C: New test.
      	* testsuite/libgomp.fortran/allocatable7.f90: New test.
      	* testsuite/libgomp.fortran/allocatable8.f90: New test.
      	* testsuite/libgomp.fortran/crayptr3.f90: New test.
      	* testsuite/libgomp.fortran/omp_atomic3.f90: New test.
      	* testsuite/libgomp.fortran/omp_atomic4.f90: New test.
      	* testsuite/libgomp.fortran/pointer1.f90: New test.
      	* testsuite/libgomp.fortran/pointer2.f90: New test.
      	* testsuite/libgomp.fortran/task4.f90: New test.
      
      2011-08-02  Tobias Burnus  <burnus@net-b.de>
      
      	* libgomp.texi: Update OpenMP spec references to 3.1.
      	(omp_in_final,OMP_PROC_BIND): New sections.
      	(OMP_NUM_THREADS): Document that the value can be now a list.
      	(GOMP_STACKSIZE,GOMP_CPU_AFFINITY): Update @ref.
      
      From-SVN: r177194
      Jakub Jelinek committed
  20. 10 May, 2011 1 commit
  21. 21 Jan, 2011 1 commit
  22. 04 Nov, 2010 1 commit
    • tree.def (FMA_EXPR): New tree code. · 16949072
      2010-11-04  Richard Guenther  <rguenther@suse.de>
      	Richard Henderson  <rth@redhat.com>
      
      	* tree.def (FMA_EXPR): New tree code.
      	* expr.c (expand_expr_real_2): Add FMA_EXPR expansion code.
      	* gimple.c (gimple_rhs_class_table): FMA_EXPR is a GIMPLE_TERNARY_RHS.
      	* tree-cfg.c (verify_gimple_assign_ternary): Verify FMA_EXPR types.
      	* tree-inline.c (estimate_operator_cost): Handle FMA_EXPR.
      	* gimple-pretty-print.c (dump_ternary_rhs): Likewise.
      	* tree-ssa-math-opts.c (convert_mult_to_fma): New function.
      	(execute_optimize_widening_mul): Call it.  Reorganize to allow
      	dead stmt removal.  Move TODO flags ...
      	(pass_optimize_widening_mul): ... here.
      	* flag-types.h (enum fp_contract_mode): New enum.
      	* common.opt (flag_fp_contract_mode): New variable.
      	(-ffp-contract): New option.
      	* opts.c (common_handle_option): Handle it.
      	* doc/invoke.texi (-ffp-contract): Document.
      	* tree.h (fold_fma): Declare.
      	* builtins.c (fold_fma): New function.
      	(fold_builtin_fma): Likewise.
      	(fold_builtin_3): Call it for fma.
      	* fold-const.c (fold_ternary_loc): Fold FMA_EXPR.
      	* optabs.c (optab_for_tree_code): Handle FMA_EXPR.
      	* config/i386/sse.md (fms<mode>4, fnma<mode>, fnms<mode>4):
      	New expanders.
      	* doc/md.texi (fms<mode>4, fnma<mode>, fnms<mode>4): Document new
      	named patterns.
      	* genopinit.c (optabs): Initialize fms_optab, fnma_optab and fnms_optab.
      	* optabs.h (enum optab_index): Add OTI_fms, OTI_fnma and OTI_fnms.
      	(fms_optab, fnma_optab, fnms_optab): New defines.
      	* gimplify.c (gimplify_expr): Handle binary truth expressions
      	explicitly.  Handle FMA_EXPR.
      	* tree-vect-stmts.c (vectorizable_operation): Handle ternary
      	operations.
      
      	* gcc.target/i386/fma4-vector-2.c: New testcase.
      
      Co-Authored-By: Richard Henderson <rth@redhat.com>
      
      From-SVN: r166304
      Richard Guenther committed
  23. 14 Oct, 2010 1 commit
    • re PR c++/44561 (using nullptr_t with -flto/-fwhopr causes ICE: tree code… · 1e85e720
      re PR c++/44561 (using nullptr_t with -flto/-fwhopr causes ICE: tree code 'lang_type' is not supported in gimple streams)
      
      2010-10-14  Richard Guenther  <rguenther@suse.de>
      
      	PR lto/44561
      	* tree.def (NULLPTR_TYPE): New tree code.
      	* dbxout.c (dbxout_type): Handle NULLPTR_TYPE.
      	* dwarf2out.c (is_base_type): Likewise.
      	(gen_type_die_with_usage): Likewise.
      	* sdbout.c (plain_type_1): Likewise.
      	* tree.c (build_int_cst_wide): Likewise.
      	* gimple.c (gimple_types_compatible_p_1): NULLPTR_TYPE types
      	are equal.
      
      	cp/
      	* cp-tree.h (NULLPTR_TYPE_P): Adjust.
      	* decl.c (cxx_init_decl_processing): Build a NULLPTR_TYPE node,
      	use build_int_cst.
      	* error.c (dump_type): Handle NULLPTR_TYPE.
      	(dump_type_prefix): Likewise.
      	(dump_type_suffix): Likewise.
      	* mangle.c (write_type): Likewise.
      	* name-lookup.c (arg_assoc_type): Likewise.
      	* rtti.c (typeinfo_in_lib_p): Likewise.
      	* pt.c (tsubst): Likewise.
      
      	* g++.dg/lto/20101010-3_0.C: New testcase.
      	* g++.dg/lto/20101010-4_0.C: Likewise.
      
      From-SVN: r165462
      Richard Guenther committed
  24. 06 Sep, 2010 1 commit
    • tree.def (MISALIGNED_INDIRECT_REF): Remove. · be1ac4ec
      2010-09-06  Richard Guenther  <rguenther@suse.de>
      
      	* tree.def (MISALIGNED_INDIRECT_REF): Remove.
      	* tree.h (INDIRECT_REF_P): Only check for INDIRECT_REF.
      	(build_aligned_type): Declare.
      	* tree.c (check_qualified_type): Also compare TYPE_ALIGN.
      	(check_aligned_type): New function.
      	(build_aligned_type): Likewise.
      	* expr.c (expand_assignment): Handle misaligned stores via
      	TARGET_MEM_REF and MEM_REF using movmisalign_optab.
      	(expand_expr_real_1): Likewise.
      	(safe_from_p): Remove MISALIGNED_INDIRECT_REF handling.
      	* tree-vect-stmts.c (vectorizable_store): Do not build
      	MISALIGNED_INDIRECT_REF but initialize alignment information.
      	(vectorizable_load): Likewise.
      	* builtins.c (get_object_alignment): Remove MISALIGNED_INDIRECT_REF
      	handling.
      	* cfgexpand.c (expand_debug_expr): Likewise.
      	* dwarf2out.c (loc_list_from_tree): Likewise.
      	* fold-const.c (maybe_lvalue_p): Likewise.
      	(operand_equal_p): Likewise.
      	(build_fold_addr_expr_with_type_loc): Likewise.
      	* gimplify.c (gimplify_addr_expr): Likewise.
      	(gimplify_expr): Likewise.
      	* tree-cfg.c (verify_types_in_gimple_min_lval): Likewise.
      	(verify_gimple_assign_single): Likewise.
      	* tree-dump.c (dequeue_and_dump): Likewise.
      	(tree_could_trap_p): Likewise.
      	* tree-predcom.c (ref_at_iteration): Likewise.
      	* tree-pretty-print.c (dump_generic_node): Likewise.
      	(op_code_prio): Likewise.
      	(op_symbol_code): Likewise.
      	* tree-ssa-ccp.c (get_value_from_alignment): Likewise.
      	* tree-ssa-loop-im.c (for_each_index): Likewise.
      	(gen_lsm_tmp_name): Likewise.
      	* tree-ssa-loop-ivopts.c (idx_find_step): Likewise.
      	(find_interesting_uses_address): Likewise.
      	* tree-ssa-loop-prefetch.c (idx_analyze_ref): Likewise.
      	* tree-ssa-operands.c (get_expr_operands): Likewise.
      	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Likewise.
      	* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Likewise.
      	(ao_ref_init_from_vn_reference): Likewise.
      	* tree.c (staticp): Likewise.
      	(build1_stat): Likewise.
      	(reference_alias_ptr_type): Likewise.
      	* emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise.
      	* config/rs6000/rs6000.c (rs6000_check_sdmode): Remove
      	MISALIGNED_INDIRECT_REF handling.
      
      From-SVN: r163915
      Richard Guenther committed
  25. 03 Sep, 2010 1 commit
    • tree.def (TARGET_MEM_REF): Merge TMR_SYMBOL and TMR_BASE. · 4d948885
      2010-09-03  Richard Guenther  <rguenther@suse.de>
      
      	* tree.def (TARGET_MEM_REF): Merge TMR_SYMBOL and TMR_BASE.
      	Move TMR_OFFSET to second operand.  Add TMR_INDEX2.
      	* tree.h (TMR_SYMBOL): Remove.
      	(TMR_BASE, TMR_OFFSET): Adjust.
      	(TMR_INDEX2): New.
      	* alias.c (ao_ref_from_mem): Use TMR_BASE.
      	* builtins.c (get_object_alignment): Merge TMR_BASE and
      	TMR_SYMBOL handling.
      	* cfgexpand.c (expand_debug_expr): Use TMR_BASE.
      	* gimple.c (get_base_address): Merge MEM_REF and TARGET_MEM_REF
      	handling.  Also allow TARGET_MEM_REF as base address.
      	(walk_stmt_load_store_addr_ops): TMR_BASE is always non-NULL.
      	* gimplify.c (gimplify_expr): Gimplify TMR_BASE like MEM_REF
      	base.  Gimplify TMR_INDEX2.
      	* tree-cfg.c (verify_types_in_gimple_reference): Adjust.
      	* tree-dfa.c (get_ref_base_and_extent): Likewise.
      	(get_addr_base_and_unit_offset): Likewise.
      	* tree-eh.c (tree_could_trap_p): Likewise.
      	* tree-pretty-print.c (dump_generic_node): Likewise.
      	* tree-ssa-address.c (tree_mem_ref_addr): Simplify.  Handle
      	TMR_INDEX2.
      	(create_mem_ref_raw): Merge symbol and base.  Move 2ndary
      	base to index2.
      	(get_address_description): Reconstruct addres description
      	from merged TMR_BASE and TMR_INDEX2.
      	(maybe_fold_tmr): Fold propagated addresses.
      	* tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Merge
      	MEM_REF and TARGET_MEM_REF paths.
      	(indirect_refs_may_alias_p): Likewise.
      	* tree-ssa-live.c (mark_all_vars_used_1): Handle TMR_INDEX2
      	instead of TMR_SYMBOL.
      	* tree-ssa-operands.c (get_tmr_operands): Simplify.
      	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Adjust
      	according to changes ...
      	* tree-ssa-sccvn.c (copy_reference_ops_from_ref): ... here.
      	Split TARGET_MEM_REF into two fields plus the base.
      	* tree.c (mem_ref_offset): Simplify.
      	* tree-ssa-loop-im.c (for_each_index): Handle TMR_INDEX2.
      	* tree-ssa-loop-ivopts.c (find_interesting_uses_address): Likewise.
      	Strip NOPs when folding MEM_REF addresses.
      	* tree-ssa-sink.c (is_hidden_global_store): Handle TARGET_MEM_REF.
      	* gimple-fold.c (maybe_fold_reference): Fold TARGET_MEM_REF here ...
      	(fold_gimple_assign): ... not here.
      
      From-SVN: r163802
      Richard Guenther committed
  26. 01 Sep, 2010 1 commit
    • alias.c (ao_ref_from_mem): Adjust. · 23a534a1
      2010-09-01  Richard Guenther  <rguenther@suse.de>
      
      	* alias.c (ao_ref_from_mem): Adjust.
      	* builtins.c (get_object_alignment): Likewise.
      	* cfgexpand.c (expand_debug_expr): Likewise.
      	* gimple.c (get_base_address): Likewise.
      	* tree-dfa.c (get_ref_base_and_extent): Likewise.
      	(get_addr_base_and_unit_offset): Likewise.  Fix for
      	both TMR_SYMBOL and TMR_BASE being set.
      	* tree-eh.c (tree_could_trap_p): Likewise.
      	* gimplify.c (gimplify_expr): Do not attempt to gimplify
      	TMR_SYMBOL.  Always gimplify TMR_BASE.
      	* tree-cfg.c (verify_types_in_gimple_reference): Verify
      	TMR_BASE if there is a TMR_SYMBOL.
      	* tree-pretty-print.c (dump_generic_node): Adjust.
      	* tree-ssa-address.c (addr_for_mem_ref): Likewise.
      	(tree_mem_ref_addr): Likewise.
      	(create_mem_ref_raw): Likewise.
      	(move_fixed_address_to_symbol): Likewise.
      	(create_mem_ref): Likewise.
      	(dump_mem_address): Likewise.
      	* tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Adjust.
      	Fix for both TMR_SYMBOL and TMR_BASE being set.
      	(indirect_refs_may_alias_p): Likewise.
      	* tree-ssa-operands.c (get_tmr_operands): Adjust.
      	* tree.def (TARGET_MEM_REF): Adjust documentation.
      
      From-SVN: r163733
      Richard Guenther committed
  27. 16 Aug, 2010 1 commit
    • tree-cfg.c (verify_types_in_gimple_reference): Verify TARGET_MEM_REF a bit. · 4b228e61
      2010-08-16  Richard Guenther  <rguenther@suse.de>
      
      	* tree-cfg.c (verify_types_in_gimple_reference): Verify
      	TARGET_MEM_REF a bit.
      	* tree-ssa-address.c (addr_for_mem_ref): Adjust.
      	(create_mem_ref_raw): Always create TMR_OFFSET, store the
      	alias pointer type via it.
      	(copy_mem_ref_info): Adjust.
      	(maybe_fold_tmr): Likewise.
      	* tree.c (mem_ref_offset): Also handle TARGET_MEM_REF.
      	(reference_alias_ptr_type): Likewise.
      	* tree.def (TARGET_MEM_REF): Remove TMR_ORIGINAL operand,
      	adjust documentation of TMR_OFFSET operand.
      	* alias.c (get_alias_set): Do not look at TMR_ORIGINAL but
      	use the alias pointer type.
      	* expr.c (expand_expr_real_1): Do not use TMR_ORIGINAL to
      	initialize mem attrs but the TMR itself.
      	* tree-eh.c (tree_could_trap_p): Handle TARGET_MEM_REF
      	similar to MEM_REF.
      	* tree-pretty-print.c (dump_generic_node): Do not dump TMR_ORIGINAL.
      	* tree-ssa-loop-ivopts.c (idx_remove_ssa_names): Remove.
      	(unshare_and_remove_ssa_names): Likewise.
      	(copy_ref_info): Adjust.
      	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Simplify
      	TARGET_MEM_REF case.
      	* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Do not look
      	at TMR_ORIGINAL.
      	* tree.h (TMR_ORIGINAL): Remove.
      	* gimple.c (get_base_address): For TARGET_MEM_REF with a
      	symbol return that.
      	* tree-dfa.c (get_ref_base_and_extent): Handle TARGET_MEM_REF
      	with a symbol.
      	(get_addr_base_and_unit_offset): Likewise.
      	* tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Handle
      	TARGET_MEM_REFs.
      	(indirect_ref_may_alias_decl_p): Likewise.
      	(refs_may_alias_p_1): Do not bail out for TARGET_MEM_REFs.
      
      From-SVN: r163278
      Richard Guenther committed
  28. 05 Jul, 2010 1 commit
    • tree-ssa-loop-im.c (for_each_index): Do not handle ALIGN_INDIRECT_REF. · 75421dcd
      2010-07-05  Richard Guenther  <rguenther@suse.de>
      
      	* tree-ssa-loop-im.c (for_each_index): Do not handle
      	ALIGN_INDIRECT_REF.
      	(gen_lsm_tmp_name): Likewise.
      	* tree-dump.c (dequeue_and_dump): Likewise.
      	* tree-pretty-print.c (dump_generic_node): Likewise.
      	(op_code_prio): Likewise.
      	(op_symbol_code): Likewise.
      	* tree.c (staticp): Likewise.
      	(build1_stat): Likewise.
      	* tree.h (INDIRECT_REF_P): Likewise.
      	* fold-const.c (maybe_lvalue_p): Likewise.
      	(operand_equal_p): Likewise.
      	* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Likewise.
      	(ao_ref_init_from_vn_reference): Likewise.
      	* tree-ssa-loop-ivopts.c (idx_find_step): Likewise.
      	(find_interesting_uses_address): Likewise.
      	* dwarf2out.c (loc_list_from_tree): Likewise.
      	* gimplify.c (gimplify_expr): Likewise.
      	* tree-eh.c (tree_could_trap_p): Likewise.
      	* emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise.
      	* cfgexpand.c (expand_debug_expr): Likewise.
      	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Likewise.
      	* tree-ssa-loop-prefetch.c (idx_analyze_ref): Likewise.
      	* tree-cfg.c (verify_types_in_gimple_min_lval): Likewise.
      	* config/rs6000/rs6000 (rs6000_check_sdmode): Likewise.
      	* tree-ssa-operands.c (get_expr_operands): Likewise.
      	* expr.c (safe_from_p): Likewise.
      	(expand_expr_real_1): Likewise.  TER BIT_AND_EXPRs into MEM_REFs.
      	* tree-vect-data-refs.c (vect_setup_realignment): Build
      	BIT_AND_EXPR and MEM_REF instead of ALIGN_INDIRECT_REF.
      	* tree-vect-stmts.c (vectorizable_load): Likewise.
      	* tree.def (ALIGN_INDIRECT_REF): Remove.
      
      From-SVN: r161830
      Richard Guenther committed
  29. 01 Jul, 2010 1 commit
    • re PR middle-end/42834 (memcpy folding overeager) · 70f34814
      2010-07-01  Richard Guenther  <rguenther@suse.de>
      
      	PR middle-end/42834
      	PR middle-end/44468
      	* doc/gimple.texi (is_gimple_mem_ref_addr): Document.
      	* doc/generic.texi (References to storage): Document MEM_REF.
      	* tree-pretty-print.c (dump_generic_node): Handle MEM_REF.
      	(print_call_name): Likewise.
      	* tree.c (recompute_tree_invariant_for_addr_expr): Handle MEM_REF.
      	(build_simple_mem_ref_loc): New function.
      	(mem_ref_offset): Likewise.
      	* tree.h (build_simple_mem_ref_loc): Declare.
      	(build_simple_mem_ref): Define.
      	(mem_ref_offset): Declare.
      	* fold-const.c: Include tree-flow.h.
      	(operand_equal_p): Handle MEM_REF.
      	(build_fold_addr_expr_with_type_loc): Likewise.
      	(fold_comparison): Likewise.
      	(fold_unary_loc): Fold
      	VIEW_CONVERT_EXPR <T1, MEM_REF <T2, ...>> to MEM_REF <T1, ...>.
      	(fold_binary_loc): Fold MEM[&MEM[p, CST1], CST2] to MEM[p, CST1 + CST2],
      	fold MEM[&a.b, CST2] to MEM[&a, offsetof (a, b) + CST2].
      	* tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Handle MEM_REF.
      	(ptr_deref_may_alias_ref_p_1): Likewise.
      	(ao_ref_base_alias_set): Properly differentiate base object for
      	offset and TBAA.
      	(ao_ref_init_from_ptr_and_size): Use MEM_REF.
      	(indirect_ref_may_alias_decl_p): Handle MEM_REFs properly.
      	(indirect_refs_may_alias_p): Likewise.
      	(refs_may_alias_p_1): Likewise.  Remove pointer SSA name def
      	chasing code.
      	(ref_maybe_used_by_call_p_1): Handle MEM_REF.
      	(call_may_clobber_ref_p_1): Likewise.
      	* dwarf2out.c (loc_list_from_tree): Handle MEM_REF.
      	* expr.c (expand_assignment): Handle MEM_REF.
      	(store_expr): Handle MEM_REFs from STRING_CSTs.
      	(store_field): If expanding a MEM_REF of a non-addressable
      	decl use bitfield operations.
      	(get_inner_reference): Handle MEM_REF.
      	(expand_expr_addr_expr_1): Likewise.
      	(expand_expr_real_1): Likewise.
      	* tree-eh.c (tree_could_trap_p): Handle MEM_REF.
      	* alias.c (ao_ref_from_mem): Handle MEM_REF.
      	(get_alias_set): Likewise.  Properly handle VIEW_CONVERT_EXPRs.
      	* tree-data-ref.c (dr_analyze_innermost): Handle MEM_REF.
      	(dr_analyze_indices): Likewise.
      	(dr_analyze_alias): Likewise.
      	(object_address_invariant_in_loop_p): Likewise.
      	* gimplify.c (mark_addressable): Handle MEM_REF.
      	(gimplify_cond_expr): Build MEM_REFs.
      	(gimplify_modify_expr_to_memcpy): Likewise.
      	(gimplify_init_ctor_preeval_1): Handle MEM_REF.
      	(gimple_fold_indirect_ref): Adjust.
      	(gimplify_expr): Handle MEM_REF.  Gimplify INDIRECT_REF to MEM_REF.
      	* tree.def (MEM_REF): New tree code.
      	* tree-dfa.c: Include toplev.h.
      	(get_ref_base_and_extent): Handle MEM_REF.
      	(get_addr_base_and_unit_offset): New function.
      	* emit-rtl.c (set_mem_attributes_minus_bitpos): Handle MEM_REF.
      	* gimple-fold.c (may_propagate_address_into_dereference): Handle
      	MEM_REF.
      	(maybe_fold_offset_to_array_ref): Allow possibly out-of bounds
      	accesses if the array has just one dimension.  Remove always true
      	parameter.  Do not require type compatibility here.
      	(maybe_fold_offset_to_component_ref): Remove.
      	(maybe_fold_stmt_indirect): Remove.
      	(maybe_fold_reference): Remove INDIRECT_REF handling.
      	Fold back to non-MEM_REF.
      	(maybe_fold_offset_to_address): Simplify.  Deal with type
      	mismatches here.
      	(maybe_fold_reference): Likewise.
      	(maybe_fold_stmt_addition): Likewise.  Also handle
      	&ARRAY + I in addition to &ARRAY[0] + I.
      	(fold_gimple_assign): Handle ADDR_EXPR of MEM_REFs.
      	(gimple_get_relevant_ref_binfo): Handle MEM_REF.
      	* cfgexpand.c (expand_debug_expr): Handle MEM_REF.
      	* tree-ssa.c (useless_type_conversion_p): Make most pointer
      	conversions useless.
      	(warn_uninitialized_var): Handle MEM_REF.
      	(maybe_rewrite_mem_ref_base): New function.
      	(execute_update_addresses_taken): Implement re-writing of MEM_REFs
      	to SSA form.
      	* tree-inline.c (remap_gimple_op_r): Handle MEM_REF, remove
      	INDIRECT_REF handling.
      	(copy_tree_body_r): Handle MEM_REF.
      	* gimple.c (is_gimple_addressable): Adjust.
      	(is_gimple_address): Likewise.
      	(is_gimple_invariant_address): ADDR_EXPRs of MEM_REFs with
      	invariant base are invariant.
      	(is_gimple_min_lval): Adjust.
      	(is_gimple_mem_ref_addr): New function.
      	(get_base_address): Handle MEM_REF.
      	(count_ptr_derefs): Likewise.
      	(get_base_loadstore): Likewise.
      	* gimple.h (is_gimple_mem_ref_addr): Declare.
      	(gimple_call_fndecl): Handle invariant MEM_REF addresses.
      	* tree-cfg.c (verify_address): New function, split out from ...
      	(verify_expr): ... here.  Use for verifying ADDR_EXPRs and
      	the address operand of MEM_REFs.  Verify MEM_REFs.  Reject
      	INDIRECT_REFs.
      	(verify_types_in_gimple_min_lval): Handle MEM_REF.  Disallow
      	INDIRECT_REF.  Allow conversions.
      	(verify_types_in_gimple_reference): Verify VIEW_CONVERT_EXPR of
      	a register does not change its size.
      	(verify_types_in_gimple_reference): Verify MEM_REF.
      	(verify_gimple_assign_single): Disallow INDIRECT_REF.
      	Handle MEM_REF.
      	* tree-ssa-operands.c (opf_non_addressable, opf_not_non_addressable):
      	New.
      	(mark_address_taken): Handle MEM_REF.
      	(get_indirect_ref_operands): Pass through opf_not_non_addressable.
      	(get_asm_expr_operands): Pass opf_not_non_addressable.
      	(get_expr_operands): Handle opf_[not_]non_addressable.
      	Handle MEM_REF.  Remove INDIRECT_REF handling.
      	* tree-vrp.c: (check_array_ref): Handle MEM_REF.
      	(search_for_addr_array): Likewise.
      	(check_array_bounds): Likewise.
      	(vrp_stmt_computes_nonzero): Adjust for MEM_REF.
      	* tree-ssa-loop-im.c (for_each_index): Handle MEM_REF.
      	(ref_always_accessed_p): Likewise.
      	(gen_lsm_tmp_name): Likewise.  Handle ADDR_EXPR.
      	* tree-complex.c (extract_component): Do not handle INDIRECT_REF.
      	Handle MEM_REF.
      	* cgraphbuild.c (mark_load): Properly check for NULL result
      	from get_base_address.
      	(mark_store): Likewise.
      	* tree-ssa-loop-niter.c (array_at_struct_end_p): Handle MEM_REF.
      	* tree-loop-distribution.c (generate_builtin): Exchange INDIRECT_REF
      	handling for MEM_REF.
      	* tree-scalar-evolution.c (follow_ssa_edge_expr): Handle
      	&MEM[ptr + CST] similar to POINTER_PLUS_EXPR.
      	* builtins.c (stabilize_va_list_loc): Use the function ABI
      	valist type if we couldn't canonicalize the argument type.
      	Always dereference with the canonical va-list type.
      	(maybe_emit_free_warning): Handle MEM_REF.
      	(fold_builtin_memory_op): Simplify and handle MEM_REFs in folding
      	memmove to memcpy.
      	* builtins.c (fold_builtin_memory_op): Use ref-all types
      	for all memcpy foldings.
      	* omp-low.c (build_receiver_ref): Adjust for MEM_REF.
      	(build_outer_var_ref): Likewise.
      	(scan_omp_1_op): Likewise.
      	(lower_rec_input_clauses): Likewise.
      	(lower_lastprivate_clauses): Likewise.
      	(lower_reduction_clauses): Likewise.
      	(lower_copyprivate_clauses): Likewise.
      	(expand_omp_atomic_pipeline): Likewise.
      	(expand_omp_atomic_mutex): Likewise.
      	(create_task_copyfn): Likewise.
      	* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle MEM_REF.
      	Remove old union trick.  Initialize constant offsets.
      	(ao_ref_init_from_vn_reference): Likewise.  Do not handle
      	INDIRECT_REF.  Init base_alias_set properly.
      	(vn_reference_lookup_3): Replace INDIRECT_REF handling with
      	MEM_REF.
      	(vn_reference_fold_indirect): Adjust for MEM_REFs.
      	(valueize_refs): Fold MEM_REFs.  Re-evaluate constant offset
      	for ARRAY_REFs.
      	(may_insert): Remove.
      	(visit_reference_op_load): Do not test may_insert.
      	(run_scc_vn): Remove parameter, do not fiddle with may_insert.
      	* tree-ssa-sccvn.h (struct vn_reference_op_struct): Add
      	a field to store the constant offset this op applies.
      	(run_scc_vn): Adjust prototype.
      	* cgraphunit.c (thunk_adjust): Adjust for MEM_REF.
      	* tree-ssa-ccp.c (ccp_fold): Replace INDIRECT_REF folding with
      	MEM_REF.  Propagate &foo + CST as &MEM[&foo, CST].  Do not
      	bother about volatile qualifiers on pointers.
      	(fold_const_aggregate_ref): Handle MEM_REF, do not handle INDIRECT_REF.
      	* tree-ssa-loop-ivopts.c
      	* tree-ssa-loop-ivopts.c (determine_base_object): Adjust
      	for MEM_REF.
      	(strip_offset_1): Likewise.
      	(find_interesting_uses_address): Replace INDIRECT_REF handling with
      	MEM_REF handling.
      	(get_computation_cost_at): Likewise.
      	* ipa-pure-const.c (check_op): Handle MEM_REF.
      	* tree-stdarg.c (check_all_va_list_escapes): Adjust for MEM_REF.
      	* tree-ssa-sink.c (is_hidden_global_store): Handle MEM_REF
      	and constants.
      	* ipa-inline.c (likely_eliminated_by_inlining_p): Handle MEM_REF.
      	* tree-parloops.c (take_address_of): Adjust for MEM_REF.
      	(eliminate_local_variables_1): Likewise.
      	(create_call_for_reduction_1): Likewise.
      	(create_loads_for_reductions): Likewise.
      	(create_loads_and_stores_for_name): Likewise.
      	* matrix-reorg.c (may_flatten_matrices_1): Sanitize.
      	(ssa_accessed_in_tree): Handle MEM_REF.
      	(ssa_accessed_in_assign_rhs): Likewise.
      	(update_type_size): Likewise.
      	(analyze_accesses_for_call_stmt): Likewise.
      	(analyze_accesses_for_assign_stmt): Likewise.
      	(transform_access_sites): Likewise.
      	(transform_allocation_sites): Likewise.
      	* tree-affine.c (tree_to_aff_combination): Handle MEM_REF.
      	* tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Do
      	not handle INDIRECT_REF.
      	* tree-ssa-phiopt.c (add_or_mark_expr): Handle MEM_REF.
      	(cond_store_replacement): Likewise.
      	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Handle
      	MEM_REF, no not handle INDIRECT_REFs.
      	(insert_into_preds_of_block): Properly initialize avail.
      	(phi_translate_1): Fold MEM_REFs.  Re-evaluate constant offset
      	for ARRAY_REFs.  Properly handle reference lookups that
      	require a bit re-interpretation.
      	(can_PRE_operation): Do not handle INDIRECT_REF.  Handle MEM_REF.
      	* tree-sra.c
      	* tree-sra.c (build_access_from_expr_1): Handle MEM_REF.
      	(build_ref_for_offset_1): Remove.
      	(build_ref_for_offset): Build MEM_REFs.
      	(gate_intra_sra): Disable for now.
      	(sra_ipa_modify_expr): Handle MEM_REF.
      	(ipa_early_sra_gate): Disable for now.
      	* tree-sra.c (create_access): Swap INDIRECT_REF handling for
      	MEM_REF handling.
      	(disqualify_base_of_expr): Likewise.
      	(ptr_parm_has_direct_uses): Swap INDIRECT_REF handling for
      	MEM_REF handling.
      	(sra_ipa_modify_expr): Remove INDIRECT_REF handling.
      	Use mem_ref_offset.  Remove bogus folding.
      	(build_access_from_expr_1): Properly handle MEM_REF for
      	non IPA-SRA.
      	(make_fancy_name_1): Add support for MEM_REF.
      	* tree-predcom.c (ref_at_iteration): Handle MEM_REFs.
      	* tree-mudflap.c (mf_xform_derefs_1): Adjust for MEM_REF.
      	* ipa-prop.c (compute_complex_assign_jump_func): Handle MEM_REF.
      	(compute_complex_ancestor_jump_func): Likewise.
      	(ipa_analyze_virtual_call_uses): Likewise.
      	* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Replace
      	INDIRECT_REF folding with more generalized MEM_REF folding.
      	(tree_ssa_forward_propagate_single_use_vars): Adjust accordingly.
      	(forward_propagate_addr_into_variable_array_index): Also handle
      	&ARRAY + I in addition to &ARRAY[0] + I.
      	* tree-ssa-dce.c (ref_may_be_aliased): Handle MEM_REF.
      	* tree-ssa-ter.c (find_replaceable_in_bb): Avoid TER if that
      	creates assignments with overlap.
      	* tree-nested.c (get_static_chain): Adjust for MEM_REF.
      	(get_frame_field): Likewise.
      	(get_nonlocal_debug_decl): Likewise.
      	(convert_nonlocal_reference_op): Likewise.
      	(struct nesting_info): Add mem_refs pointer-set.
      	(create_nesting_tree): Allocate it.
      	(convert_local_reference_op): Insert to be folded mem-refs.
      	(fold_mem_refs): New function.
      	(finalize_nesting_tree_1): Perform defered folding of mem-refs 
      	(free_nesting_tree): Free the pointer-set.
      	* tree-vect-stmts.c (vectorizable_store): Adjust for MEM_REF.
      	(vectorizable_load): Likewise.
      	* tree-ssa-phiprop.c (phiprop_insert_phi): Adjust for MEM_REF.
      	(propagate_with_phi): Likewise.
      	* tree-object-size.c (addr_object_size): Handle MEM_REFs
      	instead of INDIRECT_REFs.
      	(compute_object_offset): Handle MEM_REF.
      	(plus_stmt_object_size): Handle MEM_REF.
      	(collect_object_sizes_for): Dispatch to plus_stmt_object_size
      	for &MEM_REF.
      	* tree-flow.h (get_addr_base_and_unit_offset): Declare.
      	(symbol_marked_for_renaming): Likewise.
      	* Makefile.in (tree-dfa.o): Add $(TOPLEV_H).
      	(fold-const.o): Add $(TREE_FLOW_H).
      	* tree-ssa-structalias.c (get_constraint_for_1): Handle MEM_REF.
      	(find_func_clobbers): Likewise.
      	* ipa-struct-reorg.c (decompose_indirect_ref_acc): Handle MEM_REF.
      	(decompose_access): Likewise.
      	(replace_field_acc): Likewise.
      	(replace_field_access_stmt): Likewise.
      	(insert_new_var_in_stmt): Likewise.
      	(get_stmt_accesses): Likewise.
      	(reorg_structs_drive): Disable.
      	* config/i386/i386.c (ix86_va_start): Adjust for MEM_REF.
      	(ix86_canonical_va_list_type): Likewise.
      
      	cp/
      	* cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
      	predicate we are looking for, allow non-gimplified
      	INDIRECT_REFs.
      
      	testsuite/
      	* gcc.c-torture/execute/20100316-1.c: New testcase.
      	* gcc.c-torture/execute/pr44468.c: Likewise.
      	* gcc.c-torture/compile/20100609-1.c: Likewise.
      	* gcc.dg/volatile2.c: Adjust.
      	* gcc.dg/plugin/selfassign.c: Likewise.
      	* gcc.dg/pr36902.c: Likewise.
      	* gcc.dg/tree-ssa/foldaddr-2.c: Remove.
      	* gcc.dg/tree-ssa/foldaddr-3.c: Likewise.
      	* gcc.dg/tree-ssa/forwprop-8.c: Adjust.
      	* gcc.dg/tree-ssa/pr17141-1.c: Likewise.
      	* gcc.dg/tree-ssa/ssa-fre-13.c: Likewise.
      	* gcc.dg/tree-ssa/ssa-fre-14.c: Likewise.
      	* gcc.dg/tree-ssa/ssa-ccp-21.c: Likewise.
      	* gcc.dg/tree-ssa/pta-ptrarith-1.c: Likewise.
      	* gcc.dg/tree-ssa/20030807-7.c: Likewise.
      	* gcc.dg/tree-ssa/forwprop-10.c: Likewise.
      	* gcc.dg/tree-ssa/ssa-fre-1.c: Likewise.
      	* gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise.
      	* gcc.dg/tree-ssa/ssa-ccp-23.c: Likewise.
      	* gcc.dg/tree-ssa/forwprop-1.c: Likewise.
      	* gcc.dg/tree-ssa/forwprop-2.c: Likewise.
      	* gcc.dg/tree-ssa/struct-aliasing-1.c: Likewise.
      	* gcc.dg/tree-ssa/ssa-ccp-25.c: Likewise.
      	* gcc.dg/tree-ssa/ssa-pre-26.c: Likewise.
      	* gcc.dg/tree-ssa/struct-aliasing-2.c: Likewise.
      	* gcc.dg/tree-ssa/ssa-ccp-26.c: Likewise.
      	* gcc.dg/tree-ssa/ssa-sccvn-4.c: Likewise.
      	* gcc.dg/tree-ssa/ssa-pre-7.c: Likewise.
      	* gcc.dg/tree-ssa/forwprop-5.c: Likewise.
      	* gcc.dg/struct/w_prof_two_strs.c: XFAIL.
      	* gcc.dg/struct/wo_prof_escape_arg_to_local.c: Likewise.
      	* gcc.dg/struct/wo_prof_global_var.c: Likewise.
      	* gcc.dg/struct/wo_prof_malloc_size_var.c: Likewise.
      	* gcc.dg/struct/w_prof_local_array.c: Likewise.
      	* gcc.dg/struct/w_prof_single_str_global.c: Likewise.
      	* gcc.dg/struct/wo_prof_escape_str_init.c: Likewise.
      	* gcc.dg/struct/wo_prof_array_through_pointer.c: Likewise.
      	* gcc.dg/struct/w_prof_global_array.c: Likewise.
      	* gcc.dg/struct/wo_prof_array_field.c: Likewise.
      	* gcc.dg/struct/wo_prof_single_str_local.c: Likewise.
      	* gcc.dg/struct/w_prof_local_var.c: Likewise.
      	* gcc.dg/struct/wo_prof_two_strs.c: Likewise.
      	* gcc.dg/struct/wo_prof_empty_str.c: Likewise.
      	* gcc.dg/struct/wo_prof_local_array.c: Likewise.
      	* gcc.dg/struct/w_prof_global_var.c: Likewise.
      	* gcc.dg/struct/wo_prof_single_str_global.c: Likewise.
      	* gcc.dg/struct/wo_prof_escape_substr_value.c: Likewise.
      	* gcc.dg/struct/wo_prof_global_array.c: Likewise.
      	* gcc.dg/struct/wo_prof_escape_return.c: Likewise.
      	* gcc.dg/struct/wo_prof_escape_substr_array.c: Likewise.
      	* gcc.dg/struct/wo_prof_double_malloc.c: Likewise.
      	* gcc.dg/struct/w_ratio_cold_str.c: Likewise.
      	* gcc.dg/struct/wo_prof_escape_substr_pointer.c: Likewise.
      	* gcc.dg/struct/wo_prof_local_var.c: Likewise.
      	* gcc.dg/tree-prof/stringop-1.c: Adjust.
      	* g++.dg/tree-ssa/pr31146.C: Likewise.
      	* g++.dg/tree-ssa/copyprop-1.C: Likewise.
      	* g++.dg/tree-ssa/pr33604.C: Likewise.
      	* g++.dg/plugin/selfassign.c: Likewise.
      	* gfortran.dg/array_memcpy_3.f90: Likewise.
      	* gfortran.dg/array_memcpy_4.f90: Likewise.
      	* c-c++-common/torture/pr42834.c: New testcase.
      
      From-SVN: r161655
      Richard Guenther committed
  30. 25 Jun, 2010 1 commit
    • With large parts from Jim Wilson: · 0354c0c7
      	PR target/43902
      	* tree-pretty-print.c (dump_generic_node, op_code_prio): Add
      	WIDEN_MULT_PLUS_EXPR and WIDEN_MULT_MINUS_EXPR.
      	* optabs.c (optab_for_tree_code): Likewise.
      	(expand_widen_pattern_expr): Likewise.
      	* tree-ssa-math-opts.c (convert_mult_to_widen): New function, broken
      	out of execute_optimize_widening_mul.
      	(convert_plusminus_to_widen): New function.
      	(execute_optimize_widening_mul): Use the two new functions.
      	* expr.c (expand_expr_real_2): Add support for GIMPLE_TERNARY_RHS.
      	Remove code to generate widening multiply-accumulate.  Add support
      	for WIDEN_MULT_PLUS_EXPR and WIDEN_MULT_MINUS_EXPR.
      	* gimple-pretty-print.c (dump_ternary_rhs): New function.
      	(dump_gimple_assign): Call it when appropriate.
      	* tree.def (WIDEN_MULT_PLUS_EXPR, WIDEN_MULT_MINUS_EXPR): New codes.
      	* cfgexpand.c (gimple_assign_rhs_to_tree): Likewise.
      	(expand_gimple_stmt_1): Likewise.
      	(expand_debug_expr): Support WIDEN_MULT_PLUS_EXPR and
      	WIDEN_MULT_MINUS_EXPR.
      	* tree-ssa-operands.c (get_expr_operands): Likewise.
      	* tree-inline.c (estimate_operator_cost): Likewise.
      	* gimple.c (extract_ops_from_tree_1): Renamed from
      	extract_ops_from_tree.  Add new arg for a third operand; fill it.
      	(gimple_build_assign_stat): Support operations with three operands.
      	(gimple_build_assign_with_ops_stat): Likewise.
      	(gimple_assign_set_rhs_from_tree): Likewise.
      	(gimple_assign_set_rhs_with_ops_1): Renamed from
      	gimple_assign_set_rhs_with_ops.  Add new arg for a third operand.
      	(get_gimple_rhs_num_ops): Support GIMPLE_TERNARY_RHS.
      	(get_gimple_rhs_num_ops): Handle WIDEN_MULT_PLUS_EXPR and
      	WIDEN_MULT_MINUS_EXPR.
      	* gimple.h (enum gimple_rhs_class): Add GIMPLE_TERNARY_RHS.
      	(extract_ops_from_tree_1): Adjust declaration.
      	(gimple_assign_set_rhs_with_ops_1): Likewise.
      	(gimple_build_assign_with_ops): Pass NULL for last operand.
      	(gimple_build_assign_with_ops3): New macro.
      	(gimple_assign_rhs3, gimple_assign_rhs3_ptr, gimple_assign_set_rhs3,
      	gimple_assign_set_rhs_with_ops, extract_ops_from_tree): New inline
      	functions.
      	* tree-cfg.c (verify_gimple_assign_ternary): New static function.
      	(verify_gimple_assign): Call it.
      	* doc/gimple.texi (Manipulating operands): Document GIMPLE_TERNARY_RHS.
      	(Tuple specific accessors, subsection GIMPLE_ASSIGN): Document new
      	functions for dealing with three-operand statements.
      	* tree.c (commutative_ternary_tree_code): New function.
      	* tree.h (commutative_ternary_tree_code): Declare it.
      	* tree-vrp.c (gimple_assign_nonnegative_warnv_p): Return false for ternary
      	statements.
      	(gimple_assign_nonzero_warnv_p): Likewise.
      	* tree-ssa-sccvn.c (stmt_has_constants): Handle GIMPLE_TERNARY_RHS.
      	* tree-ssa-ccp.c (get_rhs_assign_op_for_ccp): New static function.
      	(ccp_fold): Use it.  Handle GIMPLE_TERNARY_RHS.
      	* tree-ssa-dom.c (enum expr_kind): Add EXPR_TERNARY.
      	(struct hashtable_expr): New member ternary in the union.
      	(initialize_hash_element): Handle GIMPLE_TERNARY_RHS.
      	(hashable_expr_equal_p): Fix indentation.  Handle EXPR_TERNARY.
      	(iterative_hash_hashable_expr): Likewise.
      	(print_expr_hash_elt): Handle EXPR_TERNARY.
      	* gimple-fold.c (fold_gimple_assign): Handle GIMPLE_TERNARY_RHS.
      	* tree-ssa-threadedge.c (fold_assignment_stmt): Remove useless break
      	statements.  Handle GIMPLE_TERNARY_RHS.
      
      testsuite/
      	PR target/43902
      	* gcc.target/mips/madd-9.c: New test.
      
      From-SVN: r161366
      Bernd Schmidt committed
  31. 14 May, 2010 1 commit
    • cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef and define. · b5023f3c
      2010-05-14  Martin Jambor  <mjambor@suse.cz>
      
      	* cp/cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
      	and define.
      
      	* langhooks-def.h (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove.
      	(LANG_HOOKS_INITIALIZER): Remove LANG_HOOKS_FOLD_OBJ_TYPE_REF.
      	* langhooks.h (struct lang_hooks_for_decls): Removed field
      	fold_obj_type_ref.
      	* tree.c (free_lang_data): Remove assignment to
      	lang_hooks.fold_obj_type_ref.
      	* tree.def (OBJ_TYPE_REF): Update comment.
      
      From-SVN: r159393
      Martin Jambor committed
  32. 02 Apr, 2010 1 commit
    • Make-lang.in, [...]: Update copyright years. · c75c517d
      	* ada/gcc-interface/Make-lang.in, alias.c, attribs.c, auto-inc-dec.c, 
      	basic-block.h, bb-reorder.c, calls.c, c-common.c, cgraph.h,
      	collect2.h, config/alpha/alpha.c, config/alpha/alpha.md,
      	config/alpha/predicates.md, config/arm/arm.md,
      	config/arm/lib1funcs.asm, config/arm/neon-schedgen.ml,
      	config/avr/avr.c, config/avr/avr.md, config/bfin/bfin.c,
      	config/darwin9.h, config/darwin.c, config/darwin.h,
      	config/h8300/h8300.c, config/i386/cpuid.h, config/i386/cygming.h,
      	config/i386/cygwin.h, config/i386/mingw32.h, config/i386/msformat-c.c,
      	config/i386/sol2-10.h, config/i386/xopintrin.h, config/ia64/ia64.c,
      	config/ia64/ia64.md, config/ia64/sync.md, config/mep/mep.c,
      	config/mips/mips.md, config/mn10300/mn10300.c,
      	config/mn10300/mn10300.h, config/pa/pa.c, config/pa/pa.md,
      	config/rs6000/aix.h, config/rs6000/dfp.md,
      	config/rs6000/rs6000-builtin.def, config/rs6000/rs6000-c.c,
      	config/rs6000/vector.md, config/rtems.h, config/rx/rx.md,
      	config/s390/s390.md, config/sol2-c.c, config/sparc/sol2-bi.h,
      	config/sparc/sol2-gas.h, config/sparc/sparc.h, config/sparc/sparc.md,
      	config/sparc/sparc-protos.h, config/spu/spu.c, config/spu/spu-c.c,
      	config/t-darwin, convert.c, c.opt, c-opts.c, cp/Make-lang.in,
      	c-pretty-print.c, c-typeck.c, df-core.c, df-scan.c, diagnostic.c,
      	diagnostic.h, doc/cppopts.texi, doc/cpp.texi, doc/extend.texi,
      	doc/gimple.texi, doc/languages.texi, doc/plugins.texi, doc/rtl.texi,
      	doc/standards.texi, doc/tree-ssa.texi, doc/trouble.texi, dominance.c,
      	fold-const.c, fortran/Make-lang.in, fwprop.c, gcc-plugin.h,
      	gensupport.c, gimple.h, gimple-iterator.c, graphite.c,
      	graphite-clast-to-gimple.c, graphite-clast-to-gimple.h,
      	graphite-dependences.c, graphite-poly.c, graphite-poly.h,
      	graphite-ppl.c, graphite-ppl.h, graphite-scop-detection.c,
      	graphite-sese-to-poly.c, graphite-sese-to-poly.h, ifcvt.c, intl.c,
      	intl.h, ipa.c, ipa-cp.c, ipa-inline.c, ipa-prop.c, ipa-prop.h,
      	ipa-pure-const.c, ipa-reference.c, ipa-type-escape.c, ira-color.c,
      	ira-conflicts.c, ira-lives.c, java/Make-lang.in, lambda-code.c,
      	loop-invariant.c, lto/Make-lang.in, lto-streamer.h, lto-streamer-in.c,
      	objc/Make-lang.in, objcp/Make-lang.in, omp-low.c, optc-gen.awk,
      	opt-functions.awk, opth-gen.awk, params.def, passes.c,
      	postreload-gcse.c, print-tree.c, recog.c, regrename.c, reload.h,
      	rtl.def, sched-int.h, sched-rgn.c, sel-sched-dump.c, sese.c, sese.h,
      	store-motion.c, stor-layout.c, tree-cfgcleanup.c, tree-chrec.c,
      	tree-complex.c, tree-data-ref.c, tree.def, tree-eh.c, tree-flow.h,
      	tree-flow-inline.h, tree.h, tree-loop-distribution.c, tree-outof-ssa.c,
      	tree-parloops.c, tree-pass.h, tree-predcom.c, tree-profile.c,
      	tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-alias.c,
      	tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-dce.c, tree-ssa-dom.c,
      	tree-ssa-dse.c, tree-ssa-loop-im.c, tree-ssa-loop-ivcanon.c,
      	tree-ssa-loop-manip.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
      	tree-ssa-pre.c, tree-ssa-sccvn.c, tree-ssa-structalias.c,
      	tree-ssa-uncprop.c, tree-tailcall.c, tree-vect-data-refs.c,
      	tree-vect-loop.c, tree-vectorizer.h, tree-vect-slp.c, tree-vrp.c,
      	unwind-dw2-fde-darwin.c, varpool.c: Update copyright years.
      
      From-SVN: r157950
      Steven Bosscher committed
  33. 20 Jan, 2010 1 commit
  34. 25 Nov, 2009 1 commit
    • Remove trailing white spaces. · b8698a0f
      2009-11-25  H.J. Lu  <hongjiu.lu@intel.com>
      
      	* alias.c: Remove trailing white spaces.
      	* alloc-pool.c: Likewise.
      	* alloc-pool.h: Likewise.
      	* attribs.c: Likewise.
      	* auto-inc-dec.c: Likewise.
      	* basic-block.h: Likewise.
      	* bb-reorder.c: Likewise.
      	* bt-load.c: Likewise.
      	* builtins.c: Likewise.
      	* builtins.def: Likewise.
      	* c-common.c: Likewise.
      	* c-common.h: Likewise.
      	* c-cppbuiltin.c: Likewise.
      	* c-decl.c: Likewise.
      	* c-format.c: Likewise.
      	* c-lex.c: Likewise.
      	* c-omp.c: Likewise.
      	* c-opts.c: Likewise.
      	* c-parser.c: Likewise.
      	* c-pretty-print.c: Likewise.
      	* c-tree.h: Likewise.
      	* c-typeck.c: Likewise.
      	* caller-save.c: Likewise.
      	* calls.c: Likewise.
      	* cfg.c: Likewise.
      	* cfganal.c: Likewise.
      	* cfgexpand.c: Likewise.
      	* cfghooks.c: Likewise.
      	* cfghooks.h: Likewise.
      	* cfglayout.c: Likewise.
      	* cfgloop.c: Likewise.
      	* cfgloop.h: Likewise.
      	* cfgloopmanip.c: Likewise.
      	* cfgrtl.c: Likewise.
      	* cgraph.c: Likewise.
      	* cgraph.h: Likewise.
      	* cgraphbuild.c: Likewise.
      	* cgraphunit.c: Likewise.
      	* cif-code.def: Likewise.
      	* collect2.c: Likewise.
      	* combine.c: Likewise.
      	* convert.c: Likewise.
      	* coverage.c: Likewise.
      	* crtstuff.c: Likewise.
      	* cse.c: Likewise.
      	* cselib.c: Likewise.
      	* dbgcnt.c: Likewise.
      	* dbgcnt.def: Likewise.
      	* dbgcnt.h: Likewise.
      	* dbxout.c: Likewise.
      	* dce.c: Likewise.
      	* ddg.c: Likewise.
      	* ddg.h: Likewise.
      	* defaults.h: Likewise.
      	* df-byte-scan.c: Likewise.
      	* df-core.c: Likewise.
      	* df-problems.c: Likewise.
      	* df-scan.c: Likewise.
      	* df.h: Likewise.
      	* dfp.c: Likewise.
      	* diagnostic.c: Likewise.
      	* diagnostic.h: Likewise.
      	* dominance.c: Likewise.
      	* domwalk.c: Likewise.
      	* double-int.c: Likewise.
      	* double-int.h: Likewise.
      	* dse.c: Likewise.
      	* dwarf2asm.c: Likewise.
      	* dwarf2asm.h: Likewise.
      	* dwarf2out.c: Likewise.
      	* ebitmap.c: Likewise.
      	* ebitmap.h: Likewise.
      	* emit-rtl.c: Likewise.
      	* et-forest.c: Likewise.
      	* except.c: Likewise.
      	* except.h: Likewise.
      	* expmed.c: Likewise.
      	* expr.c: Likewise.
      	* expr.h: Likewise.
      	* final.c: Likewise.
      	* flags.h: Likewise.
      	* fold-const.c: Likewise.
      	* function.c: Likewise.
      	* function.h: Likewise.
      	* fwprop.c: Likewise.
      	* gcc.c: Likewise.
      	* gcov-dump.c: Likewise.
      	* gcov-io.c: Likewise.
      	* gcov-io.h: Likewise.
      	* gcov.c: Likewise.
      	* gcse.c: Likewise.
      	* genattr.c: Likewise.
      	* genattrtab.c: Likewise.
      	* genautomata.c: Likewise.
      	* genchecksum.c: Likewise.
      	* genconfig.c: Likewise.
      	* genflags.c: Likewise.
      	* gengtype-parse.c: Likewise.
      	* gengtype.c: Likewise.
      	* gengtype.h: Likewise.
      	* genmddeps.c: Likewise.
      	* genmodes.c: Likewise.
      	* genopinit.c: Likewise.
      	* genpreds.c: Likewise.
      	* gensupport.c: Likewise.
      	* ggc-common.c: Likewise.
      	* ggc-page.c: Likewise.
      	* ggc-zone.c: Likewise.
      	* ggc.h: Likewise.
      	* gimple-iterator.c: Likewise.
      	* gimple-low.c: Likewise.
      	* gimple-pretty-print.c: Likewise.
      	* gimple.c: Likewise.
      	* gimple.def: Likewise.
      	* gimple.h: Likewise.
      	* gimplify.c: Likewise.
      	* graphds.c: Likewise.
      	* graphite-clast-to-gimple.c: Likewise.
      	* gthr-nks.h: Likewise.
      	* gthr-posix.c: Likewise.
      	* gthr-posix.h: Likewise.
      	* gthr-posix95.h: Likewise.
      	* gthr-single.h: Likewise.
      	* gthr-tpf.h: Likewise.
      	* gthr-vxworks.h: Likewise.
      	* gthr.h: Likewise.
      	* haifa-sched.c: Likewise.
      	* hard-reg-set.h: Likewise.
      	* hooks.c: Likewise.
      	* hooks.h: Likewise.
      	* hosthooks.h: Likewise.
      	* hwint.h: Likewise.
      	* ifcvt.c: Likewise.
      	* incpath.c: Likewise.
      	* init-regs.c: Likewise.
      	* integrate.c: Likewise.
      	* ipa-cp.c: Likewise.
      	* ipa-inline.c: Likewise.
      	* ipa-prop.c: Likewise.
      	* ipa-pure-const.c: Likewise.
      	* ipa-reference.c: Likewise.
      	* ipa-struct-reorg.c: Likewise.
      	* ipa-struct-reorg.h: Likewise.
      	* ipa-type-escape.c: Likewise.
      	* ipa-type-escape.h: Likewise.
      	* ipa-utils.c: Likewise.
      	* ipa-utils.h: Likewise.
      	* ipa.c: Likewise.
      	* ira-build.c: Likewise.
      	* ira-color.c: Likewise.
      	* ira-conflicts.c: Likewise.
      	* ira-costs.c: Likewise.
      	* ira-emit.c: Likewise.
      	* ira-int.h: Likewise.
      	* ira-lives.c: Likewise.
      	* ira.c: Likewise.
      	* jump.c: Likewise.
      	* lambda-code.c: Likewise.
      	* lambda-mat.c: Likewise.
      	* lambda-trans.c: Likewise.
      	* lambda.h: Likewise.
      	* langhooks.c: Likewise.
      	* lcm.c: Likewise.
      	* libgcov.c: Likewise.
      	* lists.c: Likewise.
      	* loop-doloop.c: Likewise.
      	* loop-init.c: Likewise.
      	* loop-invariant.c: Likewise.
      	* loop-iv.c: Likewise.
      	* loop-unroll.c: Likewise.
      	* lower-subreg.c: Likewise.
      	* lto-cgraph.c: Likewise.
      	* lto-compress.c: Likewise.
      	* lto-opts.c: Likewise.
      	* lto-section-in.c: Likewise.
      	* lto-section-out.c: Likewise.
      	* lto-streamer-in.c: Likewise.
      	* lto-streamer-out.c: Likewise.
      	* lto-streamer.c: Likewise.
      	* lto-streamer.h: Likewise.
      	* lto-symtab.c: Likewise.
      	* lto-wpa-fixup.c: Likewise.
      	* matrix-reorg.c: Likewise.
      	* mcf.c: Likewise.
      	* mode-switching.c: Likewise.
      	* modulo-sched.c: Likewise.
      	* omega.c: Likewise.
      	* omega.h: Likewise.
      	* omp-low.c: Likewise.
      	* optabs.c: Likewise.
      	* optabs.h: Likewise.
      	* opts-common.c: Likewise.
      	* opts.c: Likewise.
      	* params.def: Likewise.
      	* params.h: Likewise.
      	* passes.c: Likewise.
      	* plugin.c: Likewise.
      	* postreload-gcse.c: Likewise.
      	* postreload.c: Likewise.
      	* predict.c: Likewise.
      	* predict.def: Likewise.
      	* pretty-print.c: Likewise.
      	* pretty-print.h: Likewise.
      	* print-rtl.c: Likewise.
      	* print-tree.c: Likewise.
      	* profile.c: Likewise.
      	* read-rtl.c: Likewise.
      	* real.c: Likewise.
      	* recog.c: Likewise.
      	* reg-stack.c: Likewise.
      	* regcprop.c: Likewise.
      	* reginfo.c: Likewise.
      	* regmove.c: Likewise.
      	* regrename.c: Likewise.
      	* regs.h: Likewise.
      	* regstat.c: Likewise.
      	* reload.c: Likewise.
      	* reload1.c: Likewise.
      	* resource.c: Likewise.
      	* rtl.c: Likewise.
      	* rtl.def: Likewise.
      	* rtl.h: Likewise.
      	* rtlanal.c: Likewise.
      	* sbitmap.c: Likewise.
      	* sched-deps.c: Likewise.
      	* sched-ebb.c: Likewise.
      	* sched-int.h: Likewise.
      	* sched-rgn.c: Likewise.
      	* sched-vis.c: Likewise.
      	* sdbout.c: Likewise.
      	* sel-sched-dump.c: Likewise.
      	* sel-sched-dump.h: Likewise.
      	* sel-sched-ir.c: Likewise.
      	* sel-sched-ir.h: Likewise.
      	* sel-sched.c: Likewise.
      	* sel-sched.h: Likewise.
      	* sese.c: Likewise.
      	* sese.h: Likewise.
      	* simplify-rtx.c: Likewise.
      	* stack-ptr-mod.c: Likewise.
      	* stmt.c: Likewise.
      	* stor-layout.c: Likewise.
      	* store-motion.c: Likewise.
      	* stringpool.c: Likewise.
      	* stub-objc.c: Likewise.
      	* sync-builtins.def: Likewise.
      	* target-def.h: Likewise.
      	* target.h: Likewise.
      	* targhooks.c: Likewise.
      	* targhooks.h: Likewise.
      	* timevar.c: Likewise.
      	* tlink.c: Likewise.
      	* toplev.c: Likewise.
      	* toplev.h: Likewise.
      	* tracer.c: Likewise.
      	* tree-affine.c: Likewise.
      	* tree-affine.h: Likewise.
      	* tree-browser.def: Likewise.
      	* tree-call-cdce.c: Likewise.
      	* tree-cfg.c: Likewise.
      	* tree-cfgcleanup.c: Likewise.
      	* tree-chrec.c: Likewise.
      	* tree-chrec.h: Likewise.
      	* tree-complex.c: Likewise.
      	* tree-data-ref.c: Likewise.
      	* tree-data-ref.h: Likewise.
      	* tree-dfa.c: Likewise.
      	* tree-dump.c: Likewise.
      	* tree-dump.h: Likewise.
      	* tree-eh.c: Likewise.
      	* tree-flow-inline.h: Likewise.
      	* tree-flow.h: Likewise.
      	* tree-if-conv.c: Likewise.
      	* tree-inline.c: Likewise.
      	* tree-into-ssa.c: Likewise.
      	* tree-loop-distribution.c: Likewise.
      	* tree-loop-linear.c: Likewise.
      	* tree-mudflap.c: Likewise.
      	* tree-nested.c: Likewise.
      	* tree-nomudflap.c: Likewise.
      	* tree-nrv.c: Likewise.
      	* tree-object-size.c: Likewise.
      	* tree-optimize.c: Likewise.
      	* tree-outof-ssa.c: Likewise.
      	* tree-parloops.c: Likewise.
      	* tree-pass.h: Likewise.
      	* tree-phinodes.c: Likewise.
      	* tree-predcom.c: Likewise.
      	* tree-pretty-print.c: Likewise.
      	* tree-profile.c: Likewise.
      	* tree-scalar-evolution.c: Likewise.
      	* tree-ssa-address.c: Likewise.
      	* tree-ssa-alias.c: Likewise.
      	* tree-ssa-ccp.c: Likewise.
      	* tree-ssa-coalesce.c: Likewise.
      	* tree-ssa-copy.c: Likewise.
      	* tree-ssa-copyrename.c: Likewise.
      	* tree-ssa-dce.c: Likewise.
      	* tree-ssa-dom.c: Likewise.
      	* tree-ssa-dse.c: Likewise.
      	* tree-ssa-forwprop.c: Likewise.
      	* tree-ssa-ifcombine.c: Likewise.
      	* tree-ssa-live.c: Likewise.
      	* tree-ssa-live.h: Likewise.
      	* tree-ssa-loop-ch.c: Likewise.
      	* tree-ssa-loop-im.c: Likewise.
      	* tree-ssa-loop-ivcanon.c: Likewise.
      	* tree-ssa-loop-ivopts.c: Likewise.
      	* tree-ssa-loop-manip.c: Likewise.
      	* tree-ssa-loop-niter.c: Likewise.
      	* tree-ssa-loop-prefetch.c: Likewise.
      	* tree-ssa-loop-unswitch.c: Likewise.
      	* tree-ssa-loop.c: Likewise.
      	* tree-ssa-math-opts.c: Likewise.
      	* tree-ssa-operands.c: Likewise.
      	* tree-ssa-operands.h: Likewise.
      	* tree-ssa-phiopt.c: Likewise.
      	* tree-ssa-phiprop.c: Likewise.
      	* tree-ssa-pre.c: Likewise.
      	* tree-ssa-propagate.c: Likewise.
      	* tree-ssa-reassoc.c: Likewise.
      	* tree-ssa-sccvn.c: Likewise.
      	* tree-ssa-sink.c: Likewise.
      	* tree-ssa-structalias.c: Likewise.
      	* tree-ssa-ter.c: Likewise.
      	* tree-ssa-threadedge.c: Likewise.
      	* tree-ssa-threadupdate.c: Likewise.
      	* tree-ssa-uncprop.c: Likewise.
      	* tree-ssa.c: Likewise.
      	* tree-ssanames.c: Likewise.
      	* tree-switch-conversion.c: Likewise.
      	* tree-tailcall.c: Likewise.
      	* tree-vect-data-refs.c: Likewise.
      	* tree-vect-generic.c: Likewise.
      	* tree-vect-loop-manip.c: Likewise.
      	* tree-vect-loop.c: Likewise.
      	* tree-vect-patterns.c: Likewise.
      	* tree-vect-slp.c: Likewise.
      	* tree-vect-stmts.c: Likewise.
      	* tree-vectorizer.c: Likewise.
      	* tree-vectorizer.h: Likewise.
      	* tree-vrp.c: Likewise.
      	* tree.c: Likewise.
      	* tree.def: Likewise.
      	* tree.h: Likewise.
      	* treestruct.def: Likewise.
      	* unwind-compat.c: Likewise.
      	* unwind-dw2-fde-glibc.c: Likewise.
      	* unwind-dw2.c: Likewise.
      	* value-prof.c: Likewise.
      	* value-prof.h: Likewise.
      	* var-tracking.c: Likewise.
      	* varasm.c: Likewise.
      	* varpool.c: Likewise.
      	* vec.c: Likewise.
      	* vec.h: Likewise.
      	* vmsdbgout.c: Likewise.
      	* web.c: Likewise.
      	* xcoffout.c: Likewise.
      
      From-SVN: r154645
      H.J. Lu committed
  35. 01 Nov, 2009 1 commit
  36. 26 Oct, 2009 1 commit
    • extend.texi (Named Address Spaces): New section. · 09e881c9
      2009-10-26  Ben Elliston  <bje@au.ibm.com>
      	    Michael Meissner  <meissner@linux.vnet.ibm.com>
      	    Ulrich Weigand  <uweigand@de.ibm.com>
      
      	* doc/extend.texi (Named Address Spaces): New section.
      	* coretypes.h (addr_space_t): New type.
      	(ADDR_SPACE_GENERIC): New define.
      	(ADDR_SPACE_GENERIC_P): New macro.
      
      	* doc/tm.texi (Named Address Spaces): New section.
      	(TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Document.
      	(TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Document.
      	(TARGET_ADDR_SPACE_SUBSET_P): Document.
      	(TARGET_ADDR_SPACE_CONVERT): Document.
      	* target.h (struct gcc_target): Add addr_space substructure.
      	* target-def.h (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Define.
      	(TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Likewise.
      	(TARGET_ADDR_SPACE_SUBSET_P): Likewise.
      	(TARGET_ADDR_SPACE_CONVERT): Likewise.
      	(TARGET_ADDR_SPACE_HOOKS): Likewise.
      	(TARGET_INITIALIZER): Initialize addr_space hooks.
      	* targhooks.c (default_addr_space_legitimate_address_p): New function.
      	(default_addr_space_legitimize_address): Likewise.
      	(default_addr_space_subset_p): Likewise.
      	(default_addr_space_convert): Likewise.
      	* targhooks.h (default_addr_space_legitimate_address_p): Add prototype.
      	(default_addr_space_legitimize_address): Likewise.
      	(default_addr_space_subset_p): Likewise.
      	(default_addr_space_convert): Likewise.
      
      	* doc/rtl.texi (MEM_ADDR_SPACE): Document.
      	* rtl.h (mem_attrs): Add ADDRSPACE memory attribute.
      	(MEM_ADDR_SPACE): New macro.
      	* emit-rtl.c (get_mem_attrs): Add ADDRSPACE argument and set
      	address space memory attribute.
      	(mem_attrs_htab_hash): Handle address space memory attribute.
      	(mem_attrs_htab_eq): Likewise.
      	(set_mem_attributes_minus_bitpos): Likewise.
      	(set_mem_alias_set): Likewise.
      	(set_mem_align): Likewise.
      	(set_mem_expr): Likewise.
      	(set_mem_offset): Likewise.
      	(set_mem_size): Likewise.
      	(adjust_address_1): Likewise.
      	(offset_address): Likewise.
      	(widen_memoy_address): Likewise.
      	(get_spill_slot_decl): Likewise.
      	(set_mem_attrs_for_spill): Likewise.
      	(set_mem_addr_space): New function.
      	* emit-rtl.h (set_mem_addr_space): Add prototype.
      	* print-rtl.c (print_rtx): Print address space memory attribute.
      	* expr.c (expand_assignment): Set address space memory attribute
      	of generated MEM RTXes as appropriate.
      	(expand_expr_real_1): Likewise.
      	* cfgexpand.c (expand_debug_expr): Likewise.
      	* tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise.
      
      	* tree.h (struct tree_base): Add address_space bitfield.  Reduce
      	size of "spare" bitfield.
      	(TYPE_ADDR_SPACE): New macro.
      	(ENCODE_QUAL_ADDR_SPACE): Likewise.
      	(DECODE_QUAL_ADDR_SPACE): Likewise.
      	(CLEAR_QUAL_ADDR_SPACE): Likewise.
      	(KEEP_QUAL_ADDR_SPACE): Likewise.
      	(TYPE_QUALS): Encode type address space.
      	(TYPE_QUALS_NO_ADDR_SPACE): New macro.
      	* tree.c (set_type_quals): Set type address space.
      	(build_array_type): Inherit array address space from element type.
      	* print-tree.c (print_node_brief): Print type address space.
      	(print_node): Likewise.
      	* tree-pretty-print.c (dump_generic_node): Likewise.
      
      	* explow.c (memory_address): Rename to ...
      	(memory_address_addr_space): ... this.  Add ADDRSPACE argument.
      	Use address-space aware variants of memory address routines.
      	* recog.c (memory_address_p): Rename to ...
      	(memory_address_addr_space_p): ... this.  Add ADDSPACE argument.
      	Use address-space aware variants of memory address routines.
      	(offsettable_address_p): Rename to ...
      	(offsettable_address_addr_space_p): ... this.  Add ADDRSPACE argument.
      	Use address-space aware variants of memory address routines.
      	* reload.c (strict_memory_address_p): Rename to ...
      	(strict_memory_address_addr_space_p): ... this.  Add ADDSPACE argument.
      	Use address-space aware variants of memory address routines.
      	(maybe_memory_address_p): Rename to ...
      	(maybe_memory_address_addr_space_p): ... this.  Add ADDSPACE argument.
      	Use address-space aware variants of memory address routines.
      	* expr.h (memory_address_addr_space): Add prototype.
      	(memory_address): Define as macro.
      	* recog.h (memory_address_addr_space_p): Add prototype.
      	(memory_address_p): Define as macro.
      	(offsettable_address_addr_space_p): Add prototype.
      	(offsettable_address_p): Define as macro.
      	(strict_memory_address_addr_space_p): Add prototype.
      	(strict_memory_address_p): Define as macro.
      
      	* combine.c (find_split_point): Use address-space aware variants
      	of memory address routines.
      	* emit-rtl.c (operand_subword): Likewise.
      	(change_address_1): Likewise.
      	(adjust_address_1): Likewise.
      	(offset_address): Likewise.
      	* expr.c (emit_move_insn): Likewise.
      	(expand_assignment): Likewise.
      	(expand_expr_real_1): Likewise.
      	* recog.c (verify_changes): Likewise.
      	(general_operand): Likewise.
      	(offsettable_memref_p): Likewise.
      	(offsettable_nonstrict_memref_p): Likewise.
      	(constrain_operands): Likewise.
      	* reload.c (get_secondary_mem): Likewise.
      	(find_reloads_toplev): Likewise.
      	(find_reloads_address): Likewise.
      	(find_reloads_subreg_address): Likewise.
      	* reload1.c (reload): Likewise.
      	* rtlhooks.c (gen_lowpart_if_possible): Likewise.
      	* rtl.h (address_cost): Add ADDRSPACE argument.
      	* rtlanal.c (address_cost): Add ADDRSPACE argument.  Use address-space
      	aware variant of memory address routines.
      	* loop-invariant.c (create_new_invariant): Update address_cost call.
      	* tree-ssa-loop-ivopts.c (computation_cost): Likewise.
      	* fwprop.c (should_replace_address): Add ADDRSPACE argument.
      	Use address-space aware variant of memory address routines.
      	(propagate_rtx_1): Update call to should_replace_address.
      	* tree-flow.h (multiplier_allowed_in_address_p): Add ADDRSPACE
      	argument.
      	* tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p): Add
      	ADDRSPACE argument.  Use per-address-space instead of global cache.
      	Use address-space aware variant of memory address routines.
      	(get_address_cost): Likewise.
      	(get_computation_cost_at): Update calls.
      	* tree-ssa-address.c (valid_mem_ref_p): Add ADDRSPACE argument.
      	Use address-space aware variant of memory address routines.
      	(create_mem_ref_raw): Update call to valid_mem_ref_p.
      	(most_expensive_mult_to_index): Update call to
      	multiplier_allowed_in_address_p.
      
      	* dwarf2out.c (modified_type_die): Output DW_AT_address_class
      	attribute to indicate named address spaces.
      
      	* varasm.c (get_variable_section): DECLs in named address spaces
      	cannot be "common".
      
      	* reload.c (find_reloads_address): Do not use LEGITIMIZE_RELOAD_ADDRESS
      	for addresses in a non-generic address space.
      
      	* expr.c (emit_block_move_hints): Do not use libcalls for
      	memory in non-generic address spaces.
      	(clear_storage_hints): Likewise.
      	(expand_assignment): Likewise.
      
      	* fold-const.c (operand_equal_p): Expressions refering to different
      	address spaces are not equivalent.
      
      	* rtl.c (rtx_equal_p_cb): MEMs refering to different address
      	spaces are not equivalent.
      	(rtx_equal_p): Likewise.
      	* cse.c (exp_equiv_p): Likewise.
      	* jump.c (rtx_renumbered_equal_p): Likewise.
      	* reload.c (operands_match_p): Likewise.
      
      	* alias.c (nonoverlapping_memrefs_p): MEMs refering to different
      	address spaces may alias.
      	(true_dependence): Likewise.
      	(canon_true_dependence): Likewise.
      	(write_dependence_p): Likewise.
      
      	* dse.c (canon_address): Handle named address spaces.
      	* ifcvt.c (noce_try_cmove_arith): Likewise.
      
      	* tree.def (ADDR_SPACE_CONVERT_EXPR): New tree code.
      	* expr.c (expand_expr_real_2): Expand ADDR_SPACE_CONVERT_EXPR.
      	* convert.c (convert_to_pointer): Generate ADDR_SPACE_CONVERT_EXPR
      	to handle conversions between different address spaces.
      	* fold-const.c (fold_convert_loc): Likewise.
      	(fold_unary_loc): Handle ADDR_SPACE_CONVERT_EXPR.
      	* tree-pretty-print.c (dump_generic_node): Likewise.
      	* gimple-pretty-print.c (dump_unary_rhs): Likewise.
      	* tree-cfg.c (verify_gimple_assign_unary): Likewise.
      	* tree-inline.c (estimate_operator_cost): Likewise.
      	* tree-ssa.c (useless_type_conversion_p): Conversions between pointers
      	to different address spaces are not useless.
      
      Co-Authored-By: Michael Meissner <meissner@linux.vnet.ibm.com>
      Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com>
      
      From-SVN: r153572
      Ben Elliston committed
  37. 12 Oct, 2009 1 commit
    • re PR debug/41343 (sysdeps/ieee754/dbl-64/dosincos.c from glibc causes excessive memory use) · 0ca5af51
      gcc/ChangeLog:
      PR debug/41343
      PR debug/41447
      PR debug/41264
      PR debug/41338
      * tree.def (DEBUG_EXPR_DECL): New.
      * rtl.def (DEBUG_EXPR): New.
      * gengtype.c (adjust_field_rtx_def): Handle it.
      * tree-ssa.c (propagate_var_def_into_debug_stmts): Rename to...
      (insert_debug_temp_for_var_def): ... this.  Drop support for
      moving.  Take iterator for def stmt; insert debug stmt before it.
      Scan early for use count and kind in debug stmts.
      (propagate_defs_into_debug_stmts): Rename to...
      (insert_debug_temps_for_defs): ... this.  Likewise.
      * tree.h (DEBUG_TEMP_UID): New.
      * tree.c (next_debug_decl_uid): New.
      (make_node_stat): Count debug decls separately.
      (copy_node_stat): Likewise.
      * cfgexpand.c (expand_debug_expr): Handle DEBUG_EXPR_DECL.
      * var-tracking.c (dv_is_decl_p): Recognize it.
      (VALUE_RECURSED_INTO): Apply to DEBUG_EXPRs too.
      (track_expr_p): Track expanded DEBUG_EXPR_DECLs.
      (vt_expand_loc_callback): Expand DEBUG_EXPRs.
      (emit_note_insn_var_location): Don't emit notes for DEBUG_EXPR_DECLs.
      * cselib.c (rtx_equal_for_cselib_p): Handle DEBUG_EXPR.
      (cselib_hash_rtx): Likewise.
      (cselib_expand_value_rtx_1): Use callback for DEBUG_EXPR.
      * tree-ssa-operands.c (get_expr_operands): Skip DEBUG_EXPR_DECLs in
      debug bind stmts.
      * emit-rtl.c (verify_rtx_sharing): Handle DEBUG_EXPR and VALUE.
      (copy_rtx_if_shared_1, reset_used_flags, set_used_flags): Likewise.
      * rtl.c (copy_rtx): Likewise.
      (rtx_equal_p_cb, rtx_equal_p): Handle DEBUG_EXPR.
      * print-rtl.c (print_rtx): Likewise.
      * sched-vis.c (print_value): Likewise.
      (print_insn): Handle DEBUG_EXPR_DECL.
      * tree-dump.c (dequeue_and_dump): Likewise.
      * tree-pretty-print.c (dump_decl_name, dump_generic_node): Likewise.
      * gimple-iterator (gsi_replace): Check for same lhs.
      (gsi_remove): Insert debug temps.
      * tree-ssa-loop-im.c (rewrite_reciprocal): Replace with same lhs.
      (move_computations_stmt): Drop explicit propagation into debug stmts.
      (rewrite_bittest): Likewise.  Use gsi_remove for propagation.
      * tree-ssa-reassoc.c (rewrite_expr_tree, linearize_expr): Likewise.
      * tree-ssa-sink.c (statement_sink_location): Likewise.
      * tree-ssa-forwprop (forward_propagate_addr_expr): Likewise.
      * tree-ssanames.c (release_ssa_name): Adjust for rename.
      * tree-flow.h: Likewise.
      * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Don't mark
      debug temps without values.
      (eliminate_unnecessary_stmts): Don't discard just-inserted
      debug stmts.
      gcc/testsuite/ChangeLog:
      PR debug/41343
      PR debug/41447
      PR debug/41264
      PR debug/41338
      * gcc.dg/guality/pr41447-1.c: New.
      * gcc.dg/debug/pr41264-1.c: New.
      * gcc.dg/debug/pr41343-1.c: New.
      
      From-SVN: r152681
      Alexandre Oliva committed
  38. 14 Sep, 2009 1 commit
    • builtins.c (expand_builtin_synchronize): Use gimple_build_asm_vec. · 1c384bf1
      	* builtins.c (expand_builtin_synchronize): Use gimple_build_asm_vec.
      	* cfgbuild.c (make_edges): Handle asm goto.
      	* cfglayout.c (fixup_reorder_chain): Likewise.
      	* cfgrtl.c (patch_jump_insn): Likewise.
      	* gimple-pretty-print.c (dump_gimple_asm): Likewise.
      	* gimple.c (gimple_build_asm_1): Add and use nlabels parameter.
      	(gimple_build_asm_vec): Add and use labels parameter.
      	(gimple_build_asm): Remove.
      	(walk_gimple_asm): Walk labels too.
      	* gimple.def (GIMPLE_ASM): Update docs.
      	* gimple.h: Update decls.
      	(struct gimple_statement_asm): Change nc to use unsigned char;
      	add nl member.
      	(gimple_asm_nlabels): New.
      	(gimple_asm_label_op, gimple_asm_set_label_op): New.
      	* gimplify.c (gimplify_asm_expr): Copy labels from ASM_EXPR
      	into gimple_build_asm_vec.
      	* jump.c (mark_jump_label_asm): New.
      	(mark_jump_label): Use it.
      	(redirect_jump_1): Handle asm goto.
      	(invert_jump_1): Soft fail if X is null.
      	* recog.c (extract_asm_operands): New.
      	(asm_noperands): Use it; handle asm labels.
      	(decode_asm_operands): Use extract_asm_operands.
      	(asm_operand_ok): Properly handle empty string.
      	* reg-stack.c (get_asm_operands_in_out): Rename from
      	get_asm_operand_n_inputs; use extract_asm_operands; return both
      	inputs and outputs by reference; update all callers.
      	* rtl.def (ASM_OPERANDS): Add label vector as operand 6.
      	* rtl.h (ASM_OPERANDS_LABEL_VEC): New.
      	(ASM_OPERANDS_LABEL_LENGTH, ASM_OPERANDS_LABEL): New.
      	(ASM_OPERANDS_SOURCE_LOCATION): Renumber.
      	(extract_asm_operands): Declare.
      	* stmt.c (expand_asm_operands): Add and use labels parameter.
      	(check_unique_operand_names): Likewise.
      	(resolve_asm_operand_names, resolve_operand_name_1): Likewise.
      	(expand_asm_stmt): Handle asm labels.
      	* tree-cfg.c (make_gimple_asm_edges): New.
      	(make_edges): Use it.
      	(cleanup_dead_labels): Handle asm labels.
      	(is_ctrl_altering_stmt): Likewise.
      	(gimple_redirect_edge_and_branch): Likewise.
      	* tree.def (ASM_EXPR): Add 5th operand.
      	* tree.h (ASM_LABELS): New.
      	(resolve_asm_operand_names): Update decl.
      
      	* c-parser.c (c_parser_asm_statement): Parse asm goto.
      	(c_parser_asm_goto_operands): New.
      	* c-tree.h (build_asm_expr): Update decl.
      	* c-typeck.c (build_asm_expr): Add and use labels parameter.
      	* doc/extend.texi: Document asm goto.
      
      gcc/ada/
      	* gcc-interface/trans.c (Pragma_to_gnu): Use build5 for ASM_EXPR.
      
      gcc/cp/
      	* cp-tree.h (finish_asm_stmt): Update decl.
      	* parser.c (cp_parser_asm_definition): Parse asm goto.
      	(cp_parser_asm_label_list): New.
      	* pt.c (tsubst_copy_asm_operands): Don't recurse on labels.
      	(tsubst_expr): Handle asm labels.
      	* semantics.c (finish_asm_stmt): Add and use labels parameter.
      
      gcc/testsuite/
      	* c-c++-common/asmgoto-1.c, c-c++-common/asmgoto-2.c,
      	c-c++-common/asmgoto-3.c, gcc.c-torture/compile/asmgoto-1.c,
      	gcc.dg/tree-ssa/asmgoto-1.c: New files.
      
      Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
      
      From-SVN: r151701
      Richard Henderson committed