Commit Graph

130355 Commits

Author SHA1 Message Date
GCC Administrator 5c72862788 Daily bump.
From-SVN: r255669
2017-12-15 00:16:15 +00:00
Peter Bergner 34f5d7982a backport: re PR target/80210 (ICE in in extract_insn, at recog.c:2311 on ppc64 for with __builtin_pow)
gcc/
	Backport from mainline
	2017-10-02  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/80210
	* config/rs6000/rs6000.c (rs6000_option_override_internal): Rewrite
	function to not use the have_cpu variable.  Do not set cpu_index,
	rs6000_cpu_index or rs6000_tune_index if we end up using TARGET_DEFAULT
	or the default cpu.
	(rs6000_valid_attribute_p): Remove duplicate initializations of
	old_optimize and func_optimize.
	(rs6000_pragma_target_parse): Call rs6000_activate_target_options ().
	(rs6000_activate_target_options): Make global.
	* config/rs6000/rs6000-protos.h (rs6000_activate_target_options): Add
	prototype.

gcc/testsuite/
	Backport from mainline
	2017-10-02  Peter Bergner  <bergner@vnet.ibm.com>

	PR target/80210
	* gcc.target/powerpc/pr80210-2.c: New test.

From-SVN: r255655
2017-12-14 11:43:32 -06:00
Eric Botcazou a9834d8de0 decl.c (gnat_to_gnu_field): Do not set the alignment of the enclosing record type if it is not already set.
* gcc-interface/decl.c (gnat_to_gnu_field): Do not set the alignment
	of the enclosing record type if it is not already set.

From-SVN: r255646
2017-12-14 17:05:43 +00:00
Peter Bergner 7eb38f05ee backport: ppc-auxv.h (PPC_FEATURE2_HTM_NO_SUSPEND): New define.
gcc/
	Backport from mainline
	2017-12-13  Peter Bergner  <bergner@vnet.ibm.com>

	* config/rs6000/ppc-auxv.h (PPC_FEATURE2_HTM_NO_SUSPEND): New define.
	* config/rs6000/rs6000.c (cpu_supports_info): Use it.

gcc/testsuite/
	Backport from mainline
	2017-12-13  Peter Bergner  <bergner@vnet.ibm.com>

	* gcc.target/powerpc/cpu-builtin-1.c (htm-no-suspend): Add test.

From-SVN: r255622
2017-12-13 21:43:10 -06:00
GCC Administrator cbbde35a9c Daily bump.
From-SVN: r255619
2017-12-14 00:16:09 +00:00
Eric Botcazou 730b33562c * gcc-interface/trans.c (Subprogram_Body_to_gnu): Initialize locus.
From-SVN: r255604
2017-12-13 09:30:42 +00:00
Eric Botcazou c3eea58cc5 trans.c (process_freeze_entity): Be prepared for a package without body.
* gcc-interface/trans.c (process_freeze_entity): Be prepared for a
	package without body.

From-SVN: r255602
2017-12-13 09:18:42 +00:00
Eric Botcazou f89e8e8020 decl.c (gnat_to_gnu_entity): Robustify test for types descendant of System.Address.
* gcc-interface/decl.c (gnat_to_gnu_entity): Robustify test for types
	descendant of System.Address.
	(gnat_to_gnu_subprog_type): Likewise.

From-SVN: r255600
2017-12-13 09:05:48 +00:00
GCC Administrator 17fb0c2dce Daily bump.
From-SVN: r255595
2017-12-13 00:16:17 +00:00
GCC Administrator d712665521 Daily bump.
From-SVN: r255561
2017-12-12 00:16:13 +00:00
Michael Meissner 634940f168 backport: re PR target/81959 (PowerPC __float128 optimization fails with integer PRE_INC addresses)
[gcc]
2017-12-11  Michael Meissner  <meissner@linux.vnet.ibm.com>

	Back port from trunk
	2017-12-01  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/81959
	* config/rs6000/rs6000.c (rs6000_address_for_fpconvert): Check for
	whether we can allocate pseudos before trying to fix an address.
	* config/rs6000/rs6000.md (float_<mode>si2_hw): Make sure the
	memory address is indexed or indirect.
	(floatuns_<mode>si2_hw2): Likewise.

[gcct/testsuite]
2017-12-11  Michael Meissner  <meissner@linux.vnet.ibm.com>

	Back port from trunk
	2017-12-01  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/81959
	* gcc.target/powerpc/pr81959.c: New test.

From-SVN: r255545
2017-12-11 18:54:55 +00:00
Sudakshina Das e9c07226b8 Backported 'Fix wrong code by arm_final_prescan with fp16 move instructions'
ChangeLog entry are as follow:

*** gcc/ChangeLog ***

2017-12-11  Sudakshina Das  <sudi.das@arm.com>

	Backported from trunk
	2017-12-01  Sudakshina Das  <sudi.das@arm.com>

	* config/arm/vfp.md (*movhf_vfp_fp16): Add conds attribute.

*** gcc/testsuite/ChangeLog ***

2017-12-11  Sudakshina Das  <sudi.das@arm.com>

	Backported from trunk
	2017-12-01  Sudakshina Das  <sudi.das@arm.com>

	* gcc.target/arm/armv8_2-fp16-move-2.c: New test.

From-SVN: r255541
2017-12-11 17:07:33 +00:00
GCC Administrator 5e8974d1f2 Daily bump.
From-SVN: r255536
2017-12-11 00:16:08 +00:00
Tom de Vries 3a15e0edf8 Backport "Fix condition folding in c_parser_omp_for_loop"
2017-12-10  Tom de Vries  <tom@codesourcery.com>

	backport from trunk:
	2017-09-16  Tom de Vries  <tom@codesourcery.com>

	PR c/81875
	* c-parser.c (c_parser_omp_for_loop): Fold only operands of cond, not
	cond itself.

	* testsuite/libgomp.c/pr81875.c: New test.

From-SVN: r255531
2017-12-10 20:52:54 +00:00
GCC Administrator 07f59edb30 Daily bump.
From-SVN: r255526
2017-12-10 00:16:09 +00:00
GCC Administrator 040f7ca425 Daily bump.
From-SVN: r255519
2017-12-09 00:16:09 +00:00
GCC Administrator 84bb19ceab Daily bump.
From-SVN: r255489
2017-12-08 00:16:09 +00:00
Kelvin Nilsen 32c5be0d14 backport: re PR target/80101 (ICE in store_data_bypass_p, at recog.c:3737)
gcc/testsuite/ChangeLog:

2017-12-07  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from trunk
	2017-05-08  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/80101
	* gcc.target/powerpc/pr80101-1.c: New test.


gcc/ChangeLog:

2017-12-07  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from trunk
	2017-05-08  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/80101
	* config/rs6000/power6.md: Replace store_data_bypass_p calls with
	rs6000_store_data_bypass_p in seven define_bypass directives and
	in several comments.
	* config/rs6000/rs6000-protos.h: Add prototype for
	rs6000_store_data_bypass_p function.
	* config/rs6000/rs6000.c (rs6000_store_data_bypass_p): New
	function implements slightly different (rs6000-specific) semantics
	than store_data_bypass_p, returning false rather than aborting
	with assertion error when arguments do not satisfy the
	requirements of store data bypass.
	(rs6000_adjust_cost): Replace six calls of store_data_bypass_p with
	rs6000_store_data_bypass_p.

From-SVN: r255465
2017-12-07 13:20:27 +00:00
GCC Administrator 6df2bbd2a8 Daily bump.
From-SVN: r255459
2017-12-07 00:16:09 +00:00
Eric Botcazou 2e5a45f932 Revert
2017-11-29  Martin Aberg  <maberg@gaisler.com>

	* config/sparc/sparc.md (divdf3_fix): Add NOP and adjust length
	to prevent b2bst errata sequence.
	(sqrtdf2_fix): Likewise.

From-SVN: r255440
2017-12-06 08:38:32 +00:00
GCC Administrator ee11eff31b Daily bump.
From-SVN: r255436
2017-12-06 00:16:16 +00:00
Max Filippov d888144028 xtensa: enable address sanitizer
2017-12-05  Max Filippov  <jcmvbkbc@gmail.com>

	Backport from mainline
	2017-12-05  Max Filippov  <jcmvbkbc@gmail.com>
	* config/xtensa/xtensa.c (xtensa_asan_shadow_offset): New
	function.
	(TARGET_ASAN_SHADOW_OFFSET): New macro definition.
	* config/xtensa/xtensa.h (FRAME_GROWS_DOWNWARD): Set to 1 if
	ASAN is enabled.

From-SVN: r255422
2017-12-05 14:31:41 +00:00
Max Filippov 6c118c0f70 xtensa: add support for SSP
gcc/
2017-12-05  Max Filippov  <jcmvbkbc@gmail.com>

	Backport from mainline
	2017-05-08  Max Filippov  <jcmvbkbc@gmail.com>
	* config/xtensa/xtensa-protos.h
       	(xtensa_initial_elimination_offset): New declaration.
	* config/xtensa/xtensa.c (xtensa_initial_elimination_offset):
	New function. Move its body from the INITIAL_ELIMINATION_OFFSET
	macro definition, add case for FRAME_POINTER_REGNUM when
	FRAME_GROWS_DOWNWARD.
	* config/xtensa/xtensa.h (FRAME_GROWS_DOWNWARD): New macro
	definition.
	(INITIAL_ELIMINATION_OFFSET): Replace body with call to
	xtensa_initial_elimination_offset.

From-SVN: r255421
2017-12-05 14:29:53 +00:00
GCC Administrator 1247cb582c Daily bump.
From-SVN: r255397
2017-12-05 00:16:08 +00:00
Eric Botcazou 957004f6f8 sparc.c (sparc_do_work_around_errata): Use mem_ref instead of MEM_P in a couple more places.
* config/sparc/sparc.c (sparc_do_work_around_errata): Use mem_ref
	instead of MEM_P in a couple more places.  Fix formatting issues.

From-SVN: r255394
2017-12-04 23:14:23 +00:00
Sebastian Huber 5099bde3f0 RTEMS/Ada: Account for 64-bit time_t
The Newlib time_t has now 64 bits for RTEMS.

gcc/ada

	* gcc-interface/Makefile.in (RTEMS): Use s-osprim.adb.
	* s-osprim-rtems.adb: New file.
	* s-osinte-rtems.adb (pthread_cond_t): Fix alignment.
	(pthread_mutexattr_t): Likewise.
	(pthread_rwlockattr_t): Likewise.
	(pthread_rwlock_t): Likewise.
	(time_t): Use 64-bit integer.

From-SVN: r255381
2017-12-04 13:41:46 +00:00
Sebastian Peryt 2df7463a7a Fix PR82941 and PR82942 by adding proper vzeroupper generation on SKX.
Add X86_TUNE_EMIT_VZEROUPPER to indicate if vzeroupper instruction should
be inserted before a transfer of control flow out of the function.  It is
turned on by default unless we are tuning for KNL.  Users can always use
-mzeroupper or -mno-zeroupper to override X86_TUNE_EMIT_VZEROUPPER.

2017-12-04  Sebastian Peryt  <sebastian.peryt@intel.com>
	H.J. Lu  <hongjiu.lu@intel.com>

gcc/
	Bakcported from trunk
	PR target/82941
	PR target/82942
	PR target/82990
	* config/i386/i386.c (pass_insert_vzeroupper): Remove
	TARGET_AVX512F check from gate condition.
	(ix86_check_avx256_register): Changed to ...
	(ix86_check_avx_upper_register): ... this. Add extra check for
	VALID_AVX512F_REG_OR_XI_MODE.
	(ix86_avx_u128_mode_needed): Changed
	ix86_check_avx256_register to ix86_check_avx_upper_register.
	(ix86_check_avx256_stores): Changed to ...
	(ix86_check_avx_upper_stores): ... this. Changed
	ix86_check_avx256_register to ix86_check_avx_upper_register.
	(ix86_avx_u128_mode_after): Changed
	avx_reg256_found to avx_upper_reg_found. Changed
	ix86_check_avx256_stores to ix86_check_avx_upper_stores.
	(ix86_avx_u128_mode_entry): Changed
	ix86_check_avx256_register to ix86_check_avx_upper_register.
	(ix86_avx_u128_mode_exit): Ditto.
	(ix86_option_override_internal): Set MASK_VZEROUPPER if
	neither -mzeroupper nor -mno-zeroupper is used and
	TARGET_EMIT_VZEROUPPER is set.
	* config/i386/i386.h: (host_detect_local_cpu): New define.
	(TARGET_EMIT_VZEROUPPER): New.
	* config/i386/x86-tune.def: Add X86_TUNE_EMIT_VZEROUPPER.

2017-12-04  Sebastian Peryt  <sebastian.peryt@intel.com>
	H.J. Lu  <hongjiu.lu@intel.com>

gcc/testsuite/
	Backported from trunk
	PR target/82941
	PR target/82942
	PR target/82990
	* gcc.target/i386/pr82941-1.c: New test.
	* gcc.target/i386/pr82941-2.c: Likewise.
	* gcc.target/i386/pr82942-1.c: Likewise.
	* gcc.target/i386/pr82942-2.c: Likewise.
	* gcc.target/i386/pr82990-1.c: Likewise.
	* gcc.target/i386/pr82990-2.c: Likewise.
	* gcc.target/i386/pr82990-3.c: Likewise.
	* gcc.target/i386/pr82990-4.c: Likewise.
	* gcc.target/i386/pr82990-5.c: Likewise.
	* gcc.target/i386/pr82990-6.c: Likewise.
	* gcc.target/i386/pr82990-7.c: Likewise.

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

From-SVN: r255378
2017-12-04 12:03:37 +01:00
GCC Administrator 487568a811 Daily bump.
From-SVN: r255371
2017-12-04 00:16:10 +00:00
Jerry DeLisle 7aee7828de backport: re PR fortran/83191 (Writing a namelist with repeated complex numbers)
2017-12-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
            Dominique d'Humieres  <dominiq@lps.ens.fr>

        Backport from trunk
        PR libgfortran/83191
        * io/transfer.c (list_formatted_read_scalar): Do not set
        namelist_mode bit here. (namelist_read): Likewise.
        (data_transfer_init): Clear the mode bit here.
        (finalize_transfer): Do set the mode bit just before any calls
        to namelist_read or namelist_write. It can now be referred to
        in complex_write.
        * io/write.c (write_complex): Suppress the leading blanks when
        namelist_mode bit is not set to 1.

        * gfortran.dg/namelist_95.f90: New test.

Co-Authored-By: Dominique d'Humieres <dominiq@lps.ens.fr>

From-SVN: r255368
2017-12-03 20:43:59 +00:00
GCC Administrator 600c0c1f9a Daily bump.
From-SVN: r255360
2017-12-03 00:16:08 +00:00
GCC Administrator 41ff41cfcb Daily bump.
From-SVN: r255343
2017-12-02 00:16:11 +00:00
Segher Boessenkool cd68fefbc0 rs6000: Improve comparison rtx_cost (PR81288)
The current rs6000 rtx_cost for comparisons against 0 is very high if
TARGET_ISEL && !TARGET_MFCRF, much higher than for reg-reg comparisons,
much higher than a load of 0 and such a reg-reg-comparison.  This leads
to infinite recursion in CSE (see PR81288).

This patch removes the too-high cost, also simplifying this code.


	PR 81288/target
	* config/rs6000/rs6000.c (rs6000_rtx_costs): Do not handle
	TARGET_ISEL && !TARGET_MFCRF differently.  Simplify code.

From-SVN: r255337
2017-12-01 21:35:52 +01:00
Sebastian Huber bb3194045e RTEMS/Ada: Fix some POSIX types
gcc/ada
	* s-osinte-rtems.ads (pthread_cond_t): Use correct size and
	alignment.
	(pthread_mutex_t): Likewise.
	(pthread_rwlock_t): Likewise.

From-SVN: r255303
2017-12-01 11:03:24 +00:00
GCC Administrator 0b3c14e15f Daily bump.
From-SVN: r255287
2017-12-01 00:16:14 +00:00
Jim Wilson 5b92217b2b Riscv doc fixes and improvements.
gcc/
	Backport from mainline
	2017-11-30  Jim Wilson  <jimw@sifive.com>
	* doc/invoke.texi (RISC-V Options): Delete nonexistent -mmemcpy and
	-mno-memcpy options.  For -mplt, -mfdiv, -mdiv, -msave-restore, and
	-mstrict-align, add info on default value.  Delete redundant lines for
	-mabi.  Add missing -mexplicit-relocs docs.

	Backport from mainline
	2017-11-01  Palmer Dabbelt  <palmer@dabbelt.com>
	* doc/invoke.texi (RISC-V Options): Use "@minus{}2 GB", not "-2 GB".
	* doc/invoke.texi (RISC-V Options): Explicitly name the medlow
	and medany code models, and describe what they do.

	2017-10-27  Palmer Dabbelt  <palmer@dabbelt.com>
	PR target/82717
	* doc/invoke.texi (RISC-V) <-mabi>: Correct and improve.

From-SVN: r255281
2017-11-30 10:38:26 -08:00
GCC Administrator ba682b82e2 Daily bump.
From-SVN: r255263
2017-11-30 00:16:09 +00:00
Martin Jambor daccaeb998 Be conservative with arithmetic jmp-function types
2017-11-29  Martin Jambor  <mjambor@suse.cz>

	PR ipa/82808
	* tree.c (expr_type_first_operand_type_p): New function.
	* tree.h (expr_type_first_operand_type_p): Declare it.
	* ipa-cp.c (ipa_get_jf_pass_through_result): Use it.

testsuite/
	* gcc.dg/ipa/pr82808.c: New test.

From-SVN: r255256
2017-11-29 23:13:34 +01:00
Daniel Cederman 330f2c9882 [SPARC] Recognize the load when accessing the GOT
Needed for the UT699 errata workaround to function correctly when
compiling with -fPIC.

Backport from mainline
2017-11-29  Daniel Cederman  <cederman@gaisler.com>

gcc/
	* config/sparc/sparc.c (sparc_do_work_around_errata): Treat the
        movsi_pic_gotdata_op instruction as a load for the UT699 errata
        workaround.

From-SVN: r255245
2017-11-29 18:07:29 +01:00
Martin Aberg 803f3f3e8a [SPARC] Prevent -mfix-ut699 from generating b2bst errata sequences
The sequence
  st
  fdivd / fsqrtd
  std
was generated in some cases with -mfix-ut699 when there was
a st before the div/sqrt. This sequence could trigger the b2bst errata.

Now the following safe sequence is generated instead:
  st
  nop
  fdivd / fsqrtd
  std

Backport from mainline
2017-11-29  Martin Aberg  <maberg@gaisler.com>

gcc/
	* config/sparc/sparc.md (divdf3_fix): Add NOP and adjust length
        to prevent b2bst errata sequence.
        (sqrtdf2_fix): Likewise.

From-SVN: r255244
2017-11-29 18:03:32 +01:00
Daniel Cederman dc363a5558 [SPARC] Errata workaround for GRLIB-TN-0013
This patch provides a workaround for the errata described in GRLIB-TN-0013.

If the workaround is enabled it will:

* Prevent div and sqrt instructions in the delay slot.

* Insert NOPs to prevent the sequence (div/sqrt) -> (two or three floating
  point operations or loads) -> (div/sqrt).

* Not insert NOPs if any of the floating point operations have a dependency
  on the destination register of the first (div/sqrt).

* Not insert NOPs if one of the floating point operations is a (div/sqrt).

* Insert NOPs to prevent (div/sqrt) followed by a branch.

It is applicable to GR712RC, UT700, and UT699.

Backport from mainline
2017-11-29  Daniel Cederman  <cederman@gaisler.com>

gcc/
	* config/sparc/sparc.c (fpop_reg_depend_p): New function.
	(div_sqrt_insn_p): New function.
	(sparc_do_work_around_errata): Insert NOP instructions to
	prevent sequences that could trigger the TN-0013 errata for
	certain LEON3 processors.
	(pass_work_around_errata::gate): Also test sparc_fix_lost_divsqrt.
	(sparc_option_override): Set sparc_fix_lost_divsqrt appropriately.
	* config/sparc/sparc.md (fix_lost_divsqrt): New attribute.
	(in_branch_delay): Prevent div and sqrt in delay slot if
	fix_lost_divsqrt.
	* config/sparc/sparc.opt (sparc_fix_lost_divsqrt): New variable.

From-SVN: r255243
2017-11-29 18:01:45 +01:00
Daniel Cederman 304d27a099 [SPARC] Errata workaround for GRLIB-TN-0010
This patch provides a workaround for the errata described in GRLIB-TN-0010.

If the workaround is enabled it will:

 * Insert a NOP between load instruction and atomic
   instruction (swap, ldstub, casa).

 * Insert a NOP at branch target if load in delay slot
   and atomic instruction at branch target.

It is applicable to UT700.

Backport from mainline
2017-11-29  Daniel Cederman  <cederman@gaisler.com>

gcc/
	* config/sparc/sparc.c (atomic_insn_p): New function.
	(sparc_do_work_around_errata): Insert NOP instructions to
	prevent sequences that could trigger the TN-0010 errata for
	UT700.
	* config/sparc/sync.md (atomic_compare_and_swap_leon3_1): Make
	instruction referable in atomic_insns_p.

From-SVN: r255242
2017-11-29 17:58:35 +01:00
Daniel Cederman e3f124c72d [SPARC] Errata workaround for GRLIB-TN-0011
This patch provides a workaround for the errata described in GRLIB-TN-0011.

If the workaround is enabled it will:

 * Insert .align 16 before atomic instructions (swap, ldstub, casa).

It is applicable to GR712RC.

Backport from mainline
2017-11-29  Daniel Cederman  <cederman@gaisler.com>

gcc/
	* config/sparc/sync.md (swapsi): 16-byte align if sparc_fix_gr712rc.
	(atomic_compare_and_swap_leon3_1): Likewise.
	(ldstub): Likewise.

From-SVN: r255241
2017-11-29 17:56:25 +01:00
Daniel Cederman a6c33857df [SPARC] Errata workaround for GRLIB-TN-0012
This patch provides a workaround for the errata described in GRLIB-TN-0012.

If the workaround is enabled it will:

 * Prevent any floating-point operation from being placed in the
   delay slot of an annulled integer branch.

 * Place a NOP at the branch target of an integer branch if it is
   a floating-point operation or a floating-point branch.

It is applicable to GR712RC.

Backport from mainline
2017-11-29  Daniel Cederman  <cederman@gaisler.com>

gcc/
	* config/sparc/sparc.c (fpop_insn_p): New function.
	(sparc_do_work_around_errata): Insert NOP instructions to
	prevent sequences that could trigger the TN-0012 errata for
	GR712RC.
	(pass_work_around_errata::gate): Also test sparc_fix_gr712rc.
	* config/sparc/sparc.md (fix_gr712rc): New attribute.
	(in_branch_annul_delay): Prevent floating-point instructions
	in delay slot of annulled integer branch.

From-SVN: r255240
2017-11-29 17:53:47 +01:00
GCC Administrator 8b5205f89d Daily bump.
From-SVN: r255223
2017-11-29 00:16:12 +00:00
Jim Wilson c45915392b Add riscv -mstrict-align option.
gcc/
	Backport from mainline
	2017-11-04  Andrew Waterman  <andrew@sifive.com>

	* config/riscv/riscv.c (riscv_option_override): Conditionally set
	TARGET_STRICT_ALIGN based upon -mtune argument.

	Backport from mainline
	2017-05-04  Andrew Waterman  <andrew@sifive.com>

	* config/riscv/riscv.opt (mstrict-align): New option.
	* config/riscv/riscv.h (STRICT_ALIGNMENT): Use it.  Update comment.
	(SLOW_UNALIGNED_ACCESS): Define.
	(riscv_slow_unaligned_access): Declare.
	* config/riscv/riscv.c (riscv_tune_info): Add slow_unaligned_access
	field.
	(riscv_slow_unaligned_access): New variable.
	(rocket_tune_info): Set slow_unaligned_access to true.
	(optimize_size_tune_info): Set slow_unaligned_access to false.
	(riscv_cpu_info_table): Add entry for optimize_size_tune_info.
	(riscv_valid_lo_sum_p): Use TARGET_STRICT_ALIGN.
	(riscv_option_override): Set riscv_slow_unaligned_access.
	* doc/invoke.texi: Add -mstrict-align to RISC-V.

From-SVN: r255221
2017-11-28 16:00:01 -08:00
Jim Wilson 2be42c93b9 Add riscv musl support.
gcc/
	Backport from mainline
	2017-11-07  Michael Clark  <michaeljclark@mac.com>

	* config/riscv/linux.h (MUSL_ABI_SUFFIX): New define.
	(MUSL_DYNAMIC_LINKER): Likewise.

From-SVN: r255216
2017-11-28 11:48:30 -08:00
Paul Thomas a82d7ade2d re PR fortran/83021 (gfortran segfault in polymorphic assignment)
2017-11-28  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/83021
	* resolve.c (resolve_component): Only escape for use assciated
	vtypes if the current namespace has no proc_name and is most
	particularly block data.

From-SVN: r255205
2017-11-28 15:38:55 +00:00
Jim Wilson 326c95acd9 Fix riscv linux kernel boot failure.
gcc/
	Backport from mainline
	2017-10-25  Palmer Dabbelt  <palmer@dabbelt.com>

	* config/riscv/riscv.md (ZERO_EXTEND_LOAD): Define.
	* config/riscv/pic.md (local_pic_load): Rename to local_pic_load_s,
	mark as a sign-extending load.
	(local_pic_load_u): Define.

From-SVN: r255187
2017-11-27 16:55:03 -08:00
GCC Administrator 3e82e78509 Daily bump.
From-SVN: r255184
2017-11-28 00:16:16 +00:00
Jim Wilson 247da19e84 Fix RISCV ICE on linux kernel build.
gcc/
	Backport from mainline
	2017-11-03  Kito Cheng  <kito.cheng@gmail.com>

	* config/riscv/riscv.c (riscv_legitimize_move): Handle
	non-legitimate address.

From-SVN: r255181
2017-11-27 14:33:29 -08:00
GCC Administrator 37c3433979 Daily bump.
From-SVN: r255157
2017-11-27 00:16:08 +00:00
GCC Administrator 3f857988bb Daily bump.
From-SVN: r255152
2017-11-26 00:16:10 +00:00
GCC Administrator a62b5df31c Daily bump.
From-SVN: r255146
2017-11-25 00:16:11 +00:00
Segher Boessenkool 6b856e6c31 combine: Don't split insns if half is unused (PR82621)
If we have a PARALLEL of two SETs, and one half is unused, we currently
happily split that into two instructions (albeit the unused one is
useless).  Worse, as PR82621 shows, combine will happily merge this
insn into I3 even if some intervening insn sets the same register
again, which is wrong.

This fixes it by not splitting PARALLELs with REG_UNUSED notes.  It
all is handled fine by combine in that case; just the "single set
that is unused" case isn't handled properly.

This also results in better code: combine will now actually throw
away the unused SET.  (It still won't do that in an I3).


	PR rtl-optimization/82621
	* combine.c (try_combine): Do not split PARALLELs of two SETs if the
	dest of one of those SETs is unused.

From-SVN: r255142
2017-11-24 18:00:57 +01:00
GCC Administrator 0dc933f4f5 Daily bump.
From-SVN: r255129
2017-11-24 00:16:16 +00:00
Paul Thomas a687bfa9f7 backport: re PR fortran/79072 (ICE with class(*) pointer function result and character value)
2017-11-23  Paul Thomas  <pault@gcc.gnu.org>


	Backported from trunk
	PR fortran/79072
	* trans-expr.c (trans_class_vptr_len_assignment): Set from_len
	if the temporary is unlimited polymorphic.
	* trans-stmt.c (trans_associate_var): Use the fake result decl
	to obtain the 'len' field from an explicit function result when
	in that function scope.

2017-11-23  Paul Thomas  <pault@gcc.gnu.org>

	Backported from trunk
	PR fortran/79072
	* gfortran.dg/class_result_5.f90: New test.
	* gfortran.dg/class_result_6.f90: New test.

From-SVN: r255120
2017-11-23 21:02:48 +00:00
Oleg Endo 83d51b3e9c backport: re PR target/83111 ([sh] stack smashing detected in gen_udivsi3)
gcc/
	Backport from mainline
	2017-11-23  Oleg Endo  <olegendo@gcc.gnu.org>

	PR target/83111
	* config/sh/sh.md (udivsi3, divsi3, sibcall_value_pcrel,
	sibcall_value_pcrel_fdpic): Use local variable instead of
	operands[3].
	(calli_tbr_rel): Add missing operand 2.
	(call_valuei_tbr_rel): Add missing operand 3.

From-SVN: r255097
2017-11-23 14:08:12 +00:00
GCC Administrator 254cf05059 Daily bump.
From-SVN: r255088
2017-11-23 00:16:09 +00:00
Richard Biener d938e377b1 revert: backport: re PR rtl-optimization/82044 (runtime signed integer overflow in check_mem_read_rtx() and all_positions_needed_p() in dse.c)
2017-11-22  Richard Biener  <rguenther@suse.de>

	Revert
	2017-11-21  Martin Liska  <mliska@suse.cz>
 
	Backport from mainline
	2017-11-21  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/82044
	PR tree-optimization/82042
	* dse.c (check_mem_read_rtx): Check for overflow.

From-SVN: r255046
2017-11-22 09:04:47 +00:00
GCC Administrator 496898596e Daily bump.
From-SVN: r255040
2017-11-22 00:16:14 +00:00
Paul Thomas ddf89dd532 backport: re PR fortran/82586 ([PDT] ICE: write_symbol(): bad module symbol)
2017-11-21  Paul Thomas  <pault@gcc.gnu.org>

	Backported from trunk fix for PR82586
	PR fortran/78686
	* resolve.c (resolve_generic_f): Check usage of derived type by
	calling gfc_use_derived.

2017-11-21  Paul Thomas  <pault@gcc.gnu.org>

	Backported from trunk fix for PR82586
	PR fortran/78686
	* gfortran.dg/pr78686.f90: New test.

From-SVN: r255029
2017-11-21 19:09:01 +00:00
Martin Liska cef469e76d Backport r254137
2017-11-21  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-10-27  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/82457
	* doc/invoke.texi: Document that one needs a non-strict ISO mode
	for fork-like functions to be properly instrumented.

From-SVN: r255028
2017-11-21 19:03:11 +00:00
Pat Haugen b606d65aa6 ppc-asm.h (f50, vs50): Fix values.
* config/rs6000/ppc-asm.h (f50, vs50): Fix values.

From-SVN: r255026
2017-11-21 19:01:38 +00:00
Thomas Preud'homme ae95c86478 [ARM] Fix cmse_nonsecure_entry return insn size
A number of instructions are output in assembler form by
output_return_instruction () when compiling a function with the
cmse_nonsecure_entry attribute for Armv8-M Mainline with hardfloat float
ABI. However, the corresponding thumb2_cmse_entry_return insn pattern
does not account for all these instructions in its computing of the
length of the instruction.

This may lead GCC to use the wrong branching instruction due to
incorrect computation of the offset between the branch instruction's
address and the target address.

This commit fixes the mismatch between what output_return_instruction ()
does and what the pattern think it does and adds a note warning about
mismatch in the affected functions' heading comments to ensure code does
not get out of sync again.

Note: no test is provided because the C testcase is fragile (only works
on GCC 6) and the extracted RTL test fails to compile due to bugs in the
RTL frontend (PR82815 and PR82817)

2017-11-21  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    Backport from mainline
    2017-11-09  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    * config/arm/arm.c (output_return_instruction): Add comments to
    indicate requirement for cmse_nonsecure_entry return to account
    for the size of clearing instruction output here.
    (thumb_exit): Likewise.
    * config/arm/thumb2.md (thumb2_cmse_entry_return): Fix length for
    return in hardfloat mode.

From-SVN: r255020
2017-11-21 18:14:34 +00:00
Martin Liska cee2740307 Backport r255001
2017-11-21  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-11-21  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/82044
	PR tree-optimization/82042
	* dse.c (check_mem_read_rtx): Check for overflow.

From-SVN: r255013
2017-11-21 16:02:35 +00:00
Martin Liska fdd38d7ec3 Backport r254524
2017-11-21  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-11-08  Martin Liska  <mliska@suse.cz>

	* gimplify.c (expand_FALLTHROUGH_r): Simplify usage
	of gimple_call_internal_p.

From-SVN: r255012
2017-11-21 16:02:04 +00:00
Martin Liska 20dda3e716 Backport r254519
2017-11-21  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-11-08  Martin Liska  <mliska@suse.cz>

	PR sanitizer/82792
	* gimplify.c (expand_FALLTHROUGH_r): Skip IFN_ASAN_MARK.
2017-11-21  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-11-08  Martin Liska  <mliska@suse.cz>

	PR sanitizer/82792
	* g++.dg/asan/pr82792.C: New test.

From-SVN: r255011
2017-11-21 16:01:43 +00:00
Martin Liska 11f7624968 Backport r254257
2017-11-21  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-10-31  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/82633
	* doc/gcov.texi: Document -fkeep-{static,inline}-functions and
	their interaction with GCOV infrastructure.

From-SVN: r255010
2017-11-21 16:01:16 +00:00
Martin Liska 39ac3ee8a4 Backport r253886
2017-11-21  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-10-19  Martin Liska  <mliska@suse.cz>

	PR driver/81829
	* file-find.c (remove_prefix): Remove.
	* file-find.h (remove_prefix): Likewise.
	* gcc-ar.c: Remove smartness of lookup.

From-SVN: r255009
2017-11-21 16:00:55 +00:00
Martin Liska 3e08f9feda Backport r253845
2017-11-21  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-10-18  Martin Liska  <mliska@suse.cz>

	PR sanitizer/82545
	* asan.c (asan_expand_poison_ifn): Do not put gimple stmt
	on an abnormal edge.
2017-11-21  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-10-18  Martin Liska  <mliska@suse.cz>

	PR sanitizer/82545
	* gcc.dg/asan/pr82545.c: New test.

From-SVN: r255008
2017-11-21 16:00:26 +00:00
Martin Liska 543d5c3289 Backport r253639
2017-11-21  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2017-10-11  Martin Liska  <mliska@suse.cz>

	* print-rtl.c (print_insn): Move declaration of idbuf
	to same scope as name.

From-SVN: r255007
2017-11-21 15:59:56 +00:00
Claudiu Zissulescu 78ec951e50 [ARC] Backport r254866.
From-SVN: r255000
2017-11-21 12:57:16 +01:00
Rainer Orth 4a7a8e11a3 Adapt Solaris 12 references
libgo:
	Backport from mainline

    With the change in the Solaris release model (no more major releases
    like Solaris 12 but only minor ones like 11.4), the Solaris 12
    references in GCC need to be adapted.

    Patch by Rainer Orth.

    Reviewed-on: https://go-review.googlesource.com/77490

	libgcc:
	Backport from mainline
	2017-11-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* config.host (*-*-solaris2*): Adapt comment for Solaris 12
	renaming.
	* config/sol2/crtpg.c (__start_crt_compiler): Likewise.
	* configure.ac (libgcc_cv_solaris_crts): Likewise.
	* configure: Regenerate.

	gcc:
	Backport from mainline
	2017-11-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* config.gcc (*-*-solaris2*): Enable default_use_cxa_atexit since
	Solaris 11.  Update comment.
	* configure.ac (gcc_cv_ld_pid): Adapt comment for Solaris 12
	renaming.
	* config/sol2.h (STARTFILE_SPEC): Likewise.
	* configure: Regenerate.

	gcc/testsuite:
	Backport from mainline
	2017-11-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* lib/target-supports.exp (check_effective_target_pie): Adapt
	comment for Solaris 12 renaming.

	* gcc.dg/torture/pr60092.c: Remove *-*-solaris2.11* dg-xfail-run-if.

From-SVN: r254994
2017-11-21 09:31:12 +00:00
GCC Administrator 2d2a66a53e Daily bump.
From-SVN: r254975
2017-11-21 00:16:12 +00:00
Segher Boessenkool 5c956beb8a rs6000: Don't touch below the stack pointer (PR77687)
With the 32-bit SVR4 ABI we don't have a red zone, so we have to restore
the callee-saved registers before we restore the stack pointer.

The previous fix for this PR failed in two ways, for huge frames: first,
we use a negative offset from r11 in that case, so the (mem:BLK 11) access
does no good; second, sched does not handle accesses to mem:BLK correctly
in this case (does not make dependencies).

This patch fixes it by doing a store to (mem:BLK (scratch)) instead.
This means no unrelated (not to stack) loads/stores can be moved over the
stack restore either, but so be it.


	PR target/77687
	* config/rs6000/rs6000.md (stack_restore_tie): Store to a scratch
	address instead of to r1 and r11.

gcc/testsuite/
	PR target/77687
	* gcc.target/powerpc/pr77687.c: New testcase.

From-SVN: r254968
2017-11-20 21:10:28 +01:00
GCC Administrator 8ffd559cd5 Daily bump.
From-SVN: r254942
2017-11-20 00:16:15 +00:00
GCC Administrator 62efd178dd Daily bump.
From-SVN: r254922
2017-11-19 00:16:14 +00:00
GCC Administrator dc4d4d510a Daily bump.
From-SVN: r254911
2017-11-18 00:16:09 +00:00
Vineet Gupta 2c8462947a [ARC] Backport ARC patch r250097.
From-SVN: r254864
2017-11-17 12:15:26 +01:00
GCC Administrator ebb206c69e Daily bump.
From-SVN: r254851
2017-11-17 00:16:11 +00:00
Uros Bizjak fe3c24c3ed i386.c (x86_print_call_or_nop): Emit 5 byte nop explicitly as a stream of bytes.
* config/i386/i386.c (x86_print_call_or_nop): Emit 5 byte nop
	explicitly as a stream of bytes.

From-SVN: r254828
2017-11-16 17:04:21 +01:00
GCC Administrator a1d5ff0a2e Daily bump.
From-SVN: r254792
2017-11-16 00:16:14 +00:00
Richard Biener e1f38328f4 re PR tree-optimization/82985 (ICC: in vn_nary_build_or_lookup_1, at tree-ssa-sccvn.c:1722)
2017-11-15  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82985
	Backport from mainline
	2017-08-15  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/81790
	* tree-ssa-sccvn.c (vn_lookup_simplify_result): Handle both
	CONSTRUCTORs from simplifying and VN.

	* gcc.dg/torture/pr81790.c: New testcase.
	* g++.dg/torture/pr82985.C: Likewise.

From-SVN: r254766
2017-11-15 12:50:39 +00:00
Pierre-Marie de Rodat 395decb0d1 [PATCH] [PR82155] Fix crash in dwarf2out_abstract_function
Backport from mainline (r253147):

This patch is an attempt to fix the crash reported in PR82155.

When generating a C++ class method for a class that is itself nested in
a class method, dwarf2out_early_global_decl currently leaves the
existing context DIE as it is if it already exists.  However, it is
possible that this call happens at a point where this context DIE is
just a declaration that is itself not located in its own context.

From there, if dwarf2out_early_global_decl is not called on any of the
FUNCTION_DECL in the context chain, DIEs will be left badly scoped and
some (such as the nested method) will be removed by the type pruning
machinery.  As a consequence, dwarf2out_abstract_function will will
crash when called on the corresponding DECL because it asserts that the
DECL has a DIE.

This patch fixes this crash making dwarf2out_early_global_decl process
context DIEs the same way we process abstract origins for FUNCTION_DECL:
if the corresponding DIE exists but is only a declaration, call
dwarf2out_decl anyway on it so that it is turned into a more complete
DIE and so that it is relocated in the proper context.

Bootstrapped and regtested on x86_64-linux.

gcc/

	PR debug/82155
	* dwarf2out.c (dwarf2out_early_global_decl): Call dwarf2out_decl
	on the FUNCTION_DECL function context if it has a DIE that is a
	declaration.

gcc/testsuite/

	* g++.dg/pr82155.C: New testcase.

From-SVN: r254761
2017-11-15 11:54:11 +00:00
GCC Administrator 05eb144e64 Daily bump.
From-SVN: r254745
2017-11-15 00:16:13 +00:00
GCC Administrator e26d4fbe7f Daily bump.
From-SVN: r254716
2017-11-14 00:16:09 +00:00
Paul Thomas 71360fd464 backport: re PR fortran/82934 (Segfault on assumed character length in allocate)
2017-11-13  Paul Thomas  <pault@gcc.gnu.org>

	Backport from trunk
	PR fortran/82934
	* trans-stmt.c (gfc_trans_allocate): Remove the gcc_assert on
	null string length for assumed length typespec and set
	expr3_esize to NULL_TREE;

2017-11-13  Paul Thomas  <pault@gcc.gnu.org>

	Backport from trunk
	PR fortran/82934
	* gfortran.dg/allocate_assumed_charlen_1.f90: New test.

From-SVN: r254709
2017-11-13 20:46:08 +00:00
Paul Thomas 7951af5409 backport: re PR fortran/78619 (ICE in copy_reference_ops_from_ref, at tree-ssa-sccvn.c:889)
2017-11-13  Paul Thomas  <pault@gcc.gnu.org>

	Backport from trunk
	PR fortran/78619
	* check.c (same_type_check): Introduce a new argument 'assoc'
	with default value false. If this is true, use the symbol type
	spec of BT_PROCEDURE expressions.
	(gfc_check_associated): Set 'assoc' true in the call to
	'same_type_check'.

2017-11-13  Paul Thomas  <pault@gcc.gnu.org>

	Backport from trunk
	PR fortran/78619
	* gfortran.dg/pr78619.f90: New test.

From-SVN: r254708
2017-11-13 20:43:26 +00:00
Janne Blomqvist 62adf57eea Introduce logical_type_node and use it
Backport from trunk.

Earlier GFortran used to redefine boolean_type_node, which in the rest
of the compiler means the C/C++ _Bool/bool type, to the Fortran
default logical type.  When this redefinition was removed, a few
issues surfaced. Namely,

1) PR 82869, where we created a boolean tmp variable, and passed it to
the runtime library as a Fortran logical variable of a different size.

2) Fortran specifies that logical operations should be done with the
default logical kind, not in any other kind.

3) Using 8-bit variables have some issues, such as
   - on x86, partial register stalls and length prefix changes.
      - s390 has a compare with immediate and jump instruction which
           works with 32-bit but not 8-bit quantities.

This patch addresses these issues by introducing a type
logical_type_node which is a Fortran LOGICAL variable of default
kind. It is then used in places were the Fortran standard mandates, as
well as for compiler generated temporary variables.

For x86-64, using the Polyhedron benchmark suite, no performance or
code size difference worth mentioning was observed.

Regtested on x86_64-pc-linux-gnu.

gcc/fortran/ChangeLog:

2017-11-13  Janne Blomqvist  <jb@gcc.gnu.org>

	PR 82869
	* convert.c (truthvalue_conversion): Use logical_type_node.
	* trans-array.c (gfc_trans_allocate_array_storage): Likewise.
	(gfc_trans_create_temp_array): Likewise.
	(gfc_trans_array_ctor_element): Likewise.
	(gfc_trans_array_constructor_value): Likewise.
	(trans_array_constructor): Likewise.
	(trans_array_bound_check): Likewise.
	(gfc_conv_array_ref): Likewise.
	(gfc_trans_scalarized_loop_end): Likewise.
	(gfc_conv_array_extent_dim): Likewise.
	(gfc_array_init_size): Likewise.
	(gfc_array_allocate): Likewise.
	(gfc_trans_array_bounds): Likewise.
	(gfc_trans_dummy_array_bias): Likewise.
	(gfc_conv_array_parameter): Likewise.
	(duplicate_allocatable): Likewise.
	(duplicate_allocatable_coarray): Likewise.
	(structure_alloc_comps): Likewise
	(get_std_lbound): Likewise
	(gfc_alloc_allocatable_for_assignment): Likewise
	* trans-decl.c (add_argument_checking): Likewise
	(gfc_generate_function_code): Likewise
	* trans-expr.c (gfc_copy_class_to_class): Likewise
	(gfc_trans_class_array_init_assign): Likewise
	(gfc_trans_class_init_assign): Likewise
	(gfc_conv_expr_present): Likewise
	(gfc_conv_substring): Likewise
	(gfc_conv_cst_int_power): Likewise
	(gfc_conv_expr_op): Likewise
	(gfc_conv_procedure_call): Likewise
	(fill_with_spaces): Likewise
	(gfc_trans_string_copy): Likewise
	(gfc_trans_alloc_subarray_assign): Likewise
	(gfc_trans_pointer_assignment): Likewise
	(gfc_trans_scalar_assign): Likewise
	(fcncall_realloc_result): Likewise
	(alloc_scalar_allocatable_for_assignment): Likewise
	(trans_class_assignment): Likewise
	(gfc_trans_assignment_1): Likewise
	* trans-intrinsic.c (build_fixbound_expr): Likewise
	(gfc_conv_intrinsic_aint): Likewise
	(gfc_trans_same_strlen_check): Likewise
	(conv_caf_send): Likewise
	(trans_this_image): Likewise
	(conv_intrinsic_image_status): Likewise
	(trans_image_index): Likewise
	(gfc_conv_intrinsic_bound): Likewise
	(conv_intrinsic_cobound): Likewise
	(gfc_conv_intrinsic_mod): Likewise
	(gfc_conv_intrinsic_dshift): Likewise
	(gfc_conv_intrinsic_dim): Likewise
	(gfc_conv_intrinsic_sign): Likewise
	(gfc_conv_intrinsic_ctime): Likewise
	(gfc_conv_intrinsic_fdate): Likewise
	(gfc_conv_intrinsic_ttynam): Likewise
	(gfc_conv_intrinsic_minmax): Likewise
	(gfc_conv_intrinsic_minmax_char): Likewise
	(gfc_conv_intrinsic_anyall): Likewise
	(gfc_conv_intrinsic_arith): Likewise
	(gfc_conv_intrinsic_minmaxloc): Likewise
	(gfc_conv_intrinsic_minmaxval): Likewise
	(gfc_conv_intrinsic_btest): Likewise
	(gfc_conv_intrinsic_bitcomp): Likewise
	(gfc_conv_intrinsic_shift): Likewise
	(gfc_conv_intrinsic_ishft): Likewise
	(gfc_conv_intrinsic_ishftc): Likewise
	(gfc_conv_intrinsic_leadz): Likewise
	(gfc_conv_intrinsic_trailz): Likewise
	(gfc_conv_intrinsic_mask): Likewise
	(gfc_conv_intrinsic_spacing): Likewise
	(gfc_conv_intrinsic_rrspacing): Likewise
	(gfc_conv_intrinsic_size): Likewise
	(gfc_conv_intrinsic_sizeof): Likewise
	(gfc_conv_intrinsic_transfer): Likewise
	(gfc_conv_allocated): Likewise
	(gfc_conv_associated): Likewise
	(gfc_conv_same_type_as): Likewise
	(gfc_conv_intrinsic_trim): Likewise
	(gfc_conv_intrinsic_repeat): Likewise
	(conv_isocbinding_function): Likewise
	(conv_intrinsic_ieee_is_normal): Likewise
	(conv_intrinsic_ieee_is_negative): Likewise
	(conv_intrinsic_ieee_copy_sign): Likewise
	(conv_intrinsic_move_alloc): Likewise
	* trans-io.c (set_parameter_value_chk): Likewise
	(set_parameter_value_inquire): Likewise
	(set_string): Likewise
	* trans-openmp.c (gfc_walk_alloc_comps): Likewise
	(gfc_omp_clause_default_ctor): Likewise
	(gfc_omp_clause_copy_ctor): Likewise
	(gfc_omp_clause_assign_op): Likewise
	(gfc_omp_clause_dtor): Likewise
	(gfc_omp_finish_clause): Likewise
	(gfc_trans_omp_clauses): Likewise
	(gfc_trans_omp_do): Likewise
	* trans-stmt.c (gfc_trans_goto): Likewise
	(gfc_trans_sync): Likewise
	(gfc_trans_arithmetic_if): Likewise
	(gfc_trans_simple_do): Likewise
	(gfc_trans_do): Likewise
	(gfc_trans_forall_loop): Likewise
	(gfc_trans_where_2): Likewise
	(gfc_trans_allocate): Likewise
	(gfc_trans_deallocate): Likewise
	* trans-types.c (gfc_init_types): Initialize logical_type_node and
	their true/false trees.
	(gfc_get_array_descr_info): Use logical_type_node.
	* trans-types.h (logical_type_node): New tree.
	(logical_true_node): Likewise.
	(logical_false_node): Likewise.
	* trans.c (gfc_trans_runtime_check): Use logical_type_node.
	(gfc_call_malloc): Likewise
	(gfc_allocate_using_malloc): Likewise
	(gfc_allocate_allocatable): Likewise
	(gfc_add_comp_finalizer_call): Likewise
	(gfc_add_finalizer_call): Likewise
	(gfc_deallocate_with_status): Likewise
	(gfc_deallocate_scalar_with_status): Likewise
	(gfc_call_realloc): Likewise


gcc/testsuite/ChangeLog:

2017-11-13  Janne Blomqvist  <jb@gcc.gnu.org>

	PR 82869
	* gfortran.dg/logical_temp_io.f90: New test.
	* gfortran.dg/logical_temp_io_kind8.f90: New test.

From-SVN: r254706
2017-11-13 22:01:20 +02:00
Rainer Orth f512f6f96b Use -xbrace_comment=no with recent Solaris/x86 as
Backport from mainline
	2017-10-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* configure.ac (gcc_cv_as_ix86_xbrace_comment): Check if assembler
	supports -xbrace_comment option.
	* configure: Regenerate.
	* config.in: Regenerate.
	* config/i386/sol2.h (ASM_XBRACE_COMMENT_SPEC): Define.
	(ASM_CPU_SPEC): Use it.

From-SVN: r254681
2017-11-13 12:38:16 +00:00
GCC Administrator 6d4e81840e Daily bump.
From-SVN: r254668
2017-11-13 00:16:16 +00:00
GCC Administrator 8eae0ada26 Daily bump.
From-SVN: r254662
2017-11-12 00:16:12 +00:00
GCC Administrator d665945628 Daily bump.
From-SVN: r254646
2017-11-11 00:16:10 +00:00
Eric Botcazou 98598f0537 utils.c (convert): Add comment and do not fall through to the next case.
* gcc-interface/utils.c (convert) <RECORD_TYPE>: Add comment and do
	not fall through to the next case.
	<ARRAY_TYPE>: Deal specially with a dereference from another array
	type with the same element type.

From-SVN: r254619
2017-11-10 08:23:20 +00:00
GCC Administrator 72369bbdd6 Daily bump.
From-SVN: r254616
2017-11-10 00:16:11 +00:00
Segher Boessenkool 2ae87906ec Backport PRs 64682, 69567, 69737, 82683
Backport from mainline
	2017-11-01  Segher Boessenkool  <segher@kernel.crashing.org>

	PR rtl-optimization/64682
	PR rtl-optimization/69567
	PR rtl-optimization/69737
	PR rtl-optimization/82683
	* combine.c (distribute_notes) <REG_DEAD>: If the new I2 sets the same
	register mentioned in the note, drop the note, unless it came from I3,
	in which case it should go to I3 again.

From-SVN: r254564
2017-11-09 11:21:06 +01:00
GCC Administrator d04c03ee0e Daily bump.
From-SVN: r254558
2017-11-09 00:16:08 +00:00
GCC Administrator fd1675d082 Daily bump.
From-SVN: r254515
2017-11-08 00:16:15 +00:00
Eric Botcazou 2364fa7f79 re PR rtl-optimization/81803 (miscompilation at -O1 on mips64el)
PR rtl-optimization/81803
	* lra-constraints.c (curr_insn_transform): Also reload the whole
	register for a strict subreg no wider than a word if this is for
	a WORD_REGISTER_OPERATIONS target.

From-SVN: r254488
2017-11-07 07:44:58 +00:00
GCC Administrator cf0cc17f25 Daily bump.
From-SVN: r254482
2017-11-07 00:16:10 +00:00
Paul Thomas d006aa2b09 backport: re PR fortran/78641 ([OOP] ICE on polymorphic allocatable function in array constructor)
2017-11-06  Paul Thomas  <pault@gcc.gnu.org>

	Backported from trunk
	PR fortran/78641
	* resolve.c (resolve_ordinary_assign): Do not add the _data
	component for class valued array constructors being assigned
	to derived type arrays.
	* trans-array.c (gfc_trans_array_ctor_element): Take the _data
	of class valued elements for assignment to derived type arrays.

2017-11-06  Paul Thomas  <pault@gcc.gnu.org>

	Backported from trunk
	PR fortran/78641
	* gfortran.dg/class_66.f90: New test.

From-SVN: r254444
2017-11-06 10:40:11 +00:00
Paul Thomas cc44302bc6 [multiple changes]
2017-11-06  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/69739
	* trans-expr.c (gfc_map_intrinsic_function): Return false for
	bounds without the DIM argument instead of ICEing.

2017-11-06  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/69739
	* gfortran.dg/pr69739.f90: New test.

From-SVN: r254442
2017-11-06 10:14:29 +00:00
GCC Administrator cdfabae2ab Daily bump.
From-SVN: r254434
2017-11-06 00:16:11 +00:00
Paul Thomas b5172328dd re PR fortran/81447 ([7/8] gfortran fails to recognize the exact dynamic type of a polymorphic entity that was allocated in a external procedure)
2017-11-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/81447
	PR fortran/82783
	* resolve.c (resolve_component): There is no need to resolve
	the components of a use associated vtype.
	(resolve_fl_derived): Unconditionally generate a vtable for any
	module derived type, as long as the standard is F2003 or later
	and it is not a vtype or a PDT template.

2017-11-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/81447
	* gfortran.dg/class_65.f90: New test.
	* gfortran.dg/alloc_comp_basics_1.f90: Increase builtin_free
	count from 18 to 21.
	* gfortran.dg/allocatable_scalar_9.f90: Increase builtin_free
	count from 32 to 54.
	* gfortran.dg/auto_dealloc_1.f90: Increase builtin_free
	count from 4 to 10.
	* gfortran.dg/coarray_lib_realloc_1.f90: Increase builtin_free
	count from 3 to 6. Likewise _gfortran_caf_deregister from 2 to
	3, builtin_malloc from 1 to 4 and builtin_memcpy|= MEM from
	2 to 5.
	* gfortran.dg/finalize_28.f90: Increase builtin_free
	count from 3 to 6.
	* gfortran.dg/move_alloc_15.f90: Increase builtin_free and
	builtin_malloc counts from 11 to 14.
	* gfortran.dg/typebound_proc_27.f03: Increase builtin_free
	count from 7 to 10. Likewise builtin_malloc from 12 to 15.

From-SVN: r254429
2017-11-05 16:56:14 +00:00
GCC Administrator cd45ac3b3d Daily bump.
From-SVN: r254414
2017-11-05 00:16:08 +00:00
Steven G. Kargl 6cdeebc0e6 re PR fortran/82796 (Private+equivalence in used module breaks compilation of pure function)
2017-11-04  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/82796
	* resolve.c (resolve_equivalence): An entity in a common block within
 	a module cannot appear in an equivalence statement if the entity is
	with a pure procedure.

2017-11-04  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/82796
	* gfortran.dg/equiv_pure.f90: New test.

From-SVN: r254409
2017-11-04 16:41:09 +00:00
Andre Vehreschild 56d687fec3 trans-expr.c (gfc_trans_assignment_1): Character kind conversion may create a loop variant temporary, too.
gcc/fortran/ChangeLog:

2017-11-04  Andre Vehreschild  <vehre@gcc.gnu.org>

	* trans-expr.c (gfc_trans_assignment_1): Character kind conversion may
	create a loop variant temporary, too.
	* trans-intrinsic.c (conv_caf_send): Treat char arrays as arrays and
	not as scalars.
	* trans.c (get_array_span): Take the character kind into account when
	doing pointer arithmetic.

gcc/testsuite/ChangeLog:

2017-11-04  Andre Vehreschild  <vehre@gcc.gnu.org>

	* gfortran.dg/coarray/send_char_array_1.f90: New test.

From-SVN: r254408
2017-11-04 15:37:03 +01:00
GCC Administrator 74d0b7cff0 Daily bump.
From-SVN: r254401
2017-11-04 00:16:11 +00:00
Paul Thomas 726e7a70b9 re PR fortran/81735 (double free or corruption (fasttop) error (SIGABRT) with character(:) and custom return type with allocatable)
2017-11-03  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/81735
	* trans-decl.c (gfc_trans_deferred_vars): Correct case where
	'tmp' can be used unititialized.

2017-11-03  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/81735
	* gfortran.dg/pr81735.f90: New test.

From-SVN: r254389
2017-11-03 19:01:29 +00:00
Wilco Dijkstra cebaca3600 PR60580: Fix frame pointer option magic
To fix PR60580 simplify the logic in aarch64_override_options_after_change_1 (). 
If the frame pointer is enabled, set it to a special value that behaves similar
to frame pointer omission.  If we don't do this all leaf functions will get a
frame pointer even if flag_omit_leaf_frame_pointer is set.

If flag_omit_frame_pointer has this special value, we must force the frame
pointer if not in a leaf function.  We also need to force it in a leaf function
if flag_omit_frame_pointer is not set or if LR is used.

Doing this allows both -fomit-frame-pointer and -fomit-leaf-frame-pointer to be
independently set and changed in each function with the expected behaviour.

    gcc/
	PR middle-end/60580
	* config/aarch64/aarch64.c (aarch64_frame_pointer_required)
	Check special value of flag_omit_frame_pointer.
	(aarch64_can_eliminate): Likewise.
	(aarch64_override_options_after_change_1): Simplify handling of
	-fomit-frame-pointer and -fomit-leaf-frame-pointer.

From-SVN: r254377
2017-11-03 15:01:10 +00:00
GCC Administrator a3d5fd7670 Daily bump.
From-SVN: r254363
2017-11-03 00:16:16 +00:00
Eric Botcazou f92892ddbb Move testsuite entry to proper file
From-SVN: r254347
2017-11-02 15:02:23 +00:00
GCC Administrator 64e562b214 Daily bump.
From-SVN: r254333
2017-11-02 00:16:10 +00:00
Tamar Christina 64814d1e43 backport: [multiple changes]
2017-11-01  Tamar Christina  <tamar.christina@arm.com>                                                                                                           

        Backported from trunk
        * gcc.dg/vect/vect-align-1.c: Fix vect_hw_misalign condition.
        * gcc.dg/vect/vect-align-2.c: Likewise.
        * gcc.dg/vect/vect-multitypes-1.c: Likewise

2017-11-01  Tamar Christina  <tamar.christina@arm.com>

        Backported from trunk
        * gcc.dg/vect/vect-multitypes-1.c: Correct target selector.

2017-11-01  Christophe Lyon  <christophe.lyon@linaro.org>

        Backported from trunk
        * lib/target-supports.exp (check_effective_target_vect_hw_misalign):
        Fix arm check.

From-SVN: r254301
2017-11-01 11:57:48 +00:00
Paul Thomas 3ce323d917 re PR libfortran/80850 (Sourced allocate() fails to allocate a pointer)
2017-11-01  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/80850
	* trans_expr.c (gfc_conv_procedure_call): When passing a class
	argument to an unlimited polymorphic dummy, it is wrong to cast
	the passed expression as unlimited, unless it is unlimited. The
	correct way is to assign to each of the fields and set the _len
	field to zero.

2017-11-01  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/80850
	* gfortran.dg/class_64_f90 : New test.

From-SVN: r254299
2017-11-01 11:29:07 +00:00
Martin Jambor aafe60b2f4 [PR 81702] Remove devirtualization assert
2017-11-01  Martin Jambor  <mjambor@suse.cz>

	PR c++/81702
	* gimple-fold.c (gimple_get_virt_method_for_vtable): Remove assert.

testsuite/
	* g++.dg/tree-ssa/pr81702.C: New test.

From-SVN: r254295
2017-11-01 11:35:13 +01:00
Paul Thomas 1281989b2b re PR libfortran/80850 (Sourced allocate() fails to allocate a pointer)
2017-11-01  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/80850
	* trans_expr.c (gfc_conv_procedure_call): When passing a class
	argument to an unlimited polymorphic dummy, it is wrong to cast
	the passed expression as unlimited, unless it is unlimited. The
	correct way is to assign to each of the fields and set the _len
	field to zero.

2017-11-01  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/80850
	* gfortran.dg/class_64_f90 : New test.

From-SVN: r254293
2017-11-01 09:33:26 +00:00
GCC Administrator 9f746a1f29 Daily bump.
From-SVN: r254286
2017-11-01 00:16:16 +00:00
Uros Bizjak 902b2d9d0a re PR target/82772 (GCC crashes as compiling ags_thread.c source file on alpha architecture)
PR target/82772
	* config/alpha/sync.md (fetchop_constr) <and>: Change to "rINM".

From-SVN: r254254
2017-10-31 11:34:55 +01:00
GCC Administrator 9e87e3a81e Daily bump.
From-SVN: r254248
2017-10-31 00:16:10 +00:00
Paolo Carlini 4fb0491161 re PR c++/82085 (ICE: Template variable reference used in nested template alias)
/cp
2017-10-30  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/82085
	* pt.c (tsubst_copy_and_build, [INDIRECT_REF]): For a REFERENCE_REF_P,
	unconditionally call convert_from_reference.

/testsuite
2017-10-30  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/82085
	* g++.dg/cpp1y/var-templ56.C: New.

From-SVN: r254240
2017-10-30 19:17:40 +00:00
GCC Administrator 5a69d9d5da Daily bump.
From-SVN: r254209
2017-10-30 00:16:18 +00:00
GCC Administrator 56ee567a87 Daily bump.
From-SVN: r254202
2017-10-29 00:16:09 +00:00
Andre Vehreschild 202536931c check.c (gfc_check_co_reduce): Clarify error message.
gcc/fortran/ChangeLog:

2017-10-28  Andre Vehreschild  <vehre@gcc.gnu.org>

	* check.c (gfc_check_co_reduce): Clarify error message.

From-SVN: r254198
2017-10-28 16:56:06 +02:00
Paul Thomas d138f8ec62 re PR fortran/81758 ([OOP] Broken vtab)
2017-10-28  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/81758
	* trans-expr.c (trans_class_vptr_len_assignment): 'vptr_expr'
	must only be set if the right hand side expression is of type
	class.

2017-10-28  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/81758
	* gfortran.dg/class_63.f90: New test.

From-SVN: r254196
2017-10-28 08:53:19 +00:00
GCC Administrator 6db8d46fb4 Daily bump.
From-SVN: r254191
2017-10-28 00:16:13 +00:00
Jakub Jelinek 9dccb36f6b backport: re PR c++/82159 (ICE: in assign_temp, at function.c:961)
Backported from mainline
	2017-10-12  Jakub Jelinek  <jakub@redhat.com>

	PR c++/82159
	* expr.c (store_field): Don't optimize away bitsize == 0 store
	from CALL_EXPR with addressable return type.

	* g++.dg/opt/pr82159-2.C: New test.

From-SVN: r254181
2017-10-27 22:35:06 +02:00
Jakub Jelinek 02a55dcbaf backport: re PR c++/82373 (syntax error in error message)
Backported from mainline
	2017-10-04  Jakub Jelinek  <jakub@redhat.com>

	PR c++/82373
	* error.c (dump_function_decl): If show_return, call dump_type_suffix
	on the same return type dump_type_prefix has been called on.

	* g++.dg/cpp1y/pr82373.C: New test.

From-SVN: r254180
2017-10-27 22:34:22 +02:00
Jakub Jelinek d84264fb75 backport: re PR sanitizer/81715 (asan-stack=1 redzone allocation is too inflexible)
Backported from mainline
	2017-09-21  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/81715
	* tree-inline.c (expand_call_inline): Emit clobber stmts for
	VAR_DECLs to which addressable non-volatile parameters are mapped
	and for id->retvar after the return value assignment, though
	for -fsanitize=kernel-address only.  Clear id->retval and id->retbnd
	after inlining.

	* g++.dg/asan/pr81715.C: New test.

From-SVN: r254179
2017-10-27 22:33:35 +02:00
Jakub Jelinek 7b3d2ce965 backport: re PR c/82234 (__builtin_shuffle is not in the keyword index)
Backported from mainline
	2017-09-18  Jakub Jelinek  <jakub@redhat.com>

	PR c/82234
	* doc/extend.texi: Add @findex entry for __builtin_shuffle.

From-SVN: r254178
2017-10-27 22:32:47 +02:00
Jakub Jelinek eeecd15ffc backport: re PR rtl-optimization/82192 (gcc produces incorrect code with -O2 and bit-field)
Backported from mainline
	2017-09-15  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/82192
	* combine.c (make_extraction): Don't look through non-paradoxical
	SUBREGs or TRUNCATE if pos + len is or might be bigger than
	inner's mode.

	* gcc.c-torture/execute/pr82192.c: New test.

From-SVN: r254177
2017-10-27 22:32:21 +02:00
Jakub Jelinek dba9a0fe80 re PR target/82703 (Wrong addition of std::array components with -O2 -ftree-loop-vectorize -ftree-slp-vectorize (works fine with -O2))
PR target/82703
	* config/i386/i386-protos.h (maybe_get_pool_constant): Removed.
	* config/i386/i386.c (maybe_get_pool_constant): Removed.
	(ix86_split_to_parts): Use avoid_constant_pool_reference instead of
	maybe_get_pool_constant.
	* config/i386/predicates.md (zero_extended_scalar_load_operand):
	Likewise.

	* gcc.dg/pr82703.c: New test.

From-SVN: r254146
2017-10-27 14:25:34 +02:00
GCC Administrator c14baec783 Daily bump.
From-SVN: r254130
2017-10-27 00:16:15 +00:00
GCC Administrator 8c8bbddf95 Daily bump.
From-SVN: r254095
2017-10-26 00:16:09 +00:00
GCC Administrator ebeefa2420 Daily bump.
From-SVN: r254065
2017-10-25 00:16:12 +00:00
Qing Zhao 631e4d36eb re PR middle-end/80295 (ICE in __builtin_update_setjmp_buf expander)
gcc/ChangeLog

2017-10-24  Qing Zhao <qing.zhao@oracle.com>
	    Wilco Dijkstra <wilco.dijkstra@arm.com>

        * builtins.c (expand_builtin_update_setjmp_buf): Add a
        converstion to Pmode from the buf_addr.

gcc/testsuite/ChangeLog

2017-10-24  Qing Zhao <qing.zhao@oracle.com>
	    Wilco Dijkstra <wilco.dijkstra@arm.com>

        PR middle-end/80295
        * gcc.target/aarch64/pr80295.c: New test.

Co-Authored-By: Wilco Dijkstra <wdijkstr@arm.com>

From-SVN: r254063
2017-10-24 22:46:19 +00:00
GCC Administrator 58b9b59192 Daily bump.
From-SVN: r254029
2017-10-24 00:16:10 +00:00
GCC Administrator 9063c5acf2 Daily bump.
From-SVN: r253995
2017-10-23 00:16:10 +00:00
GCC Administrator be3b9654c9 Daily bump.
From-SVN: r253981
2017-10-22 00:16:10 +00:00
Paul Thomas 735b7d675a re PR fortran/82312 ([OOP] Pointer assignment to component of class variable results wrong vptr for the variable.)
2017-10-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/82312
	* resolve.c (gfc_resolve_code): Simplify condition for class
	pointer assignments becoming regular assignments by asserting
	that only class valued targets are permitted.
	* trans-expr.c (trans_class_pointer_fcn): New function using a
	block of code from gfc_trans_pointer_assignment.
	(gfc_trans_pointer_assignment): Call the new function. Tidy up
	a minor whitespace issue.

2017-10-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/82312
	* gfortran.dg/typebound_proc_36.f90 : New test.

From-SVN: r253976
2017-10-21 17:09:43 +00:00
Eric Botcazou 1b962a501d * gcc-interface/Makefile.in: Remove bogus settings for VxWorks.
From-SVN: r253974
2017-10-21 10:45:44 +00:00
GCC Administrator cf1e972744 Daily bump.
From-SVN: r253965
2017-10-21 00:16:09 +00:00
Thomas Koenig 313b789516 backport: re PR fortran/79795 (Fortran ICE in resolve_symbol starting with r163221)
2017-10-20  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/79795
	* resolve.c (resovle_symbol): Change gcc_assert to
	sensible error message.

2017-10-20  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/79795
	* gfortran.dg/assumed_size_2.f90: New test.

From-SVN: r253951
2017-10-20 18:01:36 +00:00
Richard Biener 47ffadd915 re PR tree-optimization/82603 (ICE in ifcvt_local_dce w/ -O2 -ftree-loop-vectorize)
2017-10-20  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82603
	* tree-if-conv.c (predicate_mem_writes): Make sure to only
	remove false predicated stores.

	* gcc.dg/torture/pr82603.c: New testcase.

From-SVN: r253932
2017-10-20 11:19:03 +00:00
Richard Biener 29ad09f6a8 backport: re PR tree-optimization/82436 (465.tonto ICE in vect_get_slp_vect_defs, at tree-vect-slp.c:3410)
2017-10-20  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2017-10-06  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82436
	* tree-vect-slp.c (vect_supported_load_permutation_p): More
	conservatively choose the vectorization factor when checking
	whether we can perform the required load permutation.
	(vect_transform_slp_perm_load): Assert when we may not fail.

	* gcc.dg/vect/pr82436.c: New testcase.

From-SVN: r253931
2017-10-20 11:18:00 +00:00
GCC Administrator 1f3c9ed4ce Daily bump.
From-SVN: r253918
2017-10-20 00:16:10 +00:00
Thomas Koenig 2e2128b7c6 backport: re PR libfortran/82233 (execute_command_line causes program to stop when command fails (or does not exist))
2017-10-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR libfortran/82233
	* intrinsics/execute_command_line.c (execute_command_line):
	No call to runtime_error if cmdstat is present.

2017-10-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR libfortran/82233
	* gfortran.dg/execute_command_line_3.f90: New test.

From-SVN: r253907
2017-10-19 17:49:24 +00:00
Richard Earnshaw ca7e162896 [ARM] PR 82445 - suppress 32-bit aligned ldrd/strd peepholing with -mno-unaligned-access
Peephole patterns exist in the arm backend to spot load/store
operations to adjacent memory operations in order to convert them into
ldrd/strd instructions.  However, when we have strict alignment
enforced, then we can only do this if the accesses are known to be
64-bit aligned; this is unlikely to be the case for most loads.  The
patch adds some alignment checking to the code that validates the
addresses for use in the peephole patterns.  This should also fix
incorrect generation of ldrd/strd with unaligned accesses that could
previously have occurred on ARMv5e where all such operations must be
64-bit aligned.

I've added some new tests as well.  In doing so I discovered that the
ldrd/strd peephole tests could never fail since they would match the
source file name in the scanned assembly as well as any instructions
of the intended type.  I've fixed those by tightening the scan results
slightly.

gcc:

* config/arm/arm.c (align_ok_ldrd_strd): New function.
(mem_ok_for_ldrd_strd): New parameter align.  Extract the alignment of the
mem into it.
(gen_operands_ldrd_strd): Validate the alignment of the accesses.

testsuite:

* gcc.target/arm/peep-ldrd-1.c: Tighten test scan pattern.
* gcc.target/arm/peep-strd-1.c: Likewise.
* gcc.target/arm/peep-ldrd-2.c: New test.
* gcc.target/arm/peep-strd-2.c: New test.

From-SVN: r253891
2017-10-19 13:14:55 +00:00
GCC Administrator 925a6f3aaa Daily bump.
From-SVN: r253875
2017-10-19 00:16:09 +00:00
Segher Boessenkool b0a9b256be ira: volatile asm's are not moveable (PR82602)
A volatile asm statement can not be moved (relative to other volatile
asm, etc.), but IRA would do it nevertheless.  This patch fixes it.


	PR rtl-optimization/82602
	* ira.c (rtx_moveable_p): Return false for volatile asm.

From-SVN: r253870
2017-10-18 23:13:16 +02:00
Vladimir Makarov 9aae1b1f15 re PR middle-end/82556 (internal compiler error in curr_insn_transform, at lra-constraints.c:4307)
2017-10-18  Vladimir Makarov  <vmakarov@redhat.com>

	PR middle-end/82556
	* lra-constraints.c (curr_insn_transform): Use non-input operand
	instead of output one for matched reload.

2017-10-18  Vladimir Makarov  <vmakarov@redhat.com>

	PR middle-end/82556
	* gcc.target/i386/pr82556.c: New.

From-SVN: r253863
2017-10-18 16:47:38 +00:00
GCC Administrator 184fb54d80 Daily bump.
From-SVN: r253839
2017-10-18 00:16:10 +00:00
Eric Botcazou ec13b9b06d * gcc.dg/attr-alloc_size-11.c: UnXFAIL for visium-*-*.
From-SVN: r253832
2017-10-17 20:34:43 +00:00
Nathan Sidwell a203c78308 [C++ PATCH 82560] missing dtor call
https://gcc.gnu.org/ml/gcc-patches/2017-10/msg01068.html
	PR c++/82560
	* call.c (build_over_call): Don't pass tf_no_cleanup to nested
	calls.

	PR c++/82560
	* g++.dg/cpp0x/pr82560.C: New.

From-SVN: r253822
2017-10-17 17:27:11 +00:00
Jakub Jelinek 0c2ff9c396 re PR tree-optimization/82549 (ICE at -O1 and above: verify_gimple failed)
PR tree-optimization/82549
	* fold-const.c (optimize_bit_field_compare, fold_truth_andor_1):
	Formatting fixes.  Instead of calling make_bit_field_ref with negative
	bitpos return 0.

	* gcc.c-torture/compile/pr82549.c: New test.

From-SVN: r253816
2017-10-17 16:47:15 +02:00
GCC Administrator 7ea6f14bdc Daily bump.
From-SVN: r253800
2017-10-17 00:16:11 +00:00
Paul Thomas ce229d5066 re PR fortran/52832 ([F03] ASSOCIATE construct with proc-pointer selector is rejected)
2017-10-16  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/52832
	* match.c (gfc_match_associate): Before failing the association
	try again, allowing a proc pointer selector.

	PR fortran/80120
	PR fortran/81903
	PR fortran/82121
	* primary.c (gfc_match_varspec): Introduce 'tgt_expr', which
	points to the associate selector, if any. Go through selector
	references, after resolution for variables, to catch any full
	or section array references. If a class associate name does
	not have the same declared type as the selector, resolve the
	selector and copy the declared type to the associate name.
	Before throwing a no implicit type error, resolve all allowed
	selector expressions, and copy the resulting typespec.

	PR fortran/67543
	* resolve.c (resolve_assoc_var): Selector must cannot be the
	NULL expression and it must have a type.

	PR fortran/78152
	* resolve.c (resolve_symbol): Allow associate names to be
	coarrays.

2017-10-16  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/78512
	* gfortran.dg/associate_9.f03 : Remove XFAIL.
	* gfortran.dg/associate_26.f90 : New test.

	PR fortran/80120
	* gfortran.dg/associate_27.f90 : New test.

	PR fortran/81903
	* gfortran.dg/associate_28.f90 : New test.

	PR fortran/82121
	* gfortran.dg/associate_29.f90 : New test.

	PR fortran/67543
	* gfortran.dg/associate_30.f90 : New test.

From-SVN: r253794
2017-10-16 19:44:04 +00:00
Paul Thomas ac7b259d92 re PR fortran/81048 (incorrect derived type initialization)
2017-10-16  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/81048
	* resolve.c (resolve_symbol): Ensure that derived type array
	results get default initialization.

2017-10-16  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/81048
	* gfortran.dg/derived_init_4.f90 : New test.

From-SVN: r253793
2017-10-16 18:48:56 +00:00
GCC Administrator 0e5c063608 Daily bump.
From-SVN: r253774
2017-10-16 00:16:09 +00:00
GCC Administrator e6e519fb4f Daily bump.
From-SVN: r253766
2017-10-15 00:16:11 +00:00
GCC Administrator 8a8ca5ed30 Daily bump.
From-SVN: r253746
2017-10-14 00:16:11 +00:00
Jakub Jelinek 7aaf7ebd9b re PR target/82274 (__builtin_mul_overflow fails to detect overflow for int64_t when compiled with -m32)
PR target/82274
	* internal-fn.c (expand_mul_overflow): If both operands have
	the same highpart of -1 or 0 and the topmost bit of lowpart
	is different, overflow is if res <= 0 rather than res < 0.

	* libgcc2.c (__mulvDI3): If both operands have
	the same highpart of -1 and the topmost bit of lowpart is 0,
	multiplication overflows even if both lowparts are 0.

	* gcc.dg/pr82274-1.c: New test.
	* gcc.dg/pr82274-2.c: New test.

From-SVN: r253735
2017-10-13 19:26:28 +02:00
Jakub Jelinek f35018157d re PR target/82524 (expensive-optimizations produces wrong results)
PR target/82524
	* config/i386/i386.md (addqi_ext_1, andqi_ext_1,
	*andqi_ext_1_cc, *<code>qi_ext_1, *xorqi_ext_1_cc): Change
	=Q constraints to +Q and into insn condition add check
	that operands[0] and operands[1] are equal.
	(*addqi_ext_2, *andqi_ext_2, *<code>qi_ext_2): Change
	=Q constraints to +Q and into insn condition add check
	that operands[0] is equal to either operands[1] or operands[2].

	* gcc.c-torture/execute/pr82524.c: New test.

From-SVN: r253711
2017-10-13 09:39:42 +02:00
GCC Administrator 49edf1686f Daily bump.
From-SVN: r253703
2017-10-13 00:16:09 +00:00
GCC Administrator 975298370a Daily bump.
From-SVN: r253669
2017-10-12 00:16:08 +00:00
GCC Administrator 8a6d0ecfa1 Daily bump.
From-SVN: r253626
2017-10-11 00:16:09 +00:00
Andreas Tobler 0065f0d500 backport: config.gcc: (armv7*-*-freebsd*): New target.
2017-10-10  Andreas Tobler  <andreast@gcc.gnu.org>

    Backported from mainline r253602
    2017-10-10  Andreas Tobler  <andreast@gcc.gnu.org>

    * config.gcc: (armv7*-*-freebsd*): New target.
    (armv6*-*-freebsd*): Remove obsolete TARGET_FREEBSD_ARMv6 define.

From-SVN: r253603
2017-10-10 20:43:47 +02:00
GCC Administrator 0bf35f65aa Daily bump.
From-SVN: r253573
2017-10-10 00:16:19 +00:00
James Cowgill 9a3a146277 Backport correct Go MIPS architecture names from trunk.
Brings in the following patches:
    https://golang.org/cl/46150
    https://golang.org/cl/46151
    https://golang.org/cl/46152
    https://golang.org/cl/46153
    https://golang.org/cl/46154
    https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01777.html

	* go.test/go-test.exp (go-set-goarch): Update MIPS architecture names.

From-SVN: r253551
2017-10-09 16:59:38 +00:00
GCC Administrator 4bd0f26039 Daily bump.
From-SVN: r253535
2017-10-09 00:16:14 +00:00
GCC Administrator abfe8859e2 Daily bump.
From-SVN: r253518
2017-10-08 00:16:13 +00:00
GCC Administrator 335a0a2964 Daily bump.
From-SVN: r253505
2017-10-07 00:16:16 +00:00
Jakub Jelinek a45258d20b re PR c++/82299 (-Wuseless-cast errors on typed enums used in member data initializers in c++1z)
PR c++/82299
	* decl.c (reshape_init): Suppress warn_useless_cast for direct enum
	init.
	* typeck.c (convert_for_assignment): Likewise.

	* g++.dg/cpp0x/pr82299.C: New test.

From-SVN: r253499
2017-10-06 20:00:54 +02:00
Christophe Lyon 1e28109018 [AArch64] Backport to gcc-7 PR71727 fix -mstrict-align
2017-10-06  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/
	Backport from mainline r253242.
	2017-09-27  Christophe Lyon  <christophe.lyon@linaro.org>

	PR target/71727
	* config/aarch64/aarch64.c
	(aarch64_builtin_support_vector_misalignment): Always return false
	when misalignment is unknown.

	gcc/testsuite/
	Backport from mainline r253251.
	2017-09-27  Christophe Lyon  <christophe.lyon@linaro.org>

	PR target/71727
	* gcc.target/aarch64/pr71727-2.c: New test.

From-SVN: r253477
2017-10-06 09:38:51 +02:00
GCC Administrator 32fe08bb83 Daily bump.
From-SVN: r253471
2017-10-06 00:16:20 +00:00
Jason Merrill 74a2b1d572 * call.c (convert_arg_to_ellipsis): Use the result of force_rvalue.
From-SVN: r253466
2017-10-05 17:43:01 -04:00
Eric Botcazou f64766fde8 re PR ada/82393 (Compilation error on cygwin64)
PR ada/82393
	* mingw32.h (_O_U8TEXT, _O_U16TEXT, _O_WTEXT): Delete.
	* sysdep.c (__gnat_set_mode ): Use DJGPP version for Cygwin.

From-SVN: r253455
2017-10-05 16:32:40 +00:00
GCC Administrator 8f88128566 Daily bump.
From-SVN: r253435
2017-10-05 00:16:14 +00:00
Jason Merrill 3eb1e9c89d PR c++/82406 - C++17 error with noexcept function type
PR c++/70029 - ICE with ref-qualifier and -flto
gcc/
	* langhooks.h (struct lang_hooks_for_types): Add
	copy_lang_qualifiers.
	* langhooks-def.h (LANG_HOOKS_COPY_LANG_QUALIFIERS): Default to
	NULL.
	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it.
	* tree.c (verify_type): Re-enable TYPE_CANONICAL main variant check.
	(build_type_attribute_qual_variant): Use copy_lang_qualifiers.
gcc/cp/
	* tree.c (cxx_copy_lang_qualifiers): New.
	* cp-tree.h: Declare it.
	* cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.

From-SVN: r253424
2017-10-04 13:47:08 -04:00
Jason Merrill 3d2be6b44d PR c++/81525 - broken handling of auto in generic lambda.
* pt.c (tsubst_decl) [VAR_DECL]: Use strip_innermost_template_args.

From-SVN: r253415
2017-10-04 11:38:24 -04:00
GCC Administrator b33d945ba8 Daily bump.
From-SVN: r253392
2017-10-04 00:16:17 +00:00
Thomas Koenig 0efe5ea92c backport: re PR fortran/80118 (ICE with zero size parameter array)
2017-10-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
	    Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from trunk
	PR fortran/80118
	* expr.c (gfc_get_full_arrayspec_from_expr): If there is
	no symtree, set array spec to NULL.

2017-10-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
	    Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from trunk
	PR fortran/80118
	* gfortran.dg/zero_sized_7.f90: New test.



Co-Authored-By: Steven G. Kargl <kargl@gcc.gnu.org>

From-SVN: r253383
2017-10-03 15:50:45 +00:00
GCC Administrator ede8827db7 Daily bump.
From-SVN: r253375
2017-10-03 00:16:13 +00:00
Bill Schmidt 21cc5b7750 backport: re PR tree-optimization/82337 (ICE: SSA corruption at tree-ssa-coalesce.c:1010)
[gcc]

2017-10-02  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	Backport from mainline
	2017-09-29  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/82337
	* gimple-ssa-strength-reduction.c (find_phi_def): Don't record a
	phi definition if the PHI result appears in an abnormal PHI.
	(find_basis_for_base_expr): Don't record a basis if the LHS of the
	basis appears in an abnormal PHI.

[gcc]

2017-10-02  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	Backport from mainline
	2017-09-29  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/82337
	* gcc.c-torture/compile/pr82337.c: New file.

From-SVN: r253359
2017-10-02 18:07:45 +00:00
GCC Administrator 087d0805fb Daily bump.
From-SVN: r253333
2017-10-02 00:16:15 +00:00
GCC Administrator 1fd7cad65d Daily bump.
From-SVN: r253326
2017-10-01 00:16:15 +00:00
Jakub Jelinek 0624feee0b i386.c (ix86_split_idivmod): Use mode instead of always SImode for DIV and MOD in REG_EQUAL notes.
* config/i386/i386.c (ix86_split_idivmod): Use mode instead of
	always SImode for DIV and MOD in REG_EQUAL notes.

From-SVN: r253320
2017-09-30 10:27:27 +02:00
Jakub Jelinek def8dcdb1f backport: re PR c/82340 (volatile ignored in compound literal)
Backported from mainline
	2017-09-29  Jakub Jelinek  <jakub@redhat.com>

	PR c/82340
	* c-decl.c (build_compound_literal): Use c_apply_type_quals_to_decl
	instead of trying to set just TREE_READONLY manually.

	* gcc.dg/tree-ssa/pr82340.c: New test.

From-SVN: r253319
2017-09-30 10:26:32 +02:00
Jakub Jelinek 4eb003869d backport: re PR c++/82159 (ICE: in assign_temp, at function.c:961)
Backported from mainline
	2017-09-27  Jakub Jelinek  <jakub@redhat.com>

	PR c++/82159
	* gimplify.c (gimplify_modify_expr): Don't optimize away zero sized
	lhs from calls if the lhs has addressable type.

	* g++.dg/opt/pr82159.C: New test.

From-SVN: r253318
2017-09-30 10:25:02 +02:00
GCC Administrator f11eb23ea3 Daily bump.
From-SVN: r253314
2017-09-30 00:16:14 +00:00
Krister Walfridsson ac5cb7c9a0 backport: re PR target/77480 (netbsd specfile will not link against libc when building -shared (+patch))
2017-09-29  Krister Walfridsson  <krister.walfridsson@gmail.com>

	Backport from mainline
	2017-06-29  Maya Rashish  <coypu@sdf.org>

	PR target/77480
	* config/netbsd.h (NETBSD_LIB_SPEC): Add -lc when creating shared
	objects.

From-SVN: r253309
2017-09-29 21:34:00 +00:00
Krister Walfridsson 4ffa3da132 backport: re PR target/39570 (cabs and cabsf are named differently on NetBSD 5)
2017-09-29  Krister Walfridsson  <krister.walfridsson@gmail.com>

	Backport from mainline
	2017-09-26  Krister Walfridsson  <krister.walfridsson@gmail.com>

	PR target/39570
	* gcc/config/netbsd-protos.h: New file.
	* gcc/config/netbsd.c: New file.
	* gcc/config/netbsd.h (SUBTARGET_INIT_BUILTINS): Define.
	* gcc/config/t-netbsd: New file.
	* gcc/config.gcc (tm_p_file): Add netbsd-protos.h.
	(tmake_file) Add t-netbsd.
	(extra_objs) Add netbsd.o.

From-SVN: r253283
2017-09-29 09:38:08 +00:00
GCC Administrator e3929263bc Daily bump.
From-SVN: r253273
2017-09-29 00:16:16 +00:00
Krister Walfridsson 98c9c18131 backport: re PR target/80600 (hidden symbol `__cpu_model' is referenced by DSO)
gcc/ChangeLog:

	Backport from mainline
	2017-05-14  Krister Walfridsson  <krister.walfridsson@gmail.com>

	PR target/80600
	* config/netbsd.h (NETBSD_LIBGCC_SPEC): Always add -lgcc.

libgcc/ChangeLog:

	Backport from mainline
	2017-05-14  Krister Walfridsson  <krister.walfridsson@gmail.com>

	PR target/80600
	* config.host (*-*-netbsd*): Add t-slibgcc-libgcc to tmake_file.

From-SVN: r253263
2017-09-28 19:17:51 +00:00
GCC Administrator 920436fedb Daily bump.
From-SVN: r253247
2017-09-28 00:16:13 +00:00
Christophe Lyon dc6124e513 backport: sourcebuild.texi (ARM-specific attributes): Document new arm_neon_ok_no_float_abi effective target.
Backport from trunk r249639.

2017-09-27  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/
 	Backport from trunk r249639.
 	2017-06-26  Christophe Lyon  <christophe.lyon@linaro.org>

	* doc/sourcebuild.texi (ARM-specific attributes): Document new
	arm_neon_ok_no_float_abi effective target.

	gcc/testsuite/
	Backport from trunk r249639.
	2017-06-26  Christophe Lyon  <christophe.lyon@linaro.org>

	* lib/target-supports.exp
	(check_effective_target_arm_neon_ok_nocache): Add flags with
	-mfloat-abi=hard. Include arm_neon.h.
	(check_effective_target_arm_neon_ok_no_float_abi_nocache): New.
	(check_effective_target_arm_neon_ok_no_float_abi): New.
	* gcc.target/arm/lto/pr65837_0.c: Require
	arm_neon_ok_no_float_abi. Add -mfpu=neon to dg-lto-options.
	* gcc.target/arm/lto/pr65837-attr_0.c: Require
	arm_neon_ok_no_float_abi. Remove dg-suppress-ld-options.

From-SVN: r253234
2017-09-27 17:40:39 +02:00
GCC Administrator dba29deff3 Daily bump.
From-SVN: r253221
2017-09-27 00:16:14 +00:00
Richard Biener 87c7cf4766 Backport PRs 82244, 82264, 82276, 82285, 82291
2017-09-26  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2017-09-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82244
	* tree-vrp.c (remove_range_assertions): Do not propagate
	a constant to abnormals but replace the assert with a copy.

	* gcc.dg/torture/pr82244.c: New testcase.

	2017-09-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82276
	PR tree-optimization/82244
	* tree-vrp.c (build_assert_expr_for): Set
	SSA_NAME_OCCURS_IN_ABNORMAL_PHI if the variable we assert on
	has it set.
	(remove_range_assertions): Revert earlier change.

	* gcc.dg/torture/pr82276.c: New testcase.

	2017-09-20  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82264
	* tree-ssa-sccvn.c (vn_phi_eq): Use safe_dyn_cast to check
	for GIMPLE_CONDs.
	(vn_phi_lookup): Likewise.
	(vn_phi_insert): Likewise.
	* is-a.h (safe_dyn_cast): New.

	* gcc.dg/torture/pr82264.c: New testcase.

	2017-09-25  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82285
	* tree-vect-patterns.c (vect_recog_bool_pattern): Also handle
	enumeral types.

	* gcc.dg/torture/pr82285.c: New testcase.

	2017-09-22  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82291
	* tree-if-conv.c (predicate_mem_writes): Make sure to
	remove writes in blocks predicated with false.

	* gcc.dg/torture/pr82291.c: New testcase.

From-SVN: r253190
2017-09-26 10:16:40 +00:00
GCC Administrator bff800cf76 Daily bump.
From-SVN: r253184
2017-09-26 00:16:13 +00:00
GCC Administrator 446aa47469 Daily bump.
From-SVN: r253130
2017-09-25 00:16:12 +00:00