Commit Graph

178457 Commits

Author SHA1 Message Date
Thomas Schwinge
fdc9db2539 [testsuite] Unset 'offload_target' after use
..., so that we don't leak this into '*.exp' files running later.

This is relevant after commit efc16503ca "handle
dumpbase in offloading, adjust testsuite" -- I was confused why in a
(simplified) testing sequence as follows:

  default 'libgomp.c/c.exp'
  default 'libgomp.oacc-c/c.exp'
  '-m32' 'libgomp.c/c.exp'
  '-m32' 'libgomp.oacc-c/c.exp'

..., the "'-m32' 'libgomp.c/c.exp'" variant would not execute any offloading
dump scanning.  The reason is that the "default 'libgomp.oacc-c/c.exp'" variant
ends with 'offload_target=disable' set, so that's what the "'-m32'
'libgomp.c/c.exp'" variant would then see, in particular
'gcc/testsuite/lib/scanoffload.exp:scoff'.

	libgomp/
	* testsuite/libgomp.oacc-c++/c++.exp: Unset 'offload_target' after
	use.
	* testsuite/libgomp.oacc-c/c.exp: Likewise.
	* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
2020-07-24 14:00:43 +02:00
Thomas Schwinge
3407bfc136 [testsuite] Fix TCL syntax error in 'scan-dump-dem-not'
ERROR: [...]: error executing dg-final: missing close-bracket

Bug introduced in commit 2ef1bce664 (r188996),
long ago.

	gcc/testsuite/
	* lib/scandump.exp (scan-dump-dem-not): Fix TCL syntax error.
2020-07-24 13:21:51 +02:00
Szabolcs Nagy
ab240ab509 aarch64: add PAC-RET protection to libitm sjlj.S
_ITM_beginTransaction is a 'returns_twice' function that saves x30
on the stack as part of gtm_jmpbuf (that is passed down to
GTM_begin_transaction), but the saved x30 is also used for return.

The return path should be protected so we don't leave an
  ldp x29, x30, [sp]
  ret
gadget in the code, so x30 is signed on function entry. This
exposes the signed address in the gtm_jmpbuf too. The jmpbuf does
not need a signed address since GTM_longjmp uses
  ldp x29, x30, [x1]
  br x30
and with BTI there is a BTI j at the _ITM_beginTransaction call site
where this jump returns. Using PAC does not hurt: the gtm_jmpbuf is
internal to libitm and its layout is only used by sjlj.S so the
signed address does not escape. Saving signed x30 into gtm_jmpbuf
provides a bit of extra protection, but more importantly it allows
adding the PAC-RET support without changing the existing code much.

In theory bti and pac-ret protection can be added unconditionally
since the instructions are in the nop space, in practice they
can cause trouble if some tooling does not understand the gnu
property note (e.g. old binutils) or some unwinder or debugger
does not understand the new dwarf op code used for pac-ret (e.g
old gdb). So the code is written to only support branch-protection
according to the code generation options.

libitm/ChangeLog:

	* config/aarch64/sjlj.S: Add conditional pac-ret protection.
2020-07-24 11:44:53 +01:00
Szabolcs Nagy
edfb3a30a6 aarch64: add PAC GNU property note to libgcc lse.S
This note is not used anywhere currently but it is supposed to mark
objects if the return address is protected with PAC on the stack.
Since lse.S only has leaf functions the return address is never
saved on the stack so we can add the note.

The note is only added if pac-ret is enabled because it can cause
problems with old linkers and we don't have checks for that. This
can be changed later to be unconditional, for now it is consistent
with how gcc generates the notes.

libgcc/ChangeLog:

	* config/aarch64/lse.S: Add PAC property note.
2020-07-24 11:44:43 +01:00
H.J. Lu
b0e5ec934e Restrict PR middle-end/95886 x86 test to !ia32
Since gcc.target/i386/memcpy-pr95886.c requires 64-bit register, restrict
it to !ia32.

	PR middle-end/95886
	* gcc.target/i386/memcpy-pr95886.c: Restrict test to !ia32.
2020-07-23 19:27:16 -07:00
GCC Administrator
9bb403dca6 Daily bump. 2020-07-24 00:16:20 +00:00
Clément Chigot
83cc5e2b2f libgo: add AIX FAT libraries support
AIX-style libraries contains both 32 and 64 bit shared objects.
This patch follows the adding of FAT libraries support in other gcc
libraries (libgcc, listdc++, etc).

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/242957
2020-07-23 14:26:36 -07:00
Martin Sebor
8598657c60 Restrict test to LP64.
gcc/testsuite/ChangeLog:

	PR testsuite/95886
	* gcc.target/i386/memcpy-pr95886.c: Restrict test to LP64.
2020-07-23 14:10:14 -06:00
Julian Brown
25bce75c77 openacc: Remove unnecessary detach finalization
The call to gomp_detach_pointer in gomp_unmap_vars_internal does not
need to force finalization, and doing so may mask mismatched pointer
attachments/detachments. This patch removes the forcing.

2020-07-16  Julian Brown  <julian@codesourcery.com>
	    Thomas Schwinge  <thomas@codesourcery.com>

libgomp/
	* target.c (gomp_unmap_vars_internal): Remove unnecessary forcing of
	finalization for detach operation.
	* testsuite/libgomp.oacc-c-c++-common/structured-detach-underflow.c:
	New test.

Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
2020-07-23 12:50:07 -07:00
Roger Sayle
d4b3ea941b Resolve regression rtl-optimization/96298. Sorry for the breakage.
2020-07-23  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
	PR rtl-optimization/96298
	* simplify-rtx.c (simplify_binary_operation_1) [XOR]: Xor doesn't
	distribute over xor, so (a^b)^(c^b) is not the same as (a^c)^b.
2020-07-23 18:48:54 +01:00
Patrick Palka
914966e499 contrib/vimrc: detect more C-like files
Currently this script doesn't set the indentation style for the standard
library headers under libstdc++/ because they lack a file extension.
But they do have a modeline, so the file type is still set appropriately
by Vim.  So by inspecting &filetype, we can also detect these standard
library headers as C-like files.

contrib/ChangeLog:

	* vimrc (SetStyle): Also inspect &filetype to determine whether
	a file is C-like.
2020-07-23 13:34:00 -04:00
Tobias Burnus
084dc63a02 OpenMP: Support 'lastprivate (conditional:' in Fortran
gcc/fortran/ChangeLog:

	* gfortran.h (gfc_omp_namelist): Add lastprivate_conditional.
	* openmp.c (gfc_match_omp_clauses): Handle 'conditional:'
	modifier of 'lastprivate'.
	* trans-openmp.c (gfc_omp_clause_default_ctor): Don't assert
	on OMP_CLAUSE__CONDTEMP_ and other OMP_*TEMP_.
	(gfc_trans_omp_variable_list): Handle lastprivate_conditional.

gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/lastprivate-conditional-1.f90: New test.
	* gfortran.dg/gomp/lastprivate-conditional-2.f90: New test.
	* gfortran.dg/gomp/lastprivate-conditional-3.f90: New test.
	* gfortran.dg/gomp/lastprivate-conditional-4.f90: New test.
	* gfortran.dg/gomp/lastprivate-conditional-5.f90: New test.
2020-07-23 17:37:35 +02:00
Arnaud Charlet
ad1bea3a4b [Ada] Stub CUDA_Execute and CUDA_Global pragmas
This commit adds CUDA_Execute and CUDA_Global to the list of allowed
pragmas. It also implements basic validation of said pragmas.

gcc/ada/

	* aspects.ads: Declare CUDA_Global as aspect.
	* einfo.ads: Use Flag118 for the Is_CUDA_Kernel flag.
	(Set_Is_CUDA_Kernel): New function.
	(Is_CUDA_Kernel): New function.
	* einfo.adb (Set_Is_CUDA_Kernel): New function.
	(Is_CUDA_Kernel): New function.
	* par-prag.adb (Prag): Ignore Pragma_CUDA_Execute and
	Pragma_CUDA_global.
	* rtsfind.ads: Define CUDA.Driver_Types.Stream_T and
	CUDA.Vector_Types.Dim3 entities
	* rtsfind.adb: Define CUDA_Descendant subtype.
	(Get_Unit_Name): Handle CUDA_Descendant packages.
	* sem_prag.ads: Mark CUDA_Global as aspect-specifying pragma.
	* sem_prag.adb (Analyze_Pragma): Validate Pragma_CUDA_Execute and
	Pragma_CUDA_Global.
	* snames.ads-tmpl: Define Name_CUDA_Execute and Name_CUDA_Global.
2020-07-23 09:56:56 -04:00
Arnaud Charlet
3968b02a4b [Ada] Ada2020: AI12-0027 Access values and unaliased component
Access values should never designate unaliased components.
This new feature is documented in AI12-0027-1.

gcc/ada/

	* sem_ch13.ads (Same_Representation): Renamed as
	Has_Compatible_Representation because now the order of the arguments
	are taken into account; its formals are also renamed as Target_Type
	and Operand_Type.
	* sem_ch13.adb (Same_Representation): Renamed and moved to place the
	routine in alphabetic order.
	* sem_attr.adb (Prefix_With_Safe_Accessibility_Level): New subprogram.
	(Resolve_Attribute): Check that the prefix of attribute Access
	does not have a value conversion of an array type.
	* sem_res.adb (Resolve_Actuals): Remove restrictive check on view
	conversions which required matching value of Has_Aliased_Components of
	formals and actuals.
	* exp_ch4.adb (Handle_Changed_Representation): Update call to
	Same_Representation.
	(Expand_N_Type_Conversion): Update call to Same_Representation.
	* exp_ch5.adb (Change_Of_Representation): Update call to
	Same_Representation.
	* exp_ch6.adb (Add_Call_By_Copy_Code): Update call to
	Same_Representation.
	(Expand_Actuals): Update call to Same_Representation.
	(Expand_Call_Helper): Update call to Same_Representation.
2020-07-23 09:42:06 -04:00
Dong JianQiang
de8bfcc8e4
gcov-tool: Fix merging of different endian coverage data [PR96267]
2020-07-21  Dong JianQiang  <dongjianqiang2@huawei.com>

gcc/ChangeLog:

	PR gcov-profile/96267
	* gcov-io.c (gcov_open): enable if IN_GCOV_TOOL.
2020-07-23 15:04:17 +02:00
Tobias Burnus
2631d95ae2 libomp: Add omp_depend_kind to omp_lib.{f90,h}
gcc/fortran/ChangeLog:

	* intrinsic.texi (OMP_LIB_KINDS): Add omp_depend_kind.

libgomp/ChangeLog:

	* configure.ac: Add OMP_DEPEND_KIND and OMP_INT128_SIZE.
	* libgomp_f.h.in (omp_check_defines): Check whether
	sizeof of determined Fortran kind and C typedef match.
	* omp_lib.f90.in: Add omp_depened_kind.
	* omp_lib.h.in: Likewise; fix omp_alloctrait_key_kind.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
2020-07-23 15:02:15 +02:00
Arnaud Charlet
0c111868b7 [Ada] Add push/pop capability in Output
Add the capability to use the Write_* procedures in an environment where
you want to write debugging info but still use them to write to other
files (such a C source files).

gcc/ada/

	* output.ads (Push_Output, Pop_Output): New procedures.
	* output.adb (FD_Array, FD_Stack, FD_Stack_Idx): New type and vars.
	(Push_Output, Pop_Output): New procedures.
2020-07-23 08:57:22 -04:00
Kewen Lin
2949e08657 rs6000: Rename function adjust_vectorization_cost
This patch is to rename the existing function adjust_vectorization_cost
to rs6000_adjust_vect_cost_per_stmt, to avoid some confusion.

gcc/ChangeLog:

	* config/rs6000/rs6000.c (adjust_vectorization_cost): Renamed to ...
	(rs6000_adjust_vect_cost_per_stmt): ... here.
	(rs6000_add_stmt_cost): Rename adjust_vectorization_cost to
	rs6000_adjust_vect_cost_per_stmt.
2020-07-23 07:40:22 -05:00
Kewen Lin
ead2be56f0 ivopts: Handle vector with length IFNs
This patch is to handle vector with length internal functions
IFN_LEN_LOAD and IFN_LEN_STORE in IVOPTS.

gcc/ChangeLog:

	* tree-ssa-loop-ivopts.c (get_mem_type_for_internal_fn): Handle
	IFN_LEN_LOAD and IFN_LEN_STORE.
	(get_alias_ptr_type_for_ptr_address): Likewise.
2020-07-23 07:40:09 -05:00
Tobias Burnus
3eb72737a2 OpenMP: Update gcc/fortran/*.texi
gcc/fortran/ChangeLog:

	* gfortran.texi (Standards): Update URL; state that OpenMP 4.5
	is supported and 5.0 is partially.
	* intrinsic.texi (OpenMP Modules): Refer also to OpenMP 5.0;
	(OMP_LIB): Add missing derived type and new named constants.
2020-07-23 12:55:53 +02:00
Martin Liska
24c35a5ef3
gcov: create folders with 0777.
libgcc/ChangeLog:

	PR gcov-profile/96035
	* libgcov-driver-system.c: Create gcov folders with 0777
	so that it respects a system umask.
2020-07-23 12:20:40 +02:00
Martin Liska
02cada26e4
gcc-changelog: fix when somebody reverts a backport
contrib/ChangeLog:

	* gcc-changelog/git_commit.py: When reverting a backport,
	we should print only Revert header.
2020-07-23 10:43:25 +02:00
Kito Cheng
2ca1b6d009 PR target/96260 - KASAN should work even back-end not porting anything.
- Most KASAN function don't need any porting anything in back-end
   except asan stack protection.

 - However kernel will given shadow offset when enable asan stack
   protection, so eveything in KASAN can work if shadow offset is given.

 - Verified with x86 and risc-v.

 - Verified with RISC-V linux kernel.

gcc/ChangeLog:

	PR target/96260
	* asan.c (asan_shadow_offset_set_p): New.
	* asan.h (asan_shadow_offset_set_p): Ditto.
	* toplev.c (process_options): Allow -fsanitize=kernel-address
	even TARGET_ASAN_SHADOW_OFFSET not implemented, only check when
	asan stack protection is enabled.

gcc/testsuite/ChangeLog:

	PR target/96260
	* gcc.target/riscv/pr91441.c: Update warning message.
	* gcc.target/riscv/pr96260.c: New.
2020-07-23 14:57:31 +08:00
Hans-Peter Nilsson
5029d42c40 c-c++-common/builtin-has-attribute-4.c: Require visibility.
Another missed attribute-visibility-requirement, causing a failure for
e.g. mmix-knuth-mmixware.  Committed as obvious.

gcc/testsuite:
	* c-c++-common/builtin-has-attribute-4.c: Require visibility.
2020-07-23 04:28:27 +02:00
GCC Administrator
3ea9abca71 Daily bump. 2020-07-23 00:16:28 +00:00
Jonathan Wakely
1f53367fb5 libstdc++: Add static assertions to futures and promises [LWG 3458]
LWG recently decided it should be ill-formed to instantiate std::future
and std::shared_future for types that can't be returned from a function.
This adds static assertions to enforce it (std::future already failed,
but this makes the error more understandable).

LWG 3466 extends that to std::promise. The actual constraint is that
t.~T() is well-formed for the primary template, but rejecting arrays and
functions as done for futures matches that condition.

libstdc++-v3/ChangeLog:

	* include/std/future (future, shared_future, promise): Add
	static assertions to the primary template to reject array and
	function types.
	* testsuite/30_threads/future/requirements/lwg3458.cc: New test.
	* testsuite/30_threads/promise/requirements/lwg3466.cc: New test.
	* testsuite/30_threads/shared_future/requirements/lwg3458.cc: New test.
2020-07-22 20:11:00 +01:00
Tobias Burnus
e55ba804d3 OpenMP: Support 'if (simd:/cancel:' in Fortran
gcc/fortran/ChangeLog:

	* gfortran.h (enum gfc_omp_if_kind): Add OMP_IF_CANCEL and OMP_IF_SIMD.
	* openmp.c (OMP_SIMD_CLAUSES): Add OMP_CLAUSE_IF.
	(gfc_match_omp_clauses, resolve_omp_clauses): Handle 'if (simd/cancel:'.
	* dump-parse-tree.c (show_omp_clauses): Likewise.
	* trans-openmp.c (gfc_trans_omp_clauses, gfc_trans_omp_cancel,
	(gfc_split_omp_clauses): Likewise.

gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/cancel-2.f90: New test.
	* gfortran.dg/gomp/cancel-3.f90: New test.
	* gfortran.dg/gomp/if-1.f90: New test.
2020-07-22 21:02:01 +02:00
Peter Bergner
ae57566283 rs6000: __builtin_mma_disassemble_acc() doesn't store elements correctly in LE mode
PR96236 shows a problem where we don't correctly store our 512-bit accumulators
correctly in little-endian mode.  The patch below detects when we're doing a
little-endian memory access and stores to the correct memory locations.

2020-07-22  Peter Bergner  <bergner@linux.ibm.com>

gcc/
	PR target/96236
	* config/rs6000/rs6000-call.c (rs6000_gimple_fold_mma_builtin): Handle
	little-endian memory ordering.

gcc/testsuite/
	PR target/96236
	* gcc.target/powerpc/mma-double-test.c: Update storing results for
	correct little-endian ordering.
	* gcc.target/powerpc/mma-single-test.c: Likewise.
2020-07-22 13:36:28 -05:00
Nathan Sidwell
6e1e0decc9 c++: Don't add enums to class's decl_list
We don't need to add CONST_DECLs to a template decl's decl list.  Also made the
code flow a bit clearer.

	gcc/cp/
	* class.c (maybe_add_class_template_decl_list): Don't add CONST_DECLs.
2020-07-22 08:43:26 -07:00
Nathan Sidwell
7be9b276b4 dump: filenames containing -
I discovered the dump machinery would get confused by filenames containing '-'.
Fixed thusly.

	gcc/
	* dumpfile.c (parse_dump_option): Deal with filenames
	containing '-'
2020-07-22 08:43:26 -07:00
Nathan Sidwell
5324a3e621 c++: structural_comptypes addition
I had to debug structural_comptypes, and its complex if conditions and
tail calling of same_type_p made that hard.  I'd hope we can turn the
eqivalent of return boolean_fn () ? true : false; into a tail call of
the boolean.  We also were not dealing with TYPEOF_TYPE.

	gcc/cp/
	* typeck.c (structural_comptypes): [DECLTYPE_TYPE] break
	apart complex if.
	[UNDERLYING_TYPE]: Use an if.
	[TYPEOF_TYPE]: New.
2020-07-22 08:43:25 -07:00
Nathan Sidwell
0f32c94fc7 c++: More cleanups for modern C++
Here are some more places where we can declare variables at the
assignment point, rather than use C89.  Also, let's name our variables
by what they contain -- the register allocator is perfectly able to
track liveness for us.

	gcc/cp/
	* decl.c (decls_match): Move variables into scopes
	they're needed in.
	(duplicate_decls): Use STRIP_TEMPLATE.
	(build_typename_type): Move var decls to their assignments.
	(begin_function_body): Likewise.
	* decl2.c (get_guard): Likewise.
	(mark_used): Use true for truthiness.
	* error.c (dump_aggr_type): Hold the decl in a var called
	'decl', not 'name'.
2020-07-22 08:43:25 -07:00
Nathan Sidwell
63fa0927e8 c++: Shrink lambda-expr
I noticed the default capture mode and the discriminator both used
ints.  That seems excessive.  This shrinks them to 8 bits and 16 bits
respectively.  I suppose the discriminator could use the remaining 24
bits of an int allocation unit, if we're worried about more that 64K
lambdas per function.  I know, users are strange :)  On a 64 bit system
this saves 64 bits, because we also had 32 bits of padding added.

	gcc/cp/
	* cp-tree.h (struct tree_lambda_expr): Shrink
	default_capture_mode & discriminator.
2020-07-22 08:43:25 -07:00
Nathan Sidwell
18d96339d2 preprocessor: add_path simplifications
I noticed add_path was calling strlen more than once on the same
string.  Let's not do that.

	gcc/
	* incpath.c (add_path): Avoid multiple strlen calls.
2020-07-22 08:43:25 -07:00
Nathan Sidwell
5980c0dcc6 c++: mangling cleanups
I noticed the mangler's handling of templates could be simplified.
We know template_info is non-null, which is sufficiently boolean --
no need for an explicit bool return.  also some of the internals of
template_args_equal had crept into find_substitution.  Let's not do
that.

	gcc/cp/
	* mangle.c (decl_is_template_id): Rename to ...
	(maybe_template_info): ... here.  Return the template info,
	rather than use a pointer.  Adjust all callers.
	(find_substitution): Use template_args_equal, rather than
	local check.
2020-07-22 08:43:24 -07:00
H.J. Lu
748ada0acb Limit pr95237-6.c to x86 targets
Since c-c++-common/pr95237-6.c is x86 specific, limit it to x86 targets.

	PR target/95237
	* c-c++-common/pr95237-6.c: Only run for x86 targets.
2020-07-22 07:38:00 -07:00
Jonathan Wakely
a5a8a4e615 libstdc++: Constrain reverse_iterator and move_iterator conversions [LWG 3435]
libstdc++-v3/ChangeLog:

	* include/bits/stl_iterator.h (reverse_iterator): Constrain
	converting constructor and converting assignment operator.
	Access source iterator's data member directly instead of
	calling base().
	(move_iterator): Likewise.
	* testsuite/24_iterators/move_iterator/dr3435.cc: New test.
	* testsuite/24_iterators/reverse_iterator/dr3435.cc: New test.
2020-07-22 15:10:29 +01:00
Jozef Lawrynowicz
259c3965b1 expmed: Fix possible use of NULL_RTX return value from emit_store_flag
MSP430 does not support have any store-flag instructions, so
emit_store_flag can return NULL_RTX.  Catch the NULL_RTX in
expmed.c:expand_sdiv_pow2.

gcc/ChangeLog:

	* expmed.c (expand_sdiv_pow2): Check return value from emit_store_flag
	is not NULL_RTX before use.
2020-07-22 12:38:56 +01:00
Jozef Lawrynowicz
4821e0aabe expr: Allow scalar_int_mode target mode when converting a constant
is_int_mode does not allow MODE_PARTIAL_INT modes, so convert_modes was
not allowing a constant value to be converted to a MODE_PARTIAL_INT for
use as operand 2 in patterns such as ashlpsi3. The constant had
to be copied into a register before it could be used, but now can be
used directly as an operand without any copying.

gcc/ChangeLog:

	* expr.c (convert_modes): Allow a constant integer to be converted to
	any scalar int mode.
2020-07-22 12:34:46 +01:00
Tobias Burnus
ade6e7204c critical-hint-*.{c,f90}: Move from gcc/testsuite to libgomp/testsuite
libgomp/ChangeLog:

	* testsuite/libgomp.c-c++-common/critical-hint-1.c: New; moved from
	gcc/testsuite/c-c++-common/gomp/.
	* testsuite/libgomp.c-c++-common/critical-hint-2.c: Likewise.
	* testsuite/libgomp.fortran/critical-hint-1.f90: New; moved
	from gcc/testsuite/gfortran.dg/gomp/.
	* testsuite/libgomp.fortran/critical-hint-2.f90: Likewise.

gcc/testsuite/ChangeLog:

	* c-c++-common/gomp/critical-hint-1.c: Moved to libgomp/.
	* c-c++-common/gomp/critical-hint-2.c: Moved to libgomp/.
	* gfortran.dg/gomp/critical-hint-1.f90: Moved to libgomp/.
	* gfortran.dg/gomp/critical-hint-2.f90: Moved to libgomp/.
2020-07-22 12:14:22 +02:00
Przemyslaw Wirkus
cd91a08487 Generation of adjusted ldp/stp for vector types
Introduce simple peephole2 optimization which substitutes a sequence of
four consecutive load or store (LDR, STR) instructions with two load or
store pair (LDP, STP) instructions for 2 element supported vector modes
(V2SI, V2SF, V2DI, and V2DF).
Generated load / store pair instruction offset is adjusted accordingly.

Bootstrapped and tested on aarch64-none-linux-gnu.

Example:
$ cat stp_vec_v2sf.c
typedef float __attribute__((vector_size(8))) vec;

void
store_adjusted(vec *out, vec x, vec y)
{
  out[400] = x;
  out[401] = y;
  out[402] = y;
  out[403] = x;
}

Example compiled with:
$ ./aarch64-none-linux-gnu-gcc -S -O2 stp_vec_v2sf.c -dp

Before the patch:

store_adjusted:
    str     d0, [x0, 3200]    // 9    [c=4 l=4]  *aarch64_simd_movv2si/2
    str     d1, [x0, 3208]    // 11   [c=4 l=4]  *aarch64_simd_movv2si/2
    str     d1, [x0, 3216]    // 13   [c=4 l=4]  *aarch64_simd_movv2si/2
    str     d0, [x0, 3224]    // 15   [c=4 l=4]  *aarch64_simd_movv2si/2
    ret       // 26       [c=0 l=4]  *do_return

After the patch:

store_adjusted:
    add     x1, x0, 3200    // 27   [c=4 l=4]  *adddi3_aarch64/0
    stp     d0, d1, [x1]    // 28   [c=0 l=4]  vec_store_pairv2siv2si
    stp     d1, d0, [x1, 16]        // 29   [c=0 l=4]  vec_store_pairv2siv2si
    ret             // 22   [c=0 l=4]  *do_return

gcc/ChangeLog:

	* config/aarch64/aarch64-ldpstp.md: Add two peepholes for adjusted vector
	V2SI, V2SF, V2DI, V2DF load pair and store pair modes.
	* config/aarch64/aarch64-protos.h (aarch64_gen_adjusted_ldpstp):
	Change mode parameter to machine_mode.
	(aarch64_operands_adjust_ok_for_ldpstp): Change mode parameter to
	machine_mode.
	* config/aarch64/aarch64.c (aarch64_operands_adjust_ok_for_ldpstp):
	Change mode parameter to machine_mode.
	(aarch64_gen_adjusted_ldpstp): Change mode parameter to machine_mode.
	* config/aarch64/iterators.md (VP_2E): New iterator for 2 element vectors.

gcc/testsuite/ChangeLog:

	* gcc.target/aarch64/ldp_vec_v2sf.c: New test.
	* gcc.target/aarch64/ldp_vec_v2si.c: New test.
	* gcc.target/aarch64/stp_vec_v2df.c: New test.
	* gcc.target/aarch64/stp_vec_v2di.c: New test.
	* gcc.target/aarch64/stp_vec_v2sf.c: New test.
	* gcc.target/aarch64/stp_vec_v2si.c: New test.
2020-07-22 10:22:11 +01:00
Wei Wentao
e93676fb53 doc: fix a typo in languages.texi
gcc/
	* doc/languages.texi: Fix “then”/“than” typo.
2020-07-22 10:16:34 +01:00
Przemyslaw Wirkus
c58dde8890 MAINTAINERS: Add myself for write after approval
2020-07-22  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	* MAINTAINERS (Write After Approval): Add myself.
2020-07-22 10:13:00 +01:00
Tobias Burnus
c7c24828cf OpenMP: Fixes for omp critical + hint
gcc/c-family/ChangeLog:

	* c-omp.c (c_finish_omp_critical): Check for no name but
	nonzero hint provided.

gcc/c/ChangeLog:

	* c-parser.c (c_parser_omp_clause_hint): Require nonnegative hint clause.
	(c_parser_omp_critical): Permit hint(0) clause without named critical.
	(c_parser_omp_construct): Don't assert if error_mark_node is returned.

gcc/cp/ChangeLog:

	* parser.c (cp_parser_omp_clause_hint): Require nonnegative hint.
	(cp_parser_omp_critical): Permit hint(0) clause without named critical.
	* pt.c (tsubst_expr): Re-check the latter for templates.

gcc/fortran/ChangeLog:

	* openmp.c (gfc_match_omp_critical): Fix handling hints; permit
	hint clause without named critical.
	(resolve_omp_clauses): Require nonnegative constant integer
	for the hint clause.
	(gfc_resolve_omp_directive): Check for no name but
	nonzero value for hint clause.
	* parse.c (parse_omp_structured_block): Fix same-name check
	for critical.
	* trans-openmp.c (gfc_trans_omp_critical): Handle hint clause properly.

libgomp/ChangeLog:

	* omp_lib.f90.in: Add omp_sync_hint_* and omp_sync_hint_kind.
	* omp_lib.h.in: Likewise.

gcc/testsuite/ChangeLog:

	* g++.dg/gomp/critical-3.C: Add nameless critical with hint testcase.
	* c-c++-common/gomp/critical-hint-1.c: New test.
	* c-c++-common/gomp/critical-hint-2.c: New test.
	* gfortran.dg/gomp/critical-hint-1.f90: New test.
	* gfortran.dg/gomp/critical-hint-2.f90: New test.
2020-07-22 09:57:15 +02:00
Hans-Peter Nilsson
fb1de6a854 gcc.dg/no_profile_instrument_function-attr-1.c: Adjust for NO_DOT_IN_LABEL
mmix-knuth-mmixware is a NO_DOT_IN_LABEL target, so it gets a "_"
instead of the "." in the identifier of interest.  Also tested and
compared to the output for cris-elf which is "regular" regarding
labels: there are no "false positive" identifiers there.  The "." in a
TCL bracket expression matches only a literal ".".

Committed as obvious.

gcc/testsuite:
	* gcc.dg/no_profile_instrument_function-attr-1.c: Adjust scanned
	regex for NO_DOT_IN_LABEL.
2020-07-22 03:46:46 +02:00
GCC Administrator
3043006104 Daily bump. 2020-07-22 00:16:27 +00:00
Sunil K Pandey
0a9d711df3 Add TARGET_LOWER_LOCAL_DECL_ALIGNMENT [PR95237]
Default for this hook is NOP. For x86, in 32 bit mode, this hook
sets alignment of long long on stack to 32 bits if preferred stack
boundary is 32 bits.

  - This patch prevents lowering of alignment from following macros.
	LOCAL_ALIGNMENT
	STACK_SLOT_ALIGNMENT
	LOCAL_DECL_ALIGNMENT
  - This patch fixes
	gcc.target/i386/pr69454-2.c
	gcc.target/i386/stackalign/longlong-1.c
  - Regression test on x86-64, no new fail introduced.

Tested on x86-64.

gcc/c/ChangeLog:

	PR target/95237
	* c-decl.c (finish_decl): Call target hook
	lower_local_decl_alignment to lower local decl alignment.

gcc/ChangeLog:

	PR target/95237
	* config/i386/i386-protos.h (ix86_local_alignment): Add
	another function parameter may_lower alignment. Default is
	false.
	* config/i386/i386.c (ix86_lower_local_decl_alignment): New
	function.
	(ix86_local_alignment): Amend ix86_local_alignment to accept
	another parameter may_lower. If may_lower is true, new align
	may be lower than incoming alignment. If may_lower is false,
	new align will be greater or equal to incoming alignment.
	(TARGET_LOWER_LOCAL_DECL_ALIGNMENT): Define.
	* doc/tm.texi: Regenerate.
	* doc/tm.texi.in (TARGET_LOWER_LOCAL_DECL_ALIGNMENT): New
	hook.
	* target.def (lower_local_decl_alignment): New hook.

gcc/cp/ChangeLog:

	PR target/95237
	* decl.c (cp_finish_decl): Call target hook
	lower_local_decl_alignment to lower local decl alignment.

gcc/testsuite/ChangeLog:

	PR target/95237
	* c-c++-common/pr95237-1.c: New test.
	* c-c++-common/pr95237-2.c: New test.
	* c-c++-common/pr95237-3.c: New test.
	* c-c++-common/pr95237-4.c: New test.
	* c-c++-common/pr95237-5.c: New test.
	* c-c++-common/pr95237-6.c: New test.
	* c-c++-common/pr95237-7.c: New test.
	* c-c++-common/pr95237-8.c: New test.
	* c-c++-common/pr95237-9.c: New test.
2020-07-21 16:25:43 -07:00
Peter Bergner
699f9c0cc1 rs6000: Update test case count when compiling for power9
2020-07-21  Peter Bergner  <bergner@linux.ibm.com>

gcc/testsuite/
	PR target/92488
	* gcc.target/powerpc/convert-fp-128.c (bl): Update POWER9 count.
2020-07-21 16:20:33 -05:00
Nathan Sidwell
4d6e94960a c++: Fix scan forward over pragma [PR96257]
It turns out that the paren scanning code is used for speculatively searching
to see if we're looking at a compound_literal.  So we shouldn't always purge
pragma tokens.

	gcc/cp/
	* parser.c (cp_lexer_consume_token): Drop PRAGMA_EOL assert.
	(cp_parser_skip_to_closing_parenthesis_1): Only pass start token
	to pragma skipper if recovering.
	(cp_parser_skip_to_pragma_eol): Only purge and change pragma
	state when recovering.
	gcc/testsuite/
	* g++.dg/parse/pr96257.C: New.
2020-07-21 12:42:09 -07:00
Harald Anlauf
28f2a080cc PR fortran/89574 - ICE in conv_function_val, at fortran/trans-expr.c:3792
When checking for an external procedure from the same file, do not
consider symbols from different modules.

gcc/fortran/
	PR fortran/89574
	* trans-decl.c (gfc_get_extern_function_decl): Check whether a
	symbol belongs to a different module.
2020-07-21 21:37:30 +02:00