Commit Graph

400 Commits

Author SHA1 Message Date
Richard Biener f877b3adba isl.m4: Remove support for ISL 0.14.
2017-02-13  Richard Biener  <rguenther@suse.de>

	config/
	* isl.m4: Remove support for ISL 0.14.

	* configure: Re-generate.

	gcc/
	* configure.ac (HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS):
	Remove.
	* configure: Re-generate.
	* config.in: Likewise.
	* graphite-dependences.c: Simplify as if
	HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS was defined.
	* graphite-isl-ast-to-gimple.c: Likewise.
	* graphite-optimize-isl.c: Likewise.
	* graphite-poly.c: Likewise.
	* graphite-sese-to-poly.c: Likewise.
	* graphite.h: Likewise.
	* toplev.c: Include isl/version.h and use isl_version () for
	printing the ISL version.
	* doc/install.texi: Update ISL requirement.

From-SVN: r245382
2017-02-13 08:54:02 +00:00
Alan Modra 8f56cb5163 Update configure deps, remove stray \xA0 in picflag.m4, regenerate
Also fix a stray changelog entry.  Some of the regen here is due to
previous changes not being regenerated properly, in part due to the
missing configure dependencies.

	* configure: Regenerate.
config/
	* picflag.m4: Remove stray \xA0 in comment.
gcc/
	* Makefile.in (aclocal_deps): Update and order as per aclocal.m4.
	* configure: Regenerate.
	* config.in: Regenerate.
libada/
	* Makefile.in (configure_deps): Update and order as per
	configure.ac sinclude.
	* configure: Regenerate.
libgcc/
	* Makefile.in (configure_deps): Update.
	* configure: Regenerate.
libiberty/
	* Makefile.in (configure_deps): Update.
	* configure: Regenerate.
libitm/
	* Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

From-SVN: r244049
2017-01-04 18:59:34 +10:30
Iain Sandoe b410cf1dc0 [Darwin] fix PR67710 by updating 'as' specs to handle newer assembler versions.
A/ Newer versions of ld64 check the min_version command, and newer versions of
   the system assembler inserts this in response to "-mmacosx-version-min=" on
   the assembler line. Unless one makes sensible versions, some object is bound
   to conflict.

B/ Additionally, there's a difference in behaviour between "as" and "ld" when
   presented with xx.yy.zz (ld truncates to xx.yy, as doesn't); net result is
   that one needs to pass a truncated version to "as".

So (if the assembler supports minversion commands)
(a) provide a truncated minversion (as asm_macosx_version_min, which is a
    driver-only var).
(b) pass this to "as"
(c) Update tests to determine 'HAVE_AS_MMACOSX_VERSION_MIN_OPTION'
    (Rainer's patch)
(d) For some reason the testcases are "run" (it's not obvious they need to be,
    they are checking compile-time issues)
  - anyway, to preserve the status quo, I've left them as exec.  However, the
    minimum version that can be code-gened for is target-dependent (there are no
    released x86 versions before 10.4, for example).  To avoid conflicts where
    the "as" is assuming some minimum, I've set the testversion to 10.5 (which
    is supported by all the archs we have)
(e) We need to ensure that libgcc and crts are generated with a sufficiently
    old minversion not to conflict.

gcc/

2016-11-27  Iain Sandoe  <iain@codesourcery.com>
	    Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR target/67710
	* config.in: Regenerate
	* config/darwin-driver.c (darwin_driver_init): Emit a version string
	for the assembler.
	* config/darwin.h(ASM_MMACOSX_VERSION_MIN_SPEC): New, new tests.
	* config/darwin.opt(asm_macosx_version_min): New.
	* config/i386/darwin.h: Handle ASM_MMACOSX_VERSION_MIN_SPEC.
	* configure: Regenerate
	* configure.ac: Check for mmacosx-version-min handling.

gcc/testsuite/

2016-11-27  Iain Sandoe  <iain@codesourcery.com>
	    Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
	    Dominique d'Humieres  <dominiq@lps.ens.fr>

	PR target/67710
	*  gcc.dg/darwin-minversion-1.c: Update min version check.
	*  gcc.dg/darwin-minversion-2.c: Likewise.
	*  gcc.dg/darwin-minversion-3.c: Likewise.

libgcc/

2016-11-27  Iain Sandoe  <iain@codesourcery.com>
	    Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR target/67710
	*  config/t-darwin: Default builds to 10.5 codegen.


Co-Authored-By: Dominique d'Humieres <dominiq@lps.ens.fr>
Co-Authored-By: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>

From-SVN: r242898
2016-11-27 15:07:22 +00:00
Iain Sandoe eb89c82f46 [Darwin, config] Arrange for ld64 to be detected as Darwin's linker.
This is an initial patch in a series that converts Darwin's configury
 to detect ld64 features, rather than the current process of hard-coding
 them on target system version.

 A ld64-compatible linker is currently required and assumed by Darwin.
 If a DEFAULT_LINKER is set via --with-ld= then this will be tested to
 see if it is ld64.

 The ld64 version is determined for the chosen ld and this is exported for
 use in setting a default value for -mtarget-linker (needed for run-time
 code-gen changes to section choices).
 The support for -rdynamic is converted to be detected at config time, or
 by the ld64 version if that is found.

gcc/

2016-11-27  Iain Sandoe  <iain@codesourcery.com>

	PR target/71767
	* configure.ac (with-ld64): New var, set for Darwin, set on
	detection of ld64, gcc_cv_ld64_export_dynamic: New, New test.
	* config/darwin.h: Use LD64_HAS_DYNAMIC export. DEF_LD64: New,
	define.
	* config/darwin10.h(DEF_LD64): Update for this target version.
	* config/darwin12.h(LINK_GCC_C_SEQUENCE_SPEC): Remove rdynamic
	test.  (DEF_LD64): Update for this target version.
	* configure: Regenerated.
	* config.in: Regenerated.

From-SVN: r242894
2016-11-27 14:29:36 +00:00
Bernd Edlinger b06f87c7eb configure.ac: Split CHECKING_P into CHECKING_P and ENABLE_EXTRA_CHECKING.
2016-09-30  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * configure.ac: Split CHECKING_P into CHECKING_P and
        ENABLE_EXTRA_CHECKING.
        * configure: Regenerated.
        * config.in: Adjust commment of CHECKING_P.  Add ENABLE_EXTRA_CHECKING.
        * common.opt (flag_checking): Use CHECKING_P and ENABLE_EXTRA_CHECKING.

From-SVN: r240677
2016-09-30 18:57:49 +00:00
Alan Modra e9dda04f07 [RS6000] .gnu.attributes Tag_GNU_Power_ABI_FP
Extend this attribute to cover long double ABIs, for 64-bit too.

This patch also corrects an error that crept in to code setting
rs6000_passes_float.  See the added comment.  Passing IEEE128 values
in vsx regs ought to set both Tag_GNU_Power_ABI_FP and
Tag_GNU_Power_ABI_Vector.  Also adds a new option, default on, that
disables output of .gnu_attribute assembly directives.

	* config/rs6000/sysv4.opt (mgnu-attribute): New option.
	* doc/invoke.texi: Document it.
	* config/rs6000/rs6000.c (HAVE_LD_PPC_GNU_ATTR_LONG_DOUBLE): Define.
	(rs6000_passes_float): Comment.
	(rs6000_passes_long_double): New static var.
	(call_ABI_of_interest): Return false unless rs6000_gnu_attr is set.
	(init_cumulative_args): Set up to emit fp .gnu_attribute for
	ELF 64-bit ABIs as well as 32-bit ELF.  Correct rs6000_passes_float
	to include fp values returned in vectors.
	Set rs6000_passes_long_double.
	(rs6000_function_arg_advance_1): Likewise for function args.
	(rs6000_elf_file_end): Emit fp .gnu_attribute for ELF 64-bit ABIs,
	and SPE.  Emit long double tag value too.
	(rs6000_opt_vars): Add gnu-attr.
	* configure.ac (HAVE_LD_PPC_GNU_ATTR_LONG_DOUBLE): New ppc32 test.
	* configure: Regenerate.
	* config.in: Regenerate.

From-SVN: r240601
2016-09-29 07:31:48 +09:30
Alexander Ivchenko 7e4955774f re PR target/77267 (MPX does not work in a presence of "-Wl,-as-needed" option (Ubuntu default))
Fix PR target/77267

2016-09-10  Alexander Ivchenko  <alexander.ivchenko@intel.com>

	PR target/77267
	* config.in: Regenerate.
	* config/i386/linux-common.h (MPX_LD_AS_NEEDED_GUARD_PUSH):
	New macro.
	(MPX_LD_AS_NEEDED_GUARD_PUSH): Ditto.
	(LIBMPXWRAPPERS_SPEC): Remove "--no-whole-archive" from
	static-libmpxwrappers case.
	(LIBMPX_SPEC): Add guards with MPX_LD_AS_NEEDED_GUARD_PUSH and
	MPX_LD_AS_NEEDED_GUARD_POP.
	* configure: Regenerate.
	* configure.ac (HAVE_LD_PUSHPOPSTATE_SUPPORT): New variable.
	defined if linker support "--push-state"/"--pop-state".

From-SVN: r240057
2016-09-09 14:38:06 -07:00
H.J. Lu de86ff8f97 Call tls_get_addr via GOT for GNU TLS if possible
There are extensions to x86-64 psABI:

https://groups.google.com/forum/#!topic/x86-64-abi/de5_KnLHxtI

and i386 psABI:

https://groups.google.com/forum/#!topic/ia32-abi/awsRSvJOJfs

to call tls_get_addr via GOT.  X86 assembler and linker in binutils 2.27
implemented

call *__tls_get_addr@GOTPCREL(%rip)

in 64-bit and

call *___tls_get_addr@GOT(%reg)

in 32-bit to access global and local thread loal variables in shared
library.  We check if 32-bit x86 assembler and linker work with

call *___tls_get_addr@GOT(%reg)

as 32-bit and 64-bit assembler and linker are enabled togther.

In 32-bit, since any integer register except EAX, which is used to pass
parameter to ___tls_get_addr, and ESP, can be used as GOT base, a new
register class, TLS_GOTBASE_REGS, along with a new constraint, Yb, are
added.  They are used to improve register allocation for 32-bit dynamic
TLS patterns.

gcc/

	* configure.ac (calling ___tls_get_addr via GOT): New
	assembler/linker check.
	(HAVE_AS_IX86_TLS_GET_ADDR_GOT): New.  Defined to 1 if 32-bit
	assembler and linker supports calling ___tls_get_addr via GOT.
	Otherise, defined to 0.
	* config.in: Regenerated.
	* configure: Likewise.
	* config/i386/constraints.md (Yb): New constraint.
	* config/i386/i386.h (reg_class): Add TLS_GOTBASE_REGS.
	(REG_CLASS_NAMES): Likewise.
	(REG_CLASS_CONTENTS): Likewise.
	* config/i386/i386.md (*tls_global_dynamic_32_gnu): Replace
	the b constraint with the Yb constraint.  Call ___tls_get_addr
	via GOT for GNU TLS with -fno-plt if HAVE_AS_IX86_TLS_GET_ADDR_GOT
	is 1.
	(*tls_local_dynamic_base_32_gnu): Likewise.
	(*tls_global_dynamic_64_<mode>): Call _tls_get_addr via GOT for
	GNU TLS with -fno-plt if HAVE_AS_IX86_TLS_GET_ADDR_GOT is 1.
	(*tls_local_dynamic_base_64_<mode>): Likewise.

gcc/testsuite/

	* gcc.target/i386/noplt-gd-1.c: New test.
	* gcc.target/i386/noplt-gd-2.c: Likewise.
	* gcc.target/i386/noplt-gd-3.c: Likewise.
	* gcc.target/i386/noplt-ld-1.c: Likewise.
	* gcc.target/i386/noplt-ld-2.c: Likewise.
	* gcc.target/i386/noplt-ld-3.c: Likewise.
	* lib/target-supports.exp
	(check_effective_target_tls_get_addr_via_got): New.

From-SVN: r237765
2016-06-24 10:32:52 -07:00
H.J. Lu c05977599a i386: Access external function via GOT slot for -fno-plt
i386 psABI has been updated to clarify that R_386_GOT32X and R_386_GOT32
relocations can be used to access GOT without base register when PIC is
disabled:

https://groups.google.com/forum/#!topic/ia32-abi/awsRSvJOJfs

32-bit x86 assembler and linker from binutils 2.26.1 and 2.27 support

call/jmp *_start@GOT
cmpl $0, bar@GOT

for both normal and IFUNC functions.  We check if 32-bit x86 assembler
and linker have the fix for:

https://sourceware.org/bugzilla/show_bug.cgi?id=20244

before accessing external function via GOT slot for -fno-plt in both PIC
and non-PIC modes.

	PR target/66232
	PR target/67400
	* configure.ac (as_ix86_tls_ldm_opt): Renamed to ...
	(as_ix86_gas_32_opt): This.
	(ld_ix86_tls_ldm_opt): Renamed to ...
	(ld_ix86_gld_32_opt): This.
	(R_386_TLS_LDM reloc): Updated.
	(R_386_GOT32X reloc): New assembler/linker check.
	(HAVE_AS_IX86_GOT32X): New.  Defined to 1 if 32-bit assembler and
	linker support "jmp *_start@GOT" and "cmpl $0, bar@GOT".  Otherise,
	defined to 0.
	* config.in: Regenerated.
	* configure: Likewise.
	* config/i386/i386.c (ix86_force_load_from_GOT_p): Return
	true if HAVE_AS_IX86_GOT32X is 1 in 32-bit mode.
	(ix86_legitimate_address_p): Allow UNSPEC_GOT for -fno-plt
	if ix86_force_load_from_GOT_p returns true.
	(ix86_print_operand_address_as): Also support UNSPEC_GOT if
	ix86_force_load_from_GOT_p returns true.
	(ix86_expand_move): Generate UNSPEC_GOT in 32-bit mode to load
	the external function address via the GOT slot.
	(ix86_nopic_noplt_attribute_p): Check both TARGET_64BIT and
	HAVE_AS_IX86_GOT32X before returning false.
	(ix86_output_call_insn): Generate "%!jmp/call\t*%p0@GOT" in
	32-bit mode if ix86_nopic_noplt_attribute_p returns true.

gcc/testsuite/

	PR target/66232
	PR target/67400
	* gcc.target/i386/pr66232-14.c: New file.
	* gcc.target/i386/pr66232-15.c: Likewise.
	* gcc.target/i386/pr66232-16.c: Likewise.
	* gcc.target/i386/pr66232-17.c: Likewise.
	* gcc.target/i386/pr67400-1.c: Don't disable for ia32.  Scan for
	ia32 if R_386_GOT32X relocation is supported.
	* gcc.target/i386/pr67400-2.c: Likewise.
	* gcc.target/i386/pr67400-3.c: Likewise.
	* gcc.target/i386/pr67400-4.c: Likewise.
	* gcc.target/i386/pr67400-6.c: Likewise.
	* gcc.target/i386/pr67400-7.c: Likewise.
	* lib/target-supports.exp (check_effective_target_got32x_reloc):
	New.

From-SVN: r237736
2016-06-23 09:30:43 -07:00
Jose E. Marchesi 690f24b775 sparc: support for the SPARC M7 and VIS 4.0
gcc/ChangeLog:
    
2016-06-06  Jose E. Marchesi  <jose.marchesi@oracle.com>
    
    	* config/sparc/sparc.md (cpu): Add niagara7 cpu type.
    	Include the M7 SPARC DFA scheduler.
    	New attribute v3pipe.
    	Annotate insns with v3pipe where appropriate.
    	Define cpu_feature vis4.
    	Add lzd instruction type and set it on clzdi_sp64 and clzsi_sp64.
    	Add (V8QI "8") to vbits.
    	Add insns {add,sub}v8qi3
    	Add insns ss{add,sub}v8qi3
    	Add insns us{add,sub}{v8qi,v4hi}3
    	Add insns {min,max}{v8qi,v4hi,v2si}3
    	Add insns {minu,maxu}{v8qi,v4hi,v2si}3
    	Add insns fpcmp{le,gt,ule,ug,ule,ugt}{8,16,32}_vis.
    	* config/sparc/niagara4.md: Add a comment explaining the
    	discrepancy between the documented latenty numbers and the
    	implemented ones.
    	* config/sparc/niagara7.md: New file.
    	* configure.ac (HAVE_AS_SPARC5_VIS4): Define if the assembler
    	supports SPARC5 and VIS 4.0 instructions.
    	* configure: Regenerate.
    	* config.in: Likewise.
    	* config.gcc: niagara7 is a supported cpu in sparc*-*-* targets.
    	* config/sparc/sol2.h (ASM_CPU32_DEFAUILT_SPEC): Set for
    	TARGET_CPU_niagara7.
    	(ASM_CPU64_DEFAULT_SPEC): Likewise.
    	(CPP_CPU_SPEC): Handle niagara7.
    	(ASM_CPU_SPEC): Likewise.
    	* config/sparc/sparc-opts.h (processor_type): Add
    	PROCESSOR_NIAGARA7.
    	(mvis4): New option.
    	* config/sparc/sparc.h (TARGET_CPU_niagara7): Define.
    	(AS_NIAGARA7_FLAG): Define.
    	(ASM_CPU64_DEFAULT_SPEC): Set for niagara7.
    	(CPP_CPU64_DEFAULT_SPEC): Likewise.
    	(CPP_CPU_SPEC): Handle niagara7.
    	(ASM_CPU_SPEC): Likewise.
    	* config/sparc/sparc.c (niagara7_costs): Define.
    	(sparc_option_override): Handle niagara7 and adjust cache-related
    	parameters with better values for niagara cpus.  Also support VIS4.
    	(sparc32_initialize_trampoline): Likewise.
    	(sparc_use_sched_lookahead): Likewise.
    	(sparc_issue_rate): Likewise.
    	(sparc_register_move_cost): Likewise.
    	(dump_target_flag_bits): Support VIS4.
    	(sparc_vis_init_builtins): Likewise.
    	(sparc_builtins): Likewise.
    	* config/sparc/sparc-c.c (sparc_target_macros): Define __VIS__ for
    	VIS4 4.0.
    	* config/sparc/driver-sparc.c (cpu_names): Add SPARC-M7 and
    	UltraSparc M7.
    	* config/sparc/sparc.opt (sparc_processor_type): New value
    	niagara7.
    	* config/sparc/visintrin.h (__attribute__): Prototypes for the
    	VIS4 builtins.
    	* doc/invoke.texi (SPARC Options): Document -mcpu=niagara7 and
    	-mvis4.
    	* doc/extend.texi (SPARC VIS Built-in Functions): Document the
    	VIS4 builtins.
    
gcc/testsuite/ChangeLog:
    
2016-06-06  Jose E. Marchesi  <jose.marchesi@oracle.com>
    
    	* gcc.target/sparc/vis4misc.c: New file.
    	* gcc.target/sparc/fpcmp.c: Likewise.
    	* gcc.target/sparc/fpcmpu.c: Likewise.

From-SVN: r237132
2016-06-06 13:40:02 +02:00
Rainer Orth ad103b0153 Error out on -fvtable-verify without --enable-vtable-verify
* configure.ac (enable_vtable_verify): Handle --enable-vtable-verify.
	* configure: Regenerate.
	* config.in: Regenerate.
	* gcc.c (VTABLE_VERIFICATION_SPEC) [!ENABLE_VTABLE_VERIFY]: Error
	on -fvtable-verify.
	* config/sol2.h [!ENABLE_VTABLE_VERIFY] (STARTFILE_VTV_SPEC): Define.
	(ENDFILE_VTV_SPEC): Define.

From-SVN: r236029
2016-05-09 11:54:55 +00:00
Jakub Jelinek 7db11a5a32 re PR bootstrap/70704 (AIX bootstrap comparison failure)
PR bootstrap/70704
	* configure.ac (--enable-stage1-checking): For --disable-checking or
	implicit --enable-checking, make sure extra flag matches in between
	stage1 and later checking.
	* configure: Regenerated.
gcc/
	* configure.ac (--enable-checking): Document extra flag, for
	non-release builds default to --enable-checking=yes,extra.
	If misc checking and extra checking, define CHECKING_P to 2 instead
	of 1.
	* common.opt (fchecking=): Add.
	* doc/invoke.texi (-fchecking=): Document.
	* doc/install.texi: Document --enable-checking changes.
	* configure: Regenerated.
	* config.in: Regenerated.
gcc/cp/
	* pt.c (build_non_dependent_expr): Use flag_checking > 1 instead of
	just flag_checking.

From-SVN: r235430
2016-04-26 08:10:43 +02:00
Michael Matz 3dde4d658b configure.ac (ac_cv_std_swap_in_utility): New test.
* configure.ac (ac_cv_std_swap_in_utility): New test.
	* system.h (<algorithm>): Check HAVE_SWAP_IN_UTILITY as well.
	* configure: Regenerate.
	* config.in: Regenerate.

From-SVN: r232836
2016-01-26 16:34:24 +00:00
Peter Bergner 26a2e6aed4 ppc-auxv.h: New file.
gcc/
	* config/rs6000/ppc-auxv.h: New file.
	* config/rs6000/rs6000-builtin.def (cpu_init): Add new builtin.
	(cpu_is): Likewise.
	(cpu_supports): Likewise.
	* config/rs6000/rs6000.c: include "ppc-auxv.h".
	(cpu_is_info): New variable.
	(cpu_supports_info): Likewise.
	(tcb_verification_symbol): Likewise.
	(cpu_builtin_p): Likewise.
	(cpu_expand_builtin): New function.
	(rs6000_expand_ternop_builtin): Add support for CPU builtin functions.
	(rs6000_init_builtins): Likewise.
	(rs6000_elf_file_end): Emit HWCAP in TCB verification symbol.
	* config/rs6000/rs6000.h (TLS_REGNUM): New define.
	* configure.ac (gcc_cv_libc_provides_hwcap_in_tcb): New test.
	* configure: Regenerate.
	* config.in: Likewise.
	* doc/extend.texi (PowerPC Built-in Functions): Document
	__builtin_cpu_init, __builtin_cpu_is and __builtin_cpu_supports.

gcc/testsuite/
	* gcc.target/powerpc/cpu-builtin-1.c: New test.

From-SVN: r232634
2016-01-20 14:30:24 -06:00
Martin Jambor b2b4005150 Merge of HSA
2016-01-19  Martin Jambor  <mjambor@suse.cz>
	    Martin Liska  <mliska@suse.cz>
	    Michael Matz <matz@suse.de>

libgomp/
	* plugin/Makefrag.am: Add HSA plugin requirements.
	* plugin/configfrag.ac (HSA_RUNTIME_INCLUDE): New variable.
	(HSA_RUNTIME_LIB): Likewise.
	(HSA_RUNTIME_CPPFLAGS): Likewise.
	(HSA_RUNTIME_INCLUDE): New substitution.
	(HSA_RUNTIME_LIB): Likewise.
	(HSA_RUNTIME_LDFLAGS): Likewise.
	(hsa-runtime): New configure option.
	(hsa-runtime-include): Likewise.
	(hsa-runtime-lib): Likewise.
	(PLUGIN_HSA): New substitution variable.
	Fill HSA_RUNTIME_INCLUDE and HSA_RUNTIME_LIB according to the new
	configure options.
	(PLUGIN_HSA_CPPFLAGS): Likewise.
	(PLUGIN_HSA_LDFLAGS): Likewise.
	(PLUGIN_HSA_LIBS): Likewise.
	Check that we have access to HSA run-time.
	* libgomp-plugin.h (offload_target_type): New element
	OFFLOAD_TARGET_TYPE_HSA.
	* libgomp.h (gomp_target_task): New fields firstprivate_copies and
	args.
	(bool gomp_create_target_task): Updated.
	(gomp_device_descr): Extra parameter of run_func and async_run_func,
	new field can_run_func.
	* libgomp_g.h (GOMP_target_ext): Update prototype.
	* oacc-host.c (host_run): Added a new parameter args.
	* target.c (calculate_firstprivate_requirements): New function.
	(copy_firstprivate_data): Likewise.
	(gomp_target_fallback_firstprivate): Use them.
	(gomp_target_unshare_firstprivate): New function.
	(gomp_get_target_fn_addr): Allow returning NULL for shared memory
	devices.
	(GOMP_target): Do host fallback for all shared memory devices.  Do not
	pass any args to plugins.
	(GOMP_target_ext): Introduce device-specific argument parameter args.
	Allow host fallback if device shares memory.  Do not remap data if
	device has shared memory.
	(gomp_target_task_fn): Likewise.  Also treat shared memory devices
	like host fallback for mappings.
	(GOMP_target_data): Treat shared memory devices like host fallback.
	(GOMP_target_data_ext): Likewise.
	(GOMP_target_update): Likewise.
	(GOMP_target_update_ext): Likewise.  Also pass NULL as args to
	gomp_create_target_task.
	(GOMP_target_enter_exit_data): Likewise.
	(omp_target_alloc): Treat shared memory devices like host fallback.
	(omp_target_free): Likewise.
	(omp_target_is_present): Likewise.
	(omp_target_memcpy): Likewise.
	(omp_target_memcpy_rect): Likewise.
	(omp_target_associate_ptr): Likewise.
	(gomp_load_plugin_for_device): Also load can_run.
	* task.c (GOMP_PLUGIN_target_task_completion): Free
	firstprivate_copies.
	(gomp_create_target_task): Accept new argument args and store it to
	ttask.
	* plugin/plugin-hsa.c: New file.

gcc/
	* Makefile.in (OBJS): Add new source files.
	(GTFILES): Add hsa.c.
	* common.opt (disable_hsa): New variable.
	(-Whsa): New warning.
	* config.in (ENABLE_HSA): New.
	* configure.ac: Treat hsa differently from other accelerators.
	(OFFLOAD_TARGETS): Define ENABLE_OFFLOADING according to
	$enable_offloading.
	(ENABLE_HSA): Define ENABLE_HSA according to $enable_hsa.
	* doc/install.texi (Configuration): Document --with-hsa-runtime,
	--with-hsa-runtime-include, --with-hsa-runtime-lib and
	--with-hsa-kmt-lib.
	* doc/invoke.texi (-Whsa): Document.
	(hsa-gen-debug-stores): Likewise.
	* lto-wrapper.c (compile_images_for_offload_targets): Do not attempt
	to invoke offload compiler for hsa acclerator.
	* opts.c (common_handle_option): Determine whether HSA offloading
	should be performed.
	* params.def (PARAM_HSA_GEN_DEBUG_STORES): New parameter.
	* builtin-types.def (BT_FN_VOID_UINT_PTR_INT_PTR): New.
	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_INT_INT): Removed.
	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_PTR): New.
	* gimple-low.c (lower_stmt): Also handle GIMPLE_OMP_GRID_BODY.
	* gimple-pretty-print.c (dump_gimple_omp_for): Also handle
	GF_OMP_FOR_KIND_GRID_LOOP.
	(dump_gimple_omp_block): Also handle GIMPLE_OMP_GRID_BODY.
	(pp_gimple_stmt_1): Likewise.
	* gimple-walk.c (walk_gimple_stmt): Likewise.
	* gimple.c (gimple_build_omp_grid_body): New function.
	(gimple_copy): Also handle GIMPLE_OMP_GRID_BODY.
	* gimple.def (GIMPLE_OMP_GRID_BODY): New.
	* gimple.h (enum gf_mask): Added GF_OMP_PARALLEL_GRID_PHONY,
	GF_OMP_FOR_KIND_GRID_LOOP, GF_OMP_FOR_GRID_PHONY and
	GF_OMP_TEAMS_GRID_PHONY.
	(gimple_statement_omp_single_layout): Updated comments.
	(gimple_build_omp_grid_body): New function.
	(gimple_has_substatements): Also handle GIMPLE_OMP_GRID_BODY.
	(gimple_omp_for_grid_phony): New function.
	(gimple_omp_for_set_grid_phony): Likewise.
	(gimple_omp_parallel_grid_phony): Likewise.
	(gimple_omp_parallel_set_grid_phony): Likewise.
	(gimple_omp_teams_grid_phony): Likewise.
	(gimple_omp_teams_set_grid_phony): Likewise.
	(gimple_return_set_retbnd): Also handle GIMPLE_OMP_GRID_BODY.
	* omp-builtins.def (BUILT_IN_GOMP_OFFLOAD_REGISTER): New.
	(BUILT_IN_GOMP_OFFLOAD_UNREGISTER): Likewise.
	(BUILT_IN_GOMP_TARGET): Updated type.
	* omp-low.c: Include symbol-summary.h, hsa.h and params.h.
	(adjust_for_condition): New function.
	(get_omp_for_step_from_incr): Likewise.
	(extract_omp_for_data): Moved parts to adjust_for_condition and
	get_omp_for_step_from_incr.
	(build_outer_var_ref): Handle GIMPLE_OMP_GRID_BODY.
	(fixup_child_record_type): Bail out if receiver_decl is NULL.
	(scan_sharing_clauses): Handle OMP_CLAUSE__GRIDDIM_.
	(scan_omp_parallel): Do not create child functions for phony
	constructs.
	(check_omp_nesting_restrictions): Handle GIMPLE_OMP_GRID_BODY.
	(scan_omp_1_op): Checking assert we are not remapping to
	ERROR_MARK.  Also also handle GIMPLE_OMP_GRID_BODY.
	(parallel_needs_hsa_kernel_p): New function.
	(expand_parallel_call): Register apprpriate parallel child
	functions as HSA kernels.
	(grid_launch_attributes_trees): New type.
	(grid_attr_trees): New variable.
	(grid_create_kernel_launch_attr_types): New function.
	(grid_insert_store_range_dim): Likewise.
	(grid_get_kernel_launch_attributes): Likewise.
	(get_target_argument_identifier_1): Likewise.
	(get_target_argument_identifier): Likewise.
	(get_target_argument_value): Likewise.
	(push_target_argument_according_to_value): Likewise.
	(get_target_arguments): Likewise.
	(expand_omp_target): Call get_target_arguments instead of looking
	up for teams and thread limit.
	(grid_expand_omp_for_loop): New function.
	(grid_arg_decl_map): New type.
	(grid_remap_kernel_arg_accesses): New function.
	(grid_expand_target_kernel_body): New function.
	(expand_omp): Call it.
	(lower_omp_for): Do not emit phony constructs.
	(lower_omp_taskreg): Do not emit phony constructs but create for them
	a temporary variable receiver_decl.
	(lower_omp_taskreg): Do not emit phony constructs.
	(lower_omp_teams): Likewise.
	(lower_omp_grid_body): New function.
	(lower_omp_1): Call it.
	(grid_reg_assignment_to_local_var_p): New function.
	(grid_seq_only_contains_local_assignments): Likewise.
	(grid_find_single_omp_among_assignments_1): Likewise.
	(grid_find_single_omp_among_assignments): Likewise.
	(grid_find_ungridifiable_statement): Likewise.
	(grid_target_follows_gridifiable_pattern): Likewise.
	(grid_remap_prebody_decls): Likewise.
	(grid_copy_leading_local_assignments): Likewise.
	(grid_process_kernel_body_copy): Likewise.
	(grid_attempt_target_gridification): Likewise.
	(grid_gridify_all_targets_stmt): Likewise.
	(grid_gridify_all_targets): Likewise.
	(execute_lower_omp): Call grid_gridify_all_targets.
	(make_gimple_omp_edges): Handle GIMPLE_OMP_GRID_BODY.
	* tree-core.h (omp_clause_code): Added OMP_CLAUSE__GRIDDIM_.
	(tree_omp_clause): Added union field dimension.
	* tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE__GRIDDIM_.
	* tree.c (omp_clause_num_ops): Added number of arguments of
	OMP_CLAUSE__GRIDDIM_.
	(omp_clause_code_name): Added name of OMP_CLAUSE__GRIDDIM_.
	(walk_tree_1): Handle OMP_CLAUSE__GRIDDIM_.
	* tree.h (OMP_CLAUSE_GRIDDIM_DIMENSION): New.
	(OMP_CLAUSE_SET_GRIDDIM_DIMENSION): Likewise.
	(OMP_CLAUSE_GRIDDIM_SIZE): Likewise.
	(OMP_CLAUSE_GRIDDIM_GROUP): Likewise.
	* passes.def: Schedule pass_ipa_hsa and pass_gen_hsail.
	* tree-pass.h (make_pass_gen_hsail): Declare.
	(make_pass_ipa_hsa): Likewise.
	* ipa-hsa.c: New file.
	* lto-section-in.c (lto_section_name): Add hsa section name.
	* lto-streamer.h (lto_section_type): Add hsa section.
	* timevar.def (TV_IPA_HSA): New.
        * hsa-brig-format.h: New file.
	* hsa-brig.c: New file.
	* hsa-dump.c: Likewise.
	* hsa-gen.c: Likewise.
	* hsa.c: Likewise.
	* hsa.h: Likewise.
	* toplev.c (compile_file): Call hsa_output_brig.
	* hsa-regalloc.c: New file.

gcc/fortran/
	* types.def (BT_FN_VOID_UINT_PTR_INT_PTR): New.
	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_INT_INT): Removed.
	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_PTR): New.

gcc/lto/
	* lto-partition.c: Include "hsa.h"
	(add_symbol_to_partition_1): Put hsa implementations into the
	same partition as host implementations.

liboffloadmic/
	* plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_async_run): New
	unused parameter.
	(GOMP_OFFLOAD_run): Likewise.

include/
	* gomp-constants.h (GOMP_DEVICE_HSA): New macro.
	(GOMP_VERSION_HSA): Likewise.
	(GOMP_TARGET_ARG_DEVICE_MASK): Likewise.
	(GOMP_TARGET_ARG_DEVICE_ALL): Likewise.
	(GOMP_TARGET_ARG_SUBSEQUENT_PARAM): Likewise.
	(GOMP_TARGET_ARG_ID_MASK): Likewise.
	(GOMP_TARGET_ARG_NUM_TEAMS): Likewise.
	(GOMP_TARGET_ARG_THREAD_LIMIT): Likewise.
	(GOMP_TARGET_ARG_VALUE_SHIFT): Likewise.
	(GOMP_TARGET_ARG_HSA_KERNEL_ATTRIBUTES): Likewise.

From-SVN: r232549
2016-01-19 11:35:10 +01:00
Rainer Orth 01704e5ad9 Only support -gstabs on Mac OS X if assember supports it (PR target/67973)
gcc:
	PR target/67973
	* configure.ac (gcc_cv_as_stabs_directive): New test.
	* configure: Regenerate.
	* config.in: Regenerate.
	* config/darwin.h (DBX_DEBUGGING_INFO): Wrap in
	HAVE_AS_STABS_DIRECTIVE.
	(PREFERRED_DEBUGGING_TYPE): Likewise.
	* config/i386/darwin.h (PREFERRED_DEBUGGING_TYPE): Only include
	DBX_DEBUG if HAVE_AS_STABS_DIRECTIVE.

	* doc/sourcebuild.texi (Effective-Target Keywords, Environment
	attributes): Document stabs.

	gcc/testsuite:
	PR target/67973
	* lib/target-supports.exp (check_effective_target_stabs): New
	proc.
	* g++.dg/cpp0x/alias-decl-debug-0.C: Restrict to stabs targets.
	* g++.dg/other/PR23205.C: Likewise.
	* g++.dg/other/pr23205-2.C: Likewise.
	* gcc.dg/20040813-1.c: Likewise.
	* gcc.dg/darwin-20040809-2.c: Likewise.
	* objc.dg/stabs-1.m: Likewise.

From-SVN: r231747
2015-12-17 09:23:08 +00:00
Aditya Kumar 560d18d3ed update required isl version
we check for a the isl compute timeout function added in isl 0.13.
That means GCC could still be configured with isl 0.13, 0.14, and 0.15.

	* config/isl.m4 (ISL_CHECK_VERSION): Check for
	isl_ctx_get_max_operations.
	* configure: Regenerate.

	gcc/
	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Remove checks for functions that exist in isl 0.13 or
	later.
	* graphite-isl-ast-to-gimple.c: Remove #ifdefs and code for isl 0.12.
        * graphite-optimize-isl.c: Same.
	* graphite-poly.c: Same.
	* graphite-sese-to-poly.c: Same.
	* graphite.h: Add comment for isl 0.14.
	* toplev.c (print_version): Print isl version.

Co-Authored-By: Sebastian Pop <s.pop@samsung.com>

From-SVN: r231706
2015-12-16 17:27:57 +00:00
Dominik Vogt ec47b0863a [PATCH 1/2] S/390: Implement "target" attribute.
gcc/ChangeLog

	* config/s390/s390.opt (s390_arch_string): Remove.
	(s390_tune_string): Likewise.
	(s390_cost_pointer): Add Variable.
	(s390_tune_flags): Add TargetVariable.
	(s390_arch_flags, march=, mbackchain, mdebug, mesa, mhard-dfp),
	(mhard-float, mlong-double-128, mlong-double-64, mhtm, mvx),
	(mpacked-stack, msmall-exec, msoft-float, mstack-guard=, mstack-size=),
	(mtune=, mmvcle, mzvector, mzarch, mbranch-cost=, mwarn-dynamicstack),
	(mwarn-framesize=): Save option.
	(mno-stack-guard, mno-stack-guard): New option.
	(mwarn-dynamicstack): Allow mno-warn-dynamicstack.
	(mwarn-framesize=): Convert to UInteger (negative values are rejected
	now).
	* config/s390/s390-c.c (s390_cpu_cpp_builtins_internal): Split setting
	macros changeable through the GCC target pragma into a separate
	function.
	(s390_cpu_cpp_builtins): Likewise.
	(s390_pragma_target_parse): New function, implement GCC target pragma
	if enabled.
	(s390_register_target_pragmas): Register s390_pragma_target_parse if
	available.
	* common/config/s390/s390-common.c (s390_handle_option):
	Export.
	Move setting s390_arch_flags to s390.c.
	Remove s390_tune_flags.
	Allow 0 as argument to -mstack-size (switch to default value).
	Allow 0 as argument to -mstack-guard (switch off).
	Remove now unnecessary explicit parsing code for -mwarn-framesize.
	* config/s390/s390-protos.h (s390_handle_option): Export.
	(s390_valid_target_attribute_tree): Export.
	(s390_reset_previous_fndecl): Export.
	* config/s390/s390-builtins.def: Use new macro B_GROUP to mark the start
	and end of HTM and VX builtins.
	(s390_asm_output_function_prefix): Declare hook.
	(s390_asm_declare_function_size): Likewise.
	* config/s390/s390-builtins.h (B_GROUP): Use macro.
	* config/s390/s390-opts.h: Add comment about processor_type usage.
	* config/s390/s390.h (TARGET_CPU_IEEE_FLOAT_P, TARGET_CPU_ZARCH_P),
	(TARGET_CPU_LONG_DISPLACEMENT_P, TARGET_CPU_EXTIMM_P, TARGET_CPU_DFP_P),
	(TARGET_CPU_Z10_P, TARGET_CPU_Z196_P, TARGET_CPU_ZEC12_P),
	(TARGET_CPU_HTM_P, TARGET_CPU_Z13_P, TARGET_CPU_VX_P),
	(TARGET_HARD_FLOAT_P, TARGET_LONG_DISPLACEMENT_P, TARGET_EXTIMM_P),
	(TARGET_DFP_P, TARGET_Z10_P, TARGET_Z196_P, TARGET_ZEC12_P),
	(TARGET_HTM_P, TARGET_Z13_P, TARGET_VX_P, TARGET_CPU_EXTIMM),
	(TARGET_CPU_DFP, TARGET_CPU_Z10, TARGET_CPU_Z196, TARGET_CPU_ZEC12),
	(TARGET_CPU_HTM, TARGET_CPU_Z13, TARGET_LONG_DISPLACEMENT),
	(TARGET_EXTIMM, TARGET_DFP, TARGET_Z10, TARGET_Z196, TARGET_ZEC12),
	(TARGET_Z13, TARGET_VX, S390_USE_TARGET_ATTRIBUTE),
	(S390_USE_ARCHITECTURE_MODIFIERS, SWITCHABLE_TARGET),
	(ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_FUNCTION_PREFIX): Likewise.
	* config/s390/vecintrin.h: Use vector definitions even if __VEC__ is
	undefined.
	(vec_all_nan): Rewrite as macro using statement expressions to avoid
	that the vector keyword needs to be defined when including the file.
	(vec_all_numeric): Likewise.
	(vec_any_nan): Likewise.
	(vec_any_numeric):  Likewise.
	* config/s390/s390.c (s390_previous_fndecl): New static variable.
	(s390_set_current_function): New function.
	(s390_cost): Wrapper macro to allow defining the cost table pointer in
	the options file.
	(processor_table): Table for march= and mtune= parsing.
	(s390_init_builtins): Enable all builtins and types unconditionally.
	(s390_expand_builtin): Generate an error message if builtin is not
	supported by current options.
	Correct an error message.
	(s390_function_specific_restore): New function to set s390_cost.
	(s390_asm_output_machine_for_arch): New function for emitting .machine
	and .machinmode directives to the assembler file.
	(s390_asm_output_function_prefix): Likewise.
	(s390_asm_declare_function_size):  Likewise.
	(s390_asm_output_function_label): Add mdebug output for feature testing.
	(s390_option_override): Move implementation into internal function.
	(s390_option_override_internal): Likewise.
	Implement option overriding based on current options.
	(s390_valid_target_attribute_inner_p): New function implementing target
	attribute logic.
	(s390_valid_target_attribute_tree): Likewise.
	(s390_valid_target_attribute_p): Likewise.
	(s390_reset_previous_fndecl): Likewise.
	(s390_set_current_function): Likewise.
	(TARGET_SET_CURRENT_FUNCTION): Provide target hook function.
	(TARGET_OPTION_VALID_ATTRIBUTE_P): Likewise.
	(TARGET_OPTION_RESTORE): Likewise.
	* doc/extend.texi: S390: Document target attribute and pragma.
	* config.in: Regenerated.
	* configure: Regenerated.
	* configure.ac: S390: Check for .machinemode and .machine in gas.
	S390: Check for architecture modifiers support in gas.

gcc/testsuite/ChangeLog

	* gcc.target/s390/asm-machine-1.c: New test.
	* gcc.target/s390/asm-machine-2.c: New test.
	* gcc.target/s390/asm-machine-3.c: New test.
	* gcc.target/s390/asm-machine-4.c: New test.
	* gcc.target/s390/target-attribute/tattr-1.c: New test.
	* gcc.target/s390/target-attribute/tattr-2.c: New test.
	* gcc.target/s390/target-attribute/tattr-3.c: New test.
	* gcc.target/s390/target-attribute/tattr-4.c: New test.
	* gcc.target/s390/target-attribute/tattr-5.c: New test.
	* gcc.target/s390/target-attribute/tattr-6.c: New test.
	* gcc.target/s390/target-attribute/tattr-7.c: New test.
	* gcc.target/s390/target-attribute/tattr-8.c: New test.
	* gcc.target/s390/target-attribute/tattr-9.c: New test.
	* gcc.target/s390/target-attribute/tattr-10.c: New test.
	* gcc.target/s390/target-attribute/tattr-11.c: New test.
	* gcc.target/s390/target-attribute/tattr-12.c: New test.
	* gcc.target/s390/target-attribute/tattr-13.c: New test.
	* gcc.target/s390/target-attribute/tattr-14.c: New test.
	* gcc.target/s390/target-attribute/tattr-15.c: New test.
	* gcc.target/s390/target-attribute/tattr-16.c: New test.
	* gcc.target/s390/target-attribute/tattr-17.c: New test.
	* gcc.target/s390/target-attribute/tattr-18.c: New test.
	* gcc.target/s390/target-attribute/tattr-19.c: New test.
	* gcc.target/s390/target-attribute/tattr-arch-tune-1.c: New test.
	* gcc.target/s390/target-attribute/tattr-arch-tune-2.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-1.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-2.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-3.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-4.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-5.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-6.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-7.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-8.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-9.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-10.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-11.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-12.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-13.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-14.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-15.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-16.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-17.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-18.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-19.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-20.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-21.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-22.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-23.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-24.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-25.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-26.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-27.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-28.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-29.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-30.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-31.c: New test.
	* gcc.target/s390/target-attribute/tattr-m31-32.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-1.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-2.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-3.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-4.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-5.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-6.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-7.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-8.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-9.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-10.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-11.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-12.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-13.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-14.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-15.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-16.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-17.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-18.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-19.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-20.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-21.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-22.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-23.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-24.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-25.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-26.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-27.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-28.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-29.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-30.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-31.c: New test.
	* gcc.target/s390/target-attribute/tattr-m64-32.c: New test.
	* gcc.target/s390/target-attribute/tpragma-struct-vx-2.c: New test.
	* gcc.target/s390/s390.exp (check_effective_target_target_attribute):
	Add check whether target attribute is available.
	Run test in target-attribute subdir.
	* gcc.target/s390/s390-c++.exp
	(check_effective_target_target_attribute): Likewise.

From-SVN: r231271
2015-12-04 14:30:42 +00:00
Ulrich Weigand 157bb85d48 configure.ac: Check assembler support for R_PPC64_ENTRY relocation.
* configure.ac: Check assembler support for R_PPC64_ENTRY relocation.
	* configure: Regenerate.
	* config.in: Regenerate.
	* config/rs6000/rs6000.c (rs6000_global_entry_point_needed_p): New
	function.
	(rs6000_output_function_prologue): Use it instead of checking
	cfun->machine->r2_setup_needed.  Use internal labels instead of
	GNU as local label extension.  Handle ELFv2 large code model.
	(rs6000_output_mi_thunk): Do not set cfun->machine->r2_setup_needed.
	(rs6000_elf_declare_function_name): Handle ELFv2 large code model.

From-SVN: r231202
2015-12-02 19:52:53 +00:00
Michael Meissner d1f0d3769e rs6000.opt (-mpower9-fusion): Add new switches for ISA 3.0 (power9).
2015-11-09  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* config/rs6000/rs6000.opt (-mpower9-fusion): Add new switches for
	ISA 3.0 (power9).
	(-mpower9-vector): Likewise.
	(-mpower9-dform): Likewise.
	(-mpower9-minmax): Likewise.
	(-mtoc-fusion): Likewise.
	(-mmodulo): Likewise.
	(-mfloat128-hardware): Likewise.

	* config/rs6000/rs6000-cpus.def (ISA_3_0_MASKS_SERVER): Add option
	mask for ISA 3.0 (power9).
	(POWERPC_MASKS): Add new ISA 3.0 switches.
	(power9 cpu): Add power9 cpu.

	* config/rs6000/rs6000.h (ASM_CPU_POWER9_SPEC): Add support for
	power9.
	(ASM_CPU_SPEC): Likewise.
	(EXTRA_SPECS): Likewise.

	* config/rs6000/rs6000-opts.h (enum processor_type): Add
	PROCESSOR_POWER9.

	* config/rs6000/rs6000.c (power9_cost): Initial cost setup for
	power9.
	(rs6000_debug_reg_global): Add support for power9 fusion.
	(rs6000_setup_reg_addr_masks): Cache mode size.
	(rs6000_option_override_internal): Until real power9 tuning is
	added, use -mtune=power8 for -mcpu=power9.
	(rs6000_setup_reg_addr_masks): Do not allow pre-increment,
	pre-decrement, or pre-modify on SFmode/DFmode if we allow the use
	of Altivec registers.
	(rs6000_option_override_internal): Add support for ISA 3.0
	switches.
	(rs6000_loop_align): Add support for power9 cpu.
	(rs6000_file_start): Likewise.
	(rs6000_adjust_cost): Likewise.
	(rs6000_issue_rate): Likewise.
	(insn_must_be_first_in_group): Likewise.
	(insn_must_be_last_in_group): Likewise.
	(force_new_group): Likewise.
	(rs6000_register_move_cost): Likewise.
	(rs6000_opt_masks): Likewise.

	* config/rs6000/rs6000.md (cpu attribute): Add power9.
	* config/rs6000/rs6000-tables.opt: Regenerate.

	* config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Define
	_ARCH_PWR9 if power9 support is available.

	* config/rs6000/aix61.h (ASM_CPU_SPEC): Add power9.
	* config/rs6000/aix53.h (ASM_CPU_SPEC): Likewise.

	* configure.ac: Determine if the assembler supports the ISA 3.0
	instructions.
	* config.in (HAVE_AS_POWER9): Likewise.
	* configure: Regenerate.

	* doc/invoke.texi (RS/6000 and PowerPC Options): Document ISA 3.0
	switches.

From-SVN: r230031
2015-11-09 16:56:22 +00:00
Rainer Orth e6b6bf09dd Support init priority on Solaris
libgcc:
	* config/ia64/crtbegin.S: Check HAVE_INITFINI_ARRAY_SUPPORT
	value.
	* config/ia64/crtend.S: Likewise.

	gcc:
	* acinclude.m4 (gcc_AC_INITFINI_ARRAY): Allow for differences in
	assembler syntax.
	Support Solaris ld.
	Define HAVE_INITFINI_ARRAY_SUPPORT as 0/1.

	* config/sol2.h (SUPPORTS_INIT_PRIORITY): Define to
	HAVE_INITFINI_ARRAY_SUPPORT.
	* config/initfini-array.h: Check HAVE_INITFINI_ARRAY_SUPPORT
	value.

	* configure.ac (gcc_cv_as_sparc_nobits): Remove.
	* config/sparc/sparc.c (sparc_solaris_elf_asm_named_section):
	Don't check HAVE_AS_SPARC_NOBITS.
	Heed SECTION_NOTYPE.

	* configure: Regenerate.
	* config.in: Regenerate.

From-SVN: r230013
2015-11-09 11:33:30 +00:00
Mikhail Maltsev a6c764d02e ENABLE_CHECKING refactoring: remove remaining occurrences
libcpp/

	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Remove ENABLE_CHECKING.

gcc/

	* cfganal.c (inverted_post_order_compute): Remove conditional
	compilation, use flag_checking.
	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Remove ENABLE_CHECKING.
	* genconditions.c: Do not #undef ENABLE_CHECKING.
	* sese.h (bb_in_region): Comment out broken check.
	* tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa_1): Remove
	conditional compilation, use flag_checking.

From-SVN: r229758
2015-11-04 15:01:46 +00:00
Mikhail Maltsev 7ec491c07b [PATCH 1/9] ENABLE_CHECKING refactoring
gcc/
	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac (CHECKING_P): Define.
	* system.h: Use CHECKING_P.

libcpp/
	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac (CHECKING_P): Define.
	* system.h (fancy_abort): Declare.
	(abort): Define.
	(gcc_assert): Define. Use CHECKING_P.

From-SVN: r229149
2015-10-21 15:16:31 -06:00
Lynn Boger 402565b61f re PR go/66870 (split stack issues on ppc64le and ppc64)
PR target/66870
	* config/rs6000/sysv4.h (TARGET_CAN_SPLIT_STACK_64BIT): Define.
	* configure.ac: Define HAVE_GOLD_ALTERNATE_SPLIT_STACK on Power
	based on gold linker version.
	* gcc.c: Add -fuse-ld=gold to STACK_SPLIT_SPEC if
	HAVE_GOLD_ALTERNATE_SPLIT_STACK defined.
	* configure, config.in: Regenerate.
go:
	* gospec.c (lang_specific_driver): Set appropriate split stack
	options for 64 bit compiles based on TARGET_CAN_SPLIT_STACK_64BIT.

From-SVN: r228311
2015-09-30 23:06:11 +00:00
Rainer Orth df2a1cc48b Support PIE on Solaris
gcc/testsuite:
	* lib/target-supports.exp (check_effective_target_pie): Check for
	PIE support on Solaris 11.x and 12.

	libgcc:
	* config.host (*-*-solaris2*): Add t-crtstuff-pic to tmake_file.
	Add crtbeginS.o, crtendS.o to extra_parts if libgcc_cv_solaris_crts.
	* config/sol2/gmon.c: (monstartup): Don't write trailing NUL of
	messages.
	(internal_mcount): Likewise.
	* config/sol2/t-sol2 (crtp.o, crtpg.o, gmon.o): Compile with
	crt_compile, add CRTSTUFF_T_CFLAGS_S.

	gcc:
	* configure.ac (gcc_cv_ld_pie): Check for gld >= 2.26 on Solaris.
	Check for ld -type pie on Solaris 11.x and 12.
	* configure: Regenerate.
	* config.in: Regenerate.

	* gcc.c (LD_PIE_SPEC): Allow redefinition.

	* config/sol2.h (STARTFILE_CRTBEGIN_SPEC): Define.
	(STARTFILE_SPEC): Use it.
	(ENDFILE_CRTEND_SPEC): Define.
	(ENDFILE_SPEC): Use it and ENDFILE_ARCH_SPEC.
	(SUBTARGET_EXTRA_SPECS): Add STARTFILE_CRTBEGIN_SPEC,
	ENDFILE_ARCH_SPEC, ENDFILE_CRTEND_SPEC.
	[HAVE_LD_PIE && HAVE_SOLARIS_CRTS] (LD_PIE_SPEC): Define.
	(!(HAVE_LD_PIE && HAVE_SOLARIS_CRTS)] (LINK_PIE_SPEC): Define.
	* config/i386/sol2.h (ENDFILE_SPEC): Remove.
	(ENDFILE_ARCH_SPEC): Define.
	* config/sparc/sol2.h (ENDFILE_ARCH_SPEC): Define.

From-SVN: r228078
2015-09-24 09:00:22 +00:00
Rainer Orth 2d11044217 Use CRTs provided by Solaris
gcc:
	* configure.ac (gcc_cv_solaris_crts): New test.
	* configure. Regenerate.
	* config.in: Regenerate.
	* config/sol2.h (STARTFILE_SPEC): Simplify, provide
	HAVE_SOLARIS_CRTS variant.

	libgcc:
	* configure.ac (libgcc_cv_solaris_crts): New test.
	* configure: Regenerate.
	* config.in: Regenerate.
	* config/sol2/crtp.c, config/sol2/crtpg.c: New files.
	* config/gmon-sol2.c: Rename to ...
	* config/sol2/gmon.c: ... this.
	Include auto-target.h.
	(internal_mcount): Wrap setup handling in !HAVE_SOLARIS_CRTS.
	* config/t-sol2: Rename to ...
	* config/sol2/t-sol2: ... this.
	(gmon.o): Reflect renaming.
	(crtp.o, crtpg.o): New rules.
	* config.host (*-*-solaris2*): Reflect renaming.
	Use system CRTs if present.
	Remove default CRT case.

From-SVN: r228077
2015-09-24 08:51:39 +00:00
Thomas Schwinge 64186aad5a Fix --enable-offload-targets/-foffload handling, pt. 1
gcc/
	* configure.ac (offload_targets, OFFLOAD_TARGETS): Separate
	offload targets by commas, not colons.
	* config.in: Regenerate.
	* configure: Likewise.
	* gcc.c (driver::maybe_putenv_COLLECT_LTO_WRAPPER): Due to that,
	instead of setting up the default offload targets here...
	(process_command): ..., do it here.
	libgomp/
	* plugin/configfrag.ac (OFFLOAD_TARGETS): Clarify that offload
	targets are separated by commas.
	* config.h.in: Regenerate.

From-SVN: r228053
2015-09-23 16:52:50 +02:00
John David Anglin 297c364d7c re PR bootstrap/67363 (r227188 breaks build for mingw-w64)
PR bootstrap/67363
	* configure.ac: Check if setenv and unsetenv are declared.
	* configure: Rebuild.
	* config.in: Rebuild.
	* system.h: Declare setenv and unsetenv if not declared.

From-SVN: r227666
2015-09-10 22:52:08 +00:00
Sebastian Pop 6b3ebcdda1 fix PR53852: stop ISL after a given number of operations
2015-09-02  Sebastian Pop  <s.pop@samsung.com>

            * config.in: Regenerate.
            * configure: Regenerate.
            * configure.ac (HAVE_ISL_CTX_MAX_OPERATIONS): Detect.
            * graphite-optimize-isl.c (optimize_isl): Stop computation when
            PARAM_MAX_ISL_OPERATIONS is reached.
            * params.def (PARAM_MAX_ISL_OPERATIONS): Add.

            * graphite-dependences.c (extend_schedule): Remove gcc_asserts on
            result equal to isl_stat_ok as the status now can be isl_error_quota.
            (subtract_commutative_associative_deps): Same.
            (compute_deps): Same.

testsuite/
            * gcc.dg/graphite/uns-interchange-12.c: Adjust pattern to pass with
            both isl-0.12 and isl-0.15.
            * gcc.dg/graphite/uns-interchange-14.c: Same.
            * gcc.dg/graphite/uns-interchange-15.c: Same.
            * gcc.dg/graphite/uns-interchange-mvt.c: Same.

From-SVN: r227572
2015-09-09 04:20:47 +00:00
Magnus Granberg e0f6cba004 common.opt (fstack-protector): Initialize to -1.
* common.opt (fstack-protector): Initialize to -1.
        (fstack-protector-all): Likewise.
        (fstack-protector-strong): Likewise.
        (fstack-protector-explicit): Likewise.
        * configure.ac: Add --enable-default-ssp.
        * defaults.h (DEFAULT_FLAG_SSP): New.  Default SSP to strong.
        * opts.c (finish_options): Update opts->x_flag_stack_protect if it is
        -1.
        * doc/install.texi: Document --enable-default-ssp.
        * config.in: Regenerated.
        * configure: Likewise.

        * lib/target-supports.exp
        (check_effective_target_fstack_protector_enabled): New test.
        * gcc.target/i386/ssp-default.c: New test.

From-SVN: r227017
2015-08-19 16:07:06 -06:00
Sebastian Pop 8d2ccbd266 remove tree-browser
* Makefile.in: Remove use of TREEBROWSER.
	* config.in: Regenerated.
	* configure: Regenerated.
	* configure.ac: Remove definition of TREEBROWSER.
	* tree-browser.c: Removed.
	* tree-browser.def: Removed.

From-SVN: r226214
2015-07-25 09:29:11 +00:00
Mike Frysinger 324000329b configure.ac: Add check for new options in isl-0.15.
* configure.ac: Add check for new options in isl-0.15.
	* config.in, configure: Rebuilt.
	* graphite-blocking.c: Include <isl/constraint.h>
	* graphite-interchange.c,  graphite-poly.c: Likewise.
	* graphhite-scop-detection.c, graphite-sese-to-poly.c: Likewise.
	* graphite.c: Likewise.
	* graphite-isl-ast-to-gimple.c: Include <isl/constraint.h> and
	<isl/union_set.h>.
	* graphite-dependences.c: Include <isl/constraint.h>.
	(max_number_of_out_dimensions): Returns isl_stat.
	(extend_schedule_1): Likewise
	(extend_schedule): Corresponding changes.
	* graphite-optimize-isl.c: Include <isl/constraint.h> and
	<isl/union_set.h>.
	(getSingleMap): Change return type of isl_stat.
	(optimize_isl): Conditionally use
	isl_options_set_schedule_serialize_sccs.
	* graphite-poly.h (isl_stat, isl_stat_ok): Define fallbacks
	if not HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS.

Co-Authored-By: Bernhard Reutner-Fischer <aldot@gcc.gnu.org>

From-SVN: r226050
2015-07-21 12:33:35 -06:00
Ilya Enkovich 6de59c8aaa linux-common.h (LINK_MPX): New.
gcc/

	* config/i386/linux-common.h (LINK_MPX): New.
	(MPX_SPEC): Use LINK_MPX instead of %(link_mpx).
	* configure.ac: Add HAVE_LD_BNDPLT_SUPPORT macro
	indicating '-z bndplt' support by linker.
	* configure: Regenerate.
	* config.in: Regenerate.

libmpx/

	* configure.ac: Remove link_mpx.
	* libmpx.spec.in: Likewise.
	* configure: Regenerate.

From-SVN: r225862
2015-07-16 08:36:02 +00:00
Jiong Wang 34ecdb0f20 [AArch64] Fall back to -fPIC if no support of -fpic in binutils
2015-07-01  Jiong Wang  <jiong.wang@arm.com>

	* configure.ac: Add check for aarch64 assembler -fpic relocation
	modifier support.
	* configure: Regenerate.
	* config.in: Regenerate.
	* config/aarch64/aarch64.c (initialize_aarch64_code_model): Fall back
	to -fPIC if not support of -fpic relocation modifier in assembler.

From-SVN: r225231
2015-07-01 08:45:08 +00:00
Andreas Tobler 418dd5cefe read-rtl.c: Adapt to use HAVE_DECL_ATOLL instead of HAVE_ATOLL.
2015-06-01  Andreas Tobler  <andreast@gcc.gnu.org>

    * read-rtl.c: Adapt to use HAVE_DECL_ATOLL instead of HAVE_ATOLL.
    * config.in: Regenerate.

From-SVN: r223996
2015-06-01 21:46:17 +02:00
H.J. Lu 428b381275 Add --enable-default-pie option to GCC configure
Add --enable-default-pie option to configure GCC to generate PIE by
default.

gcc/

	* Makefile.in (COMPILER): Add @NO_PIE_CFLAGS@.
	(BUILD_CFLAGS): Likewise.
	(BUILD_CXXFLAGS): Likewise.
	(LINKER): Add @NO_PIE_FLAG@.
	(BUILD_LDFLAGS): Likewise.
	(libgcc.mvars): Set NO_PIE_CFLAGS to -fno-PIE for
	--enable-default-pie.
	* common.opt (fPIE): Initialize to -1.
	(fpie): Likewise.
	(no-pie): New option.
	(pie): Replace "Negative(shared)" with "Negative(no-pie)".
	* configure.ac: Add --enable-default-pie.
	(NO_PIE_CFLAGS): New.  Check if -fno-PIE works.  AC_SUBST.
	(NO_PIE_FLAG): New.  Check if -no-pie works.  AC_SUBST.
	* defaults.h (DEFAULT_FLAG_PIE): New.  Default PIE to -fPIE.
	* gcc.c (NO_PIE_SPEC): New.
	(PIE_SPEC): Likewise.
	(NO_FPIE1_SPEC): Likewise.
	(FPIE1_SPEC): Likewise.
	(NO_FPIE2_SPEC): Likewise.
	(FPIE2_SPEC): Likewise.
	(NO_FPIE2_SPEC): Likewise.
	(FPIE_SPEC): Likewise.
	(NO_FPIE_SPEC): Likewise.
	(NO_FPIC1_SPEC): Likewise.
	(FPIC1_SPEC): Likewise.
	(NO_FPIC2_SPEC): Likewise.
	(FPIC2_SPEC): Likewise.
	(NO_FPIC2_SPEC): Likewise.
	(FPIC_SPEC): Likewise.
	(NO_FPIC_SPEC): Likewise.
	(NO_FPIE1_AND_FPIC1_SPEC): Likewise.
	(FPIE1_OR_FPIC1_SPEC): Likewise.
	(NO_FPIE2_AND_FPIC2_SPEC): Likewise.
	(FPIE2_OR_FPIC2_SPEC): Likewise.
	(NO_FPIE_AND_FPIC_SPEC): Likewise.
	(FPIE_OR_FPIC_SPEC): Likewise.
	(LD_PIE_SPEC): Likewise.
	(LINK_PIE_SPEC): Handle -no-pie.  Use PIE_SPEC and LD_PIE_SPEC.
	* opts.c (finish_options): Update opts->x_flag_pie if it is -1.
	* config/darwin.h (PIE_SPEC): Renamed to ...
	(DARWIN_PIE_SPEC): This.
	(LINK_SPEC): Replace PIE_SPEC with DARWIN_PIE_SPEC.
	* config/darwin9.h (PIE_SPEC): Renamed to ...
	(DARWIN_PIE_SPEC): This.
	* config/gnu-user.h (GNU_USER_TARGET_STARTFILE_SPEC): Use
	PIE_SPEC and NO_PIE_SPEC if HAVE_LD_PIE is defined.
	* config/openbsd.h (ASM_SPEC): Use FPIE1_OR_FPIC1_SPEC and
	FPIE2_OR_FPIC2_SPEC.
	* config/m68k/netbsd-elf.h (ASM_SPEC): Likewise.
	* config/m68k/openbsd.h (ASM_SPEC): Likewise.
	* gcc/config/sol2.h (ASM_PIC_SPEC): Likewise.
	* config/arm/freebsd.h (SUBTARGET_EXTRA_ASM_SPEC): Likewise.
	* config/arm/netbsd-elf.h (SUBTARGET_EXTRA_ASM_SPEC): Likewise.
	* config/arm/semi.h (SUBTARGET_EXTRA_ASM_SPEC): Likewise.
	* config/cris/linux.h (CRIS_ASM_SUBTARGET_SPEC): Likewise.
	* config/m32r/m32r.h (ASM_SPEC): Likewise.
	* config/m68k/uclinux.h (DRIVER_SELF_SPECS): Likewise.
	* config/rs6000/linux64.h (ASM_SPEC32): Likewise.
	* config/rs6000/sysv4.h (ASM_SPEC): Likewise.
	* config/sparc/freebsd.h (ASM_SPEC): Likewise.
	* config/sparc/linux.h (ASM_SPEC): Likewise.
	* config/sparc/linux64.h (ASM_SPEC): Likewise.
	* config/sparc/netbsd-elf.h (ASM_SPEC): Likewise.
	* config/sparc/openbsd64.h (ASM_SPEC): Likewise.
	* config/sparc/sp-elf.h (ASM_SPEC): Likewise.
	* config/sparc/sp64-elf.h (ASM_SPEC): Likewise.
	* config/sparc/sparc.h (ASM_SPEC): Likewise.
	* config/sparc/sysv4.h (ASM_SPEC): Likewise.
	* config/sparc/vxworks.h (ASM_SPEC): Likewise.
	* config/c6x/elf-common.h (ASM_SPEC): Use NO_FPIC2_SPEC,
	FPIC2_SPEC, FPIC1_SPEC and FPIC2_SPEC.
	* config/c6x/uclinux-elf.h (LINK_SPEC): Use FPIE_SPEC.
	* config/frv/frv.h (DRIVER_SELF_SPECS): Use FPIC_SPEC,
	NO_FPIC_SPEC and NO_FPIE1_AND_FPIC1_SPEC.
	(ASM_SPEC): Use FPIE1_OR_FPIC1_SPEC and FPIE2_OR_FPIC2_SPEC.
	* config/m68k/m68k.h (ASM_PCREL_SPEC): Use FPIC_SPEC and
	NO_FPIC_SPEC.
	* config/mips/gnu-user.h (NO_SHARED_SPECS): Use
	NO_FPIE_AND_FPIC_SPEC.
	* config/mips/vxworks.h (SUBTARGET_ASM_SPEC): Use FPIC_SPEC.
	* config/rs6000/freebsd64.h (ASM_SPEC32): Likewise.
	* config/rs6000/vxworks.h (ASM_SPEC): Likewise.
	* config/vax/linux.h (ASM_SPEC): Likewise.
	* doc/install.texi: Document --enable-default-pie.
	* doc/invoke.texi: Document -no-pie.
	* config.in: Regenerated.
	* configure: Likewise.

gcc/ada/

	* gcc-interface/Makefile.in (TOOLS_LIBS): Add @NO_PIE_FLAG@.

libgcc/

	* Makefile.in (CRTSTUFF_CFLAGS): Add $(NO_PIE_CFLAGS).

From-SVN: r223796
2015-05-27 19:36:55 -07:00
Alan Modra 3954ead0d8 re PR target/65810 (powerpc64 alignment of r2 insufficient for loading long-double constants)
PR target/65810
	* config/rs6000/rs6000.c (POWERPC64_TOC_POINTER_ALIGNMENT): Define.
	(offsettable_ok_by_alignment): Use minimum of decl and toc
	pointer alignment.  Replace dead code with assertion.
	(use_toc_relative_ref): Add mode arg.  Return false in -mcmodel=medium
	case if size exceeds toc pointer alignment.
	(rs6000_legitimize_reload_address): Update use_toc_relative_ref call.
	(rs6000_emit_move): Likewise.
	* configure.ac: Add linker toc pointer alignment check.
	* configure: Regenerate.
	* config.in: Regenerate.

From-SVN: r222498
2015-04-28 13:17:19 +09:30
Georg-Johann Lay 0c9dc4ae59 re PR target/65296 ([avr] fix various issues with specs file generation)
gcc/
	PR target/65296
	* configure.ac [avr]: Check as for options -mrmw, --mlink-relax.
	* configure: Regenerate.
	* config.in: Regenerate.
	* doc/invoke.texi (AVR Options) [-mrmw]: Document it.
	[-mn-flash]: Document it.
	[__AVR_ARCH__]: Document avrtiny.
	* config/avr/gen-avr-mmcu-specs.c (config.h): Include it.
	(*asm_relax): Only define spec if HAVE_AS_AVR_MLINK_RELAX_OPTION.
	(*asm_rmw): Only define spec if HAVE_AS_AVR_MRMW_OPTION.
gcc/testsuite/
	PR target/65296
	* gcc.target/avr/tiny-memx: Use -mmcu instead of -march.
	* gcc.target/avr/tiny-caller-save.c: Same.

From-SVN: r221355
2015-03-11 18:51:09 +00:00
Trevor Saunders 3705004557 Support gcov-tool without ftw.h
gcc/

	PR gcov-profile/61889
	* config.in: regenerate.
	* configure.in: Likewise.
	* configure.ac: Check for ftw.h.
	* gcov-tool.c: Check for ftw.h before using nftw.

From-SVN: r220566
2015-02-10 03:40:20 +00:00
Sriraman Tallam 77ad54d911 x86-64: Optimize access to globals in PIE with copy reloc
Normally, with -fPIE/-fpie, GCC accesses globals that are extern to the
module using the GOT.  This is two instructions, one to get the address
of the global from the GOT and the other to get the value.  If it turns
out that the global gets defined in the executable at link-time, it still
needs to go through the GOT as it is too late then to generate a direct
 access.

Examples:

foo.cc
------
int a_glob;
int main () {
  return a_glob; // defined in this file
}

With -O2 -fpie -pie, the generated code directly accesses the global via
PC-relative insn:

5e0   <main>:
   mov    0x165a(%rip),%eax        # 1c40 <a_glob>

foo.cc
------

extern int a_glob;
int main () {
  return a_glob; // defined in this file
}

With -O2 -fpie -pie, the generated code accesses global via GOT using
two memory loads:

6f0  <main>:
   mov    0x1609(%rip),%rax   # 1d00 <_DYNAMIC+0x230>
   mov    (%rax),%eax

This is true even if in the latter case the global was defined in the
executable through a different file.

Some experiments on google benchmarks shows that the extra memory loads
affects performance by 1% to 5%.

Solution - Copy Relocations:

When the linker supports copy relocations, GCC can always assume that
the global will be defined in the executable.  For globals that are truly
extern (come from shared objects), the linker will create copy relocations
and have them defined in the executable. Result is that no global access
needs to go through the GOT and hence improves performance.

This optimization only applies to undefined, non-weak global data.
Undefined, weak global data access still must go through the GOT.

This patch checks if linker supports PIE with copy reloc, which is
enabled in gold and bfd linker in bininutils 2.25, at configure time
and enables this optimization if the linker support is available.

gcc/

	* configure.ac (HAVE_LD_PIE_COPYRELOC): Defined to 1 if
	Linux/x86-64 linker supports PIE with copy reloc.
	* config.in: Regenerated.
	* configure: Likewise.

	* config/i386/i386.c (legitimate_pic_address_disp_p): Allow
	pc-relative address for undefined, non-weak, non-function
	symbol reference in 64-bit PIE if linker supports PIE with
	copy reloc.

	* doc/sourcebuild.texi: Document pie_copyreloc target.

gcc/testsuite/

	* gcc.target/i386/pie-copyrelocs-1.c: New test.
	* gcc.target/i386/pie-copyrelocs-2.c: Likewise.
	* gcc.target/i386/pie-copyrelocs-3.c: Likewise.
	* gcc.target/i386/pie-copyrelocs-4.c: Likewise.

	* lib/target-supports.exp (check_effective_target_pie_copyreloc):
	New procedure.

Co-Authored-By: H.J. Lu <hongjiu.lu@intel.com>

From-SVN: r218397
2014-12-04 11:40:50 -08:00
Tobias Burnus 797d88589e re PR middle-end/64017 (Support ISL 0.14.0 (to fix ICE with gfortran.dg/graphite/pr42393.f90))
2014-12-01  Tobias Burnus  <burnus@net-b.de>
            Jack Howarth  <howarth@bromo.med.uc.edu>

        PR middle-end/64017
        * configure.ac
        * (ac_has_isl_schedule_constraints_compute_schedule):
        New check.
        * doc/install.texi (ISL): Permit ISL 0.14.
        * graphite-optimize-isl.c (getScheduleForBandList,
        * optimize_isl):
        Conditionally use ISL 0.13+ functions.
        * graphite-interchange.c: Make 'extern "C"' conditional.
        * graphite-isl-ast-to-gimple.c: Ditto.
        * graphite-poly.c: Ditto.
        * graphite-sese-to-poly.c: Ditto.
        * config.in: Regenerate.
        * gcc/configure: Regenerate.


Co-Authored-By: Jack Howarth <howarth@bromo.med.uc.edu>

From-SVN: r218247
2014-12-01 20:07:37 +01:00
John David Anglin 2d3a20632b re PR other/63694 (Build error compiling asan.c: strtoull undeclared)
PR other/63694
	* libiberty/configure.ac: Check for strtol, strtoul, strtoll and strtoull
	declarations.
	* libiberty/configure: Regenerated.
	* gcc/configure.ac: Check for strtol, strtoul, strtoll and strtoull
	declarations.
	* gcc/configure: Regenerated.
	* gcc/config.in: Regenerated.

From-SVN: r217972
2014-11-22 20:53:36 +00:00
Jakub Jelinek 899c78aee8 configure.ac (--with-diagnostics-color): New configure option, default to --with-diagnostics-color=auto.
* configure.ac (--with-diagnostics-color): New configure
	option, default to --with-diagnostics-color=auto.
	* toplev.c (process_options): Use DIAGNOSTICS_COLOR_DEFAULT
	to determine -fdiagnostics-color= option default.
	* doc/invoke.texi (-fdiagnostics-color=): Document new
	default.
	* configure: Regenerated.
	* config.in: Regenerated.

From-SVN: r217540
2014-11-14 08:30:27 +01:00
Bernd Schmidt 85c64bbee9 [PATCH 1/7] OpenMP 4.0 offloading infrastructure: configure and make
* configure: Regenerate.
	* configure.ac (--enable-as-accelerator-for)
	(--enable-offload-targets): New configure options.
gcc/
	* Makefile.in (real_target_noncanonical, accel_dir_suffix)
	(enable_as_accelerator): New variables substituted by configure.
	(libsubdir, libexecsubdir, unlibsubdir): Tweak for the possibility of
	being configured as an offload compiler.
	(DRIVER_DEFINES): Pass new defines DEFAULT_REAL_TARGET_MACHINE and
	ACCEL_DIR_SUFFIX.
	(install-cpp, install-common, install_driver, install-gcc-ar): Do not
	install for the offload compiler.
	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac (real_target_noncanonical, accel_dir_suffix)
	(enable_as_accelerator): Compute new variables.
	(ACCEL_COMPILER): Define if the compiler is built as the accel compiler.
	(OFFLOAD_TARGETS): List of target names suitable for offloading.
	(ENABLE_OFFLOADING): Define if list of offload targets is not empty.
gcc/cp/
	* Make-lang.in (c++.install-common): Do not install for the offload
	compiler.
gcc/doc/
	* install.texi (Options specification): Document
	--enable-as-accelerator-for and --enable-offload-targets.
gcc/fortran/
	* Make-lang.in (fortran.install-common): Do not install for the offload
	compiler.
libgcc/
	* Makefile.in (crtoffloadbegin$(objext)): New rule.
	(crtoffloadend$(objext)): Likewise.
	* configure: Regenerate.
	* configure.ac (accel_dir_suffix): Compute new variable.
	(extra_parts): Add crtoffloadbegin.o and crtoffloadend.o
	if enable_offload_targets is not empty.
	* offloadstuff.c: New file.
libgomp/
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Check for libdl, required for plugin support.
	(PLUGIN_SUPPORT): Define if plugins are supported.
	(enable_offload_targets): Support Intel MIC targets.
	(OFFLOAD_TARGETS): List of target names suitable for offloading.
lto-plugin/
	* Makefile.am (libexecsubdir): Tweak for the possibility of being
	configured for offload compiler.
	(accel_dir_suffix, real_target_noncanonical): New variables substituted
	by configure.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac (accel_dir_suffix, real_target_noncanonical): Compute new
	variables.


Co-Authored-By: Andrey Turetskiy <andrey.turetskiy@intel.com>
Co-Authored-By: Ilya Verbin <ilya.verbin@intel.com>
Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>

From-SVN: r217485
2014-11-13 13:28:56 +00:00
Matthew Fortune 050af1445b Implement MIPS o32 FPXX, FP64, FP64A ABI extensions.
2014-11-12  Matthew Fortune  <matthew.fortune@imgtec.com>

gcc/
	* common/config/mips/mips-common.c (mips_handle_option): Ensure
	that -mfp32, -mfp64 disable -mfpxx and -mfpxx disables -mfp64.
	* config.gcc (--with-fp-32): New option.
	(--with-odd-spreg-32): Likewise.
	* config.in (HAVE_AS_DOT_MODULE): New config define.
	* config/mips/mips-protos.h
	(mips_secondary_memory_needed): New prototype.
	(mips_hard_regno_caller_save_mode): Likewise.
	* config/mips/mips.c (mips_get_reg_raw_mode): New static prototype.
	(mips_get_arg_info): Assert that V2SFmode is only handled specially
	with TARGET_PAIRED_SINGLE_FLOAT.
	(mips_return_mode_in_fpr_p): Likewise.
	(mips16_call_stub_mode_suffix): Likewise.
	(mips_get_reg_raw_mode): New static function.
	(mips_return_fpr_pair): O32 return values span two registers.
	(mips16_build_call_stub): Likewise.
	(mips_function_value_regno_p): Support both FP return registers.
	(mips_output_64bit_xfer): Use mthc1 whenever TARGET_HAS_MXHC1.  Add
	specific cases for TARGET_FPXX to move via memory.
	(mips_dwarf_register_span): For TARGET_FPXX pretend that modes larger
	than UNITS_PER_FPREG 'span' one register.
	(mips_dwarf_frame_reg_mode): New static function.
	(mips_file_start): Switch to using .module instead of .gnu_attribute.
	No longer support FP ABI 4 (-mips32r2 -mfp64), replace with FP ABI 6.
	Add FP ABI 5 (-mfpxx) and FP ABI 7 (-mfp64 -mno-odd-spreg).
	(mips_save_reg, mips_restore_reg): Always represent DFmode frame
	slots with two CFI directives even for O32 FP64.
	(mips_for_each_saved_gpr_and_fpr): Account for fixed_regs when
	saving/restoring callee-saved registers.
	(mips_hard_regno_mode_ok_p): Implement O32 FP64A extension.
	(mips_secondary_memory_needed): New function.
	(mips_option_override): ABI check for TARGET_FLOATXX.  Disable
	odd-numbered single-precision registers	when using TARGET_FLOATXX.
	Implement -modd-spreg and defaults.
	(mips_conditional_register_usage): Redefine O32 FP64 to match O32 FP32
	callee-saved behaviour.
	(mips_hard_regno_caller_save_mode): Implement.
	(TARGET_GET_RAW_RESULT_MODE): Define target hook.
	(TARGET_GET_RAW_ARG_MODE): Define target hook.
	(TARGET_DWARF_FRAME_REG_MODE): Define target hook.
	* config/mips/mips.h (TARGET_FLOAT32): New macro.
	(TARGET_O32_FP64A_ABI): Likewise.
	(TARGET_CPU_CPP_BUILTINS): TARGET_FPXX is __mips_fpr==0. Add
	_MIPS_SPFPSET builtin define.
	(MIPS_FPXX_OPTION_SPEC): New macro.
	(OPTION_DEFAULT_SPECS): Pass through --with-fp-32=* to -mfp and
	--with-odd-spreg-32=* to -m[no-]odd-spreg.
	(ISA_HAS_ODD_SPREG): New macro.
	(ISA_HAS_MXHC1): True for anything other than -mfp32.
	(ASM_SPEC): Pass through mfpxx, mfp64, -mno-odd-spreg and -modd-spreg.
	(MIN_FPRS_PER_FMT): Redefine in terms of TARGET_ODD_SPREG.
	(HARD_REGNO_CALLER_SAVE_MODE): Define.  Implement O32 FPXX extension
	(HARD_REGNO_CALL_PART_CLOBBERED): Likewise.
	(SECONDARY_MEMORY_NEEDED): Likewise.
	(FUNCTION_ARG_REGNO_P): Update for O32 FPXX and FP64 extensions.
	* config/mips/mips.md (define_attr enabled): Implement O32 FPXX and
	FP64A ABI extensions.
	(move_doubleword_fpr<mode>): Use ISA_HAS_MXHC1 instead of
	TARGET_FLOAT64.
	* config/mips/mips.opt (mfpxx): New target option.
	(modd-spreg): Likewise.
	* config/mips/mti-elf.h (DRIVER_SELF_SPECS): Infer FP ABI from arch.
	* config/mips/mti-linux.h (DRIVER_SELF_SPECS): Likewise and remove
	fp64 sysroot.
	* config/mips/t-mti-elf: Remove fp64 multilib.
	* config/mips/t-mti-linux: Likewise.
	* configure.ac: Detect .module support.
	* configure: Regenerate.
	* doc/invoke.texi: Document -mfpxx, -modd-spreg, -mno-odd-spreg option.
	* doc/install.texi (--with-fp-32, --with-odd-spreg-32): Document new
	options.

gcc/testsuite/
	* gcc.target/mips/args-1.c: Handle __mips_fpr == 0.
	* gcc.target/mips/call-clobbered-1.c: New.
	* gcc.target/mips/call-clobbered-2.c: New.
	* gcc.target/mips/call-clobbered-3.c: New.
	* gcc.target/mips/call-clobbered-4.c: New.
	* gcc.target/mips/call-clobbered-5.c: New.
	* gcc.target/mips/call-saved-4.c: New.
	* gcc.target/mips/call-saved-5.c: New.
	* gcc.target/mips/call-saved-6.c: New.
	* gcc.target/mips/mips.exp: Support -mfpxx, -ffixed-f*,
	and -m[no-]odd-spreg.  Use _MIPS_SPFPSET to determine default
	odd-spreg option.  Account for -modd-spreg in minimum arch code.
	* gcc.target/mips/movdf-1.c: New.
	* gcc.target/mips/movdf-2.c: New.
	* gcc.target/mips/movdf-3.c: New.
	* gcc.target/mips/oddspreg-1.c: New.
	* gcc.target/mips/oddspreg-2.c: New.
	* gcc.target/mips/oddspreg-3.c: New.
	* gcc.target/mips/oddspreg-4.c: New.
	* gcc.target/mips/oddspreg-5.c: New.
	* gcc.target/mips/oddspreg-6.c: New.

libgcc/
	* config/mips/mips16.S: Set .module when supported.  Update O32
	FP64 calling convention and use for FPXX when possible.  Add FPXX
	calling convention fallback case.

From-SVN: r217446
2014-11-12 21:39:46 +00:00
Tobias Burnus d62352f9c7 Makefile.in (CLOOGLIBS, CLOOGINC): Remove.
2014-11-12  Tobias Burnus  <burnus@net-b.de>

        * Makefile.in (CLOOGLIBS, CLOOGINC): Remove.
        * configure.ac: Ditto.
        * graphite-interchange.c: Remove HAVE_CLOOG block.
        * config.in: Regenerate.
        * configure: Regenerate.

From-SVN: r217436
2014-11-12 19:28:36 +01:00
Joseph Myers 2f73a6c7b4 Implement TARGET_ATOMIC_ASSIGN_EXPAND_FENV for powerpc*-*-linux* soft-float and e500.
This patch implements support for TARGET_ATOMIC_ASSIGN_EXPAND_FENV for
powerpc*-*-linux* soft-float and e500, provided GCC is configured for
glibc 2.19 or later on the target.

New functions __atomic_feholdexcept, __atomic_feclearexcept and
__atomic_feupdateenv were added (to libc) in that glibc version (for
powerpc soft-float / e500 only) in order to support this part of C11.
For soft-float, libc functions are needed because the floating-point
exception state is in TLS variables in libc that aren't directly
accessible outside of glibc.  For e500, they are also needed because
of the prctl syscalls involved in controlling trapping for exceptions
and informing the kernel when certain exception flags have been
cleared.  The actual implementation in GCC is a straightforward matter
of calling those functions.

Tested with no regressions for cross to powerpc-linux-gnu
(soft-float); the c11-atomic-exec-5.c results go from FAIL to PASS.

	* configure.ac (TARGET_GLIBC_MAJOR, TARGET_GLIBC_MINOR): Define
	macros.
	* configure, config.h.in: Regenerate.
	* config/rs6000/linux.h [TARGET_GLIBC_MAJOR > 2 ||
	(TARGET_GLIBC_MAJOR == 2 && TARGET_GLIBC_MINOR >= 19)]
	(RS6000_GLIBC_ATOMIC_FENV): New macro.
	* config/rs6000/linux64.h [TARGET_GLIBC_MAJOR > 2 ||
	(TARGET_GLIBC_MAJOR == 2 && TARGET_GLIBC_MINOR >= 19)]
	(RS6000_GLIBC_ATOMIC_FENV): New macro.
	* config/rs6000/rs6000.c (atomic_hold_decl, atomic_clear_decl)
	(atomic_update_decl): New static variables.
	(rs6000_atomic_assign_expand_fenv) [RS6000_GLIBC_ATOMIC_FENV]:
	Generate calls to __atomic_feholdexcept, __atomic_feclearexcept
	and __atomic_feupdateenv for soft-float and no-FPRs.

From-SVN: r217040
2014-11-03 13:40:50 +00:00
Roman Gareev eae1a5d419 configure.ac: Eliminate ClooG installation dependency.
* configure.ac: Eliminate ClooG installation dependency.
	* configure: Regenerate.
	* Makefile.tpl: Add definition of ISLLIBS and HOST_ISLLIBS.
	* Makefile.in: Regenerate.

[config/]

	* cloog.m4: Remove the path to isllibs from clooglibs.
	* isl.m4: Add paths to islinc, isllibs.

[gcc/]

	* Makefile.in: Add definition of ISLLIBS, HOST_ISLLIBS.
	* config.in: Add undef of HAVE_isl.
	* configure: Regenerate.
	* configure.ac: Add definition of HAVE_isl.
	* graphite-blocking.c: Add checking of HAVE_isl.
	* graphite-dependences.c: Likewise.
	* graphite-interchange.c: Likewise.
	* graphite-isl-ast-to-gimple.c: Likewise.
	* graphite-optimize-isl.c: Likewise.
	* graphite-poly.c: Likewise.
	* graphite-scop-detection.c: Likewise.
	* graphite-sese-to-poly.c: Likewise.
	* graphite.c: Likewise.
	* toplev.c: Replace the checking of HAVE_cloog with the checking
	of HAVE_isl.

From-SVN: r214106
2014-08-18 15:42:11 +00:00
Mike Stump b6d9404508 configure.ac: Also check for popen.
* configure.ac: Also check for popen.
	* tree-loop-distribution.c (dot_rdg): Autoconfize popen use.
	* configure: Regenerate.
	* config.in:  Regenerate.

From-SVN: r213309
2014-07-30 18:29:41 +00:00
Rainer Orth 29d7cbd1b9 Support compressed debug sections
* configure.ac (gcc_cv_as_compress_debug): Check for assembler
	compressed debug support.
	(gcc_cv_ld_compress_debug): Check for linker compressed debug
	support.
	* configure: Regenerate.
	* config.in: Regenerate.
	* common.opt (compressed_debug_sections): New enum.
	(gz, gz=): New options.
	* gcc.c (LINK_COMPRESS_DEBUG_SPEC, ASM_COMPRESS_DEBUG_SPEC):
	Define.
	(LINK_COMMAND_SPEC): Invoke LINK_COMPRESS_DEBUG_SPEC.
	(asm_options): Invoke ASM_COMPRESS_DEBUG_SPEC.
	* config/darwin.h (LINK_COMMAND_SPEC_A): Invoke
	LINK_COMPRESS_DEBUG_SPEC.
	* config/i386/djgpp.h (LINK_COMMAND_SPEC): Likewise.
	* opts.c (common_handle_option): Handle OPT_gz, OPT_gz_.
	* doc/invoke.texi (Option Summary, Debugging Options): Add
	-gz[=type].
	(Debugging Options): Document -gz[=type].

From-SVN: r212072
2014-06-27 13:48:54 +00:00