Compare commits

...
1325 Commits
Author SHA1 Message Date
Joey Ye 13861a8075 Pickup patch rejected in trunk.
2019-09-11  Wilco Dijkstra  <wdijkstr@arm.com>

        PR tree-optimization/80155
        * common/config/arm/arm-common.c (arm_option_optimization_table):
        Enable -fcode-hoisting with -Os.
2020-04-08 20:55:12 +01:00
GCC Administrator 1a2a0af530 Daily bump. 2020-04-08 00:17:30 +00:00
Will Schmidt 9a385bd124 rs6000 pragma fix backport from mainline to gcc-9
2020-04-07  Will Schmidt  <will_schmidt@vnet.ibm.com>

Backport from mainline.
    2020-03-23  Will Schmidt  <will_schmidt@vnet.ibm.com>

    * config/rs6000/rs6000-call.c altivec_init_builtins(): Remove
    code to skip defining builtins based on builtin_mask.

    * gcc.target/powerpc/pragma_power6.c: New.
    * gcc.target/powerpc/pragma_power7.c: New.
    * gcc.target/powerpc/pragma_power8.c: New.
    * gcc.target/powerpc/pragma_power9.c: New.
    * gcc.target/powerpc/pragma_misc9.c: New.
    * gcc.target/powerpc/vsu/pragma_misc9.c: New.
    * gcc.target/powerpc/vsu/vec-all-nez-7.c: Update.
    * gcc.target/powerpc/vsu/vec-any-eqz-7.c: Update.
2020-04-07 16:07:03 -05:00
Jakub Jelinek 14192f1ed4 i386: Fix V{64QI,32HI}mode constant permutations [PR94509]
The following testcases are miscompiled, because expand_vec_perm_pshufb
incorrectly thinks it can use vpshufb instruction for the permutations
when it can't.
The
          if (vmode == V32QImode)
            {
              /* vpshufb only works intra lanes, it is not
                 possible to shuffle bytes in between the lanes.  */
              for (i = 0; i < nelt; ++i)
                if ((d->perm[i] ^ i) & (nelt / 2))
                  return false;
            }
intra-lane check which is correct has been copied and adjusted for 64-byte
modes into:
          if (vmode == V64QImode)
            {
              /* vpshufb only works intra lanes, it is not
                 possible to shuffle bytes in between the lanes.  */
              for (i = 0; i < nelt; ++i)
                if ((d->perm[i] ^ i) & (nelt / 4))
                  return false;
            }
which is not correct, because 64-byte modes have 4 lanes rather than just
two and the above is only testing that the permutation grabs even lane elts
from even lanes and odd lane elts from odd lanes, but not that they are
from the same 256-bit half.

The following patch fixes it by using 3 * nelt / 4 instead of nelt / 4,
so we actually check the most significant 2 bits rather than just one.

2020-04-07  Jakub Jelinek  <jakub@redhat.com>

	PR target/94509
	* config/i386/i386-expand.c (expand_vec_perm_pshufb): Fix the check
	for inter-lane permutation for 64-byte modes.

	* gcc.target/i386/avx512bw-pr94509-1.c: New test.
	* gcc.target/i386/avx512bw-pr94509-2.c: New test.
2020-04-07 21:02:06 +02:00
Jakub Jelinek 0490cb0e61 openmp: Fix parallel master error recovery [PR94512]
We need to set OMP_PARALLEL_COMBINED only if the parsing of omp_master
succeeded, because otherwise there is no nested master construct in the
parallel.

2020-04-07  Jakub Jelinek  <jakub@redhat.com>

	PR c++/94512
	* c-parser.c (c_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
	if c_parser_omp_master succeeded.

	* parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
	if cp_parser_omp_master succeeded.

	* g++.dg/gomp/pr94512.C: New test.
2020-04-07 21:01:46 +02:00
Jakub Jelinek 7f3ac38b3c aarch64: Fix {ash[lr],lshr}<mode>3 expanders [PR94488]
The following testcase ICEs on aarch64 apparently since the introduction of
the aarch64 port.  The reason is that the {ashl,ashr,lshr}<mode>3 expanders
completely unnecessarily FAIL; if operands[2] is something other than
a CONST_INT or REG or MEM and the middle-end code can't cope with the
pattern giving up in these cases.  All the expanders use general_operand
predicate for the shift amount operand, but then have just a special case
for CONST_INT (if in-bound, emit an immediate shift, otherwise force into
REG), or MEM (force into REG), or REG (that is the case it handles).
In the testcase, operands[2] is a lowpart SUBREG of a REG, which is valid
general_operand.
I don't see any reason what is magic about MEMs that it should be forced
into REG and others like SUBREGs that it shouldn't, there isn't even a
reason to check for !REG_P because force_reg will do nothing if the operand
is already a REG, and otherwise can handle general_operand just fine.

2020-04-07  Jakub Jelinek  <jakub@redhat.com>

	PR target/94488
	* config/aarch64/aarch64-simd.md (ashl<mode>3, lshr<mode>3,
	ashr<mode>3): Force operands[2] into reg whenever it is not CONST_INT.
	Assume it is a REG after that instead of testing it and doing FAIL
	otherwise.  Formatting fix.

	* gcc.c-torture/compile/pr94488.c: New test.
2020-04-07 21:01:46 +02:00
Jakub JelinekandHannes Domani b5039b7259 debug: Improve debug info of c++14 deduced return type [PR94459]
On the following testcase, in gdb ptype S<long>::m1 prints long as return
type, but all the other methods show void instead.
PR53756 added code to add_type_attribute if the return type is
auto/decltype(auto), but we actually should look through references,
pointers and qualifiers.
Haven't included there DW_TAG_atomic_type, because I think at least ATM
one can't use that in C++.  Not sure about DW_TAG_array_type or what else
could be deduced.

> http://eel.is/c++draft/dcl.spec.auto#3 says it has to appear as a
> decl-specifier.
>
> http://eel.is/c++draft/temp.deduct.type#8 lists the forms where a template
> argument can be deduced.
>
> Looks like you are missing arrays, pointers to members, and function return
> types.

2020-04-04  Hannes Domani  <ssbssa@yahoo.de>
	    Jakub Jelinek  <jakub@redhat.com>

	PR debug/94459
	* dwarf2out.c (gen_subprogram_die): Look through references, pointers,
	arrays, pointer-to-members, function types and qualifiers when
	checking if in-class DIE had an 'auto' or 'decltype(auto)' return type
	to emit type again on definition.

	* g++.dg/debug/pr94459.C: New test.

Co-Authored-By: Hannes Domani <ssbssa@yahoo.de>
2020-04-07 21:01:40 +02:00
Jakub Jelinek d1371dbe12 openmp: Fix ICE on #pragma omp parallel master in template [PR94477]
The following testcase ICEs, because for parallel combined with some
other construct we initialize the omp_parallel_combined_clauses pointer
and expect the construct combined with it to clear it after it no longer
needs it, but OMP_MASTER didn't do that.

2020-04-04  Jakub Jelinek  <jakub@redhat.com>

	PR c++/94477
	* pt.c (tsubst_expr) <case OMP_MASTER>: Clear
	omp_parallel_combined_clauses.

	* g++.dg/gomp/pr94477.C: New test.
2020-04-07 21:01:13 +02:00
Jakub Jelinek dbff182984 i386: Fix vph{add,subs?}[wd] 256-bit AVX2 RTL patterns [PR94460]
The following testcase is miscompiled, because the AVX2 patterns don't
describe correctly what the insn does.  E.g. vphaddd with %ymm* operands
(the second pattern) instruction as per:
https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_hadd_epi32&expand=2941
does { a0+a1, a2+a3, b0+b1, b2+b3, a4+a5, a6+a7, b4+b5, b6+b7 }
but our RTL pattern did
     { a0+a1, a2+a3, a4+a5, a6+a7, b0+b1, b2+b3, b4+b5, b6+b7 }
where the first and last 64 bits are the same and two middle 64 bits
swapped.
https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_hadd_epi16&expand=2939
similarly, insn does:
     { a0+a1, a2+a3, a4+a5, a6+a7, b0+b1, b2+b3, b4+b5, b6+b7,
       a8+a9, a10+a11, a12+a13, a14+a15, b8+b9, b10+b11, b12+b13, b14+b15 }
but RTL pattern did
     { a0+a1, a2+a3, a4+a5, a6+a7, a8+a9, a10+a11, a12+a13, a14+a15,
       b0+b1, b2+b3, b4+b5, b6+b7, b8+b9, b10+b11, b12+b13, b14+b15 }
again, first and last 64 bits are the same and the two middle 64 bits
swapped.

2020-04-03  Jakub Jelinek  <jakub@redhat.com>

	PR target/94460
	* config/i386/sse.md (avx2_ph<plusminus_mnemonic>wv16hi3,
	avx2_ph<plusminus_mnemonic>dv8si3): Fix up RTL pattern to do
	second half of first lane from first lane of second operand and
	first half of second lane from second lane of first operand.

	* gcc.target/i386/avx2-pr94460.c: New test.
2020-04-07 21:01:13 +02:00
Jakub Jelinek 4486a537f1 objsz: Don't call replace_uses_by on SSA_NAME_OCCURS_IN_ABNORMAL_PHI [PR94423]
The following testcase ICEs because the objsz pass calls replace_uses_by
on SSA_NAME_OCCURS_IN_ABNORMAL_PHI SSA_NAME.  The following patch instead
of that calls replace_call_with_value, which will turn it into
  xyz_123(ab) = 234;

2020-04-01  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/94423
	* tree-object-size.c (pass_object_sizes::execute): Don't call
	replace_uses_by for SSA_NAME_OCCURS_IN_ABNORMAL_PHI lhs, instead
	call replace_call_with_value.

	* gcc.dg/ubsan/pr94423.c: New test.
2020-04-07 21:01:06 +02:00
Jakub JelinekandMarc Glisse 8f99f9e6cc fold-const: Fix division folding with vector operands [PR94412]
The following testcase is miscompiled since 4.9, we treat unsigned
vector types as if they were signed and "optimize" negations across it.

2020-03-31  Marc Glisse  <marc.glisse@inria.fr>
	    Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/94412
	* fold-const.c (fold_binary_loc) <case TRUNC_DIV_EXPR>: Use
	ANY_INTEGRAL_TYPE_P instead of INTEGRAL_TYPE_P.

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

Co-authored-by: Marc Glisse <marc.glisse@inria.fr>
2020-04-07 21:00:35 +02:00
Jakub Jelinek a6bf0e5fb1 c++: Fix handling of internal fn calls in statement expressions [PR94385]
The following testcase ICEs, because the FE when processing the statement
expression changes the .VEC_CONVERT internal fn CALL_EXPR into .PHI call.
That is because the internal fn call is recorded in the base.u.ifn
field, which overlaps base.u.bits.lang_flag_1 which is used for
STMT_IS_FULL_EXPR_P, so this essentially does ifn |= 2 on little-endian.
STMT_IS_FULL_EXPR_P bit is used in:
cp-gimplify.c-  if (STATEMENT_CODE_P (code))
cp-gimplify.c-    {
cp-gimplify.c-      saved_stmts_are_full_exprs_p = stmts_are_full_exprs_p ();
cp-gimplify.c-      current_stmt_tree ()->stmts_are_full_exprs_p
cp-gimplify.c:        = STMT_IS_FULL_EXPR_P (*expr_p);
cp-gimplify.c-    }
and
pt.c-  if (STATEMENT_CODE_P (TREE_CODE (t)))
pt.c:    current_stmt_tree ()->stmts_are_full_exprs_p = STMT_IS_FULL_EXPR_P (t);
so besides being wrong on some other codes, it actually isn't beneficial at
all to set it on anything else, so the following patch restricts it to
trees with STATEMENT_CODE_P TREE_CODE.

2020-03-30  Jakub Jelinek  <jakub@redhat.com>

	PR c++/94385
	* semantics.c (add_stmt): Only set STMT_IS_FULL_EXPR_P on trees with
	STATEMENT_CODE_P code.

	* c-c++-common/pr94385.c: New test.
2020-04-07 21:00:35 +02:00
Jakub Jelinek 57e276f3e3 Fix vextract* masked patterns [PR93069]
The AVX512F documentation clearly states that in instructions where the
destination is a memory only merging-masking is possible, not zero-masking,
and the assembler enforces that.

The testcase in this patch fails to assemble because of
Error: unsupported masking for `vextracti32x8'
on
        vextracti32x8   $0x0, %zmm1, -64(%rsp){%k1}{z}
For the vector extraction patterns, we apparently have 7 *_maskm patterns
that only accept memory destinations and rtx_equal_p merge-masking source
for it, 7 *<mask_name> corresponding patterns that allow memory destination
only for the non-masked cases (through <store_mask_constraint>), then 2
*<mask_name> patterns (lo ssehalf V16FI and lo ssehalf VI8F_256 ones) which
do allow memory destination even for masked cases and are the cause of the
testsuite failure, because we must not allow C constraint if the destination
is m, and finally one pair of patterns (separate * and *_mask, hi ssehalf
VI4F_256), which has another issue (for which I don't have a testcase
though), where if it would match zero-masking with register destination,
it wouldn't emit the needed {z} into assembly.
The attached patch fixes those 3 issues only, perhaps more suitable for
backporting.

2020-03-30  Jakub Jelinek  <jakub@redhat.com>

	PR target/93069
	* config/i386/sse.md (vec_extract_lo_<mode><mask_name>): Use
	<store_mask_constraint> instead of m in output operand constraint.
	(vec_extract_hi_<mode><mask_name>): Use <mask_operand2> instead of
	%{%3%}.

	* gcc.target/i386/avx512vl-pr93069.c: New test.
	* gcc.dg/vect/pr93069.c: New test.
2020-04-07 21:00:28 +02:00
Jakub Jelinek aa9c08ef97 reassoc: Fix -fcompare-debug bug in reassociate_bb [PR94329]
The following testcase FAILs with -fcompare-debug, because reassociate_bb
mishandles the case when the last stmt in a bb has zero uses.  In that case
reassoc_remove_stmt (like gsi_remove) moves the iterator to the next stmt,
i.e. gsi_end_p is true, which means the code sets the iterator back to
gsi_last_bb.  The problem is that the for loop does gsi_prev on that before
handling the next statement, which means the former penultimate stmt, now
last one, is not processed by reassociate_bb.
Now, with -g, if there is at least one debug stmt at the end of the bb,
reassoc_remove_stmt moves the iterator to that following debug stmt and we
just do gsi_prev and continue with the former penultimate non-debug stmt,
now last non-debug stmt.

The following patch fixes that by not doing the gsi_prev in this case; there
are too many continue; cases, so I didn't want to copy over the gsi_prev to
all of them, so this patch uses a bool for that instead.  The second
gsi_end_p check isn't needed anymore, because when we don't do the
undesirable gsi_prev after gsi = gsi_last_bb, the loop !gsi_end_p (gsi)
condition will catch the removal of the very last stmt from a bb.

2020-03-28  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/94329
	* tree-ssa-reassoc.c (reassociate_bb): When calling reassoc_remove_stmt
	on the last stmt in a bb, make sure gsi_prev isn't done immediately
	after gsi_last_bb.

	* gfortran.dg/pr94329.f90: New test.
2020-04-07 20:59:45 +02:00
Jakub Jelinek 56407bab53 varasm: Fix output_constructor where a RANGE_EXPR index needs to skip some elts [PR94303]
The following testcase is miscompiled, because output_constructor doesn't
output the initializer correctly.  The FE creates {[1...2] = 9} in this
case, and we emit .long 9; long 9; .zero 8 instead of the expected
.zero 8; .long 9; .long 9.  If the CONSTRUCTOR is {[1] = 9, [2] = 9},
output_constructor_regular_field has code to notice that the current
location (local->total_bytes) is smaller than the location we want to write
to (1*sizeof(elt)) and will call assemble_zeros to skip those.  But
RANGE_EXPRs are handled by a different function which didn't do this,
so for RANGE_EXPRs we emitted them properly only if local->total_bytes
was always equal to the location where the RANGE_EXPR needs to start.

2020-03-25  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/94303
	* varasm.c (output_constructor_array_range): If local->index
	RANGE_EXPR doesn't start at the current location in the constructor,
	skip needed number of bytes using assemble_zeros or assert we don't
	go backwards.

	PR middle-end/94303
	* g++.dg/torture/pr94303.C: New test.
2020-04-07 20:59:37 +02:00
Jakub JelinekandRichard Biener 8ea7970c49 if-conv: Delete dead stmts backwards in ifcvt_local_dce [PR94283]
> > This patch caused:
> >
> > gcc /home/marxin/Programming/gcc/gcc/testsuite/gcc.c-torture/compile/990625-2.c -O3 -g -fno-tree-dce -c
> > during GIMPLE pass: ifcvt
> > /home/marxin/Programming/gcc/gcc/testsuite/gcc.c-torture/compile/990625-2.c: In function ‘broken030599’:
> > /home/marxin/Programming/gcc/gcc/testsuite/gcc.c-torture/compile/990625-2.c:2:1: internal compiler error: Segmentation fault
>
> Likely
>
>   /* Delete dead statements.  */
>   gsi = gsi_start_bb (bb);
>   while (!gsi_end_p (gsi))
>     {
>
> needs to instead work back-to-front for debug stmt adjustment to work

Indeed, that seems to work.

2020-03-25  Richard Biener  <rguenther@suse.de>
	    Jakub Jelinek  <jakub@redhat.com>

	PR debug/94283
	* tree-if-conv.c (ifcvt_local_dce): Delete dead statements backwards.

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

Co-authored-by: Richard Biener <rguenther@suse.de>
2020-04-07 20:57:48 +02:00
Jakub Jelinek 4dcfd4e56b if-conv: Fix -fcompare-debug bugs in ifcvt_local_dce [PR94283]
The following testcase shows -fcompare-debug bugs in ifcvt_local_dce,
where the decisions what statements are needed is based also on debug stmt
operands, which is wrong.
So, this patch makes sure to never add debug stmt to the worklist, or never
add an assign to worklist just because it is used in a debug stmt in another
bb.

2020-03-24  Jakub Jelinek  <jakub@redhat.com>

	PR debug/94283
	* tree-if-conv.c (ifcvt_local_dce): For gimple debug stmts, just set
	GF_PLF_2, but don't add them to worklist.  Don't add an assigment to
	worklist or set GF_PLF_2 just because it is used in a debug stmt in
	another bb.  Formatting improvements.

	* gcc.target/i386/pr94283.c: New test.
2020-04-07 20:57:37 +02:00
Jakub Jelinek 4ac9ab60f0 cgraphunit: Avoid code generation differences based on -w/TREE_NO_WARNING [PR94277]
The following testcase FAILs with -fcompare-debug, but not because -g vs.
-g0 would make a difference, but because the second compilation is done with
-w in order not to emit warnings twice and -w seems to affect the *.gkd dump
content.
This is because TREE_NO_WARNING flag, or warn_unused_function does affect
not just whether a warning/pedwarn is printed, but also whether we set
TREE_PUBLIC on such decls.
The following patch makes sure we set it regardless of anything warning
related (TREE_NO_WARNING or warn_unused_function).

2020-03-24  Jakub Jelinek  <jakub@redhat.com>

	PR debug/94277
	* cgraphunit.c (check_global_declaration): For DECL_EXTERNAL and
	non-TREE_PUBLIC non-DECL_ARTIFICIAL FUNCTION_DECLs, set TREE_PUBLIC
	regardless of whether TREE_NO_WARNING is set on it or whether
	warn_unused_function is true or not.

	* gcc.dg/pr94277.c: New test.
2020-04-07 20:55:11 +02:00
Jakub Jelinek f83c2d2991 c: Fix up cfun->function_end_locus on invalid function bodies [PR94239]
Unfortunately the patch broke
+FAIL: gcc.dg/pr20245-1.c (internal compiler error)
+FAIL: gcc.dg/pr20245-1.c (test for excess errors)
+FAIL: gcc.dg/pr28419.c (internal compiler error)
+FAIL: gcc.dg/pr28419.c (test for excess errors)
on some targets (and under valgrind on the rest of them).

Those functions don't have the opening { and so c_parser_compound_statement
returned error_mark_node before initializing *endlocp.
So, either we can initialize it in that case too:
--- gcc/c/c-parser.c    2020-03-20 22:09:39.659411721 +0100
+++ gcc/c/c-parser.c    2020-03-21 09:36:44.455705261 +0100
@@ -5611,6 +5611,8 @@ c_parser_compound_statement (c_parser *p
         if we have just prepared to enter a function body.  */
       stmt = c_begin_compound_stmt (true);
       c_end_compound_stmt (brace_loc, stmt, true);
+      if (endlocp)
+       *endlocp = brace_loc;
       return error_mark_node;
     }
   stmt = c_begin_compound_stmt (true);
or perhaps simpler initialize it to the function_start_locus at the
beginning and have those functions without { have function_start_locus ==
function_end_locus like the __GIMPLE functions (where propagating the
closing } seemed too difficult).

2020-03-23  Jakub Jelinek  <jakub@redhat.com>

	PR gcov-profile/94029
	PR c/94239
	* c-parser.c (c_parser_declaration_or_fndef): Initialize endloc to
	the function_start_locus location.  Don't do that afterwards for the
	__GIMPLE body parsing.
2020-04-07 20:55:11 +02:00
Jakub Jelinek 827e5af19a c: Fix up cfun->function_end_locus from the C FE [PR94029]
On the following testcase we ICE because while
      DECL_STRUCT_FUNCTION (current_function_decl)->function_start_locus
        = c_parser_peek_token (parser)->location;
and similarly DECL_SOURCE_LOCATION (fndecl) is set from some token's
location, the end is set as:
  /* Store the end of the function, so that we get good line number
     info for the epilogue.  */
  cfun->function_end_locus = input_location;
and the thing is that input_location is only very rarely set in the C FE
(the primary spot that changes it is the cb_line_change/fe_file_change).
Which means, e.g. for pretty much all C functions that are on a single line,
function_start_locus column is > than function_end_locus column, and the
testcase even has smaller line in function_end_locus because cb_line_change
isn't performed while parsing multi-line arguments of a function-like macro.

Attached are two possible fixes to achieve what the C++ FE does, in
particular that cfun->function_end_locus is the locus of the closing } of
the function.  The first one updates input_location when we see a closing }
of a compound statement (though any, not just the function body) and thus
input_location in the finish_function call is what we need.
The second instead propagates the location_t from the parsing of the
outermost compound statement (the function body) to finish_function.
The second one is this version.

2020-03-19  Jakub Jelinek  <jakub@redhat.com>

	PR gcov-profile/94029
	* c-tree.h (finish_function): Add location_t argument defaulted to
	input_location.
	* c-parser.c (c_parser_compound_statement): Add endlocp argument and
	set it to the locus of closing } if non-NULL.
	(c_parser_compound_statement_nostart): Return locus of closing }.
	(c_parser_parse_rtl_body): Likewise.
	(c_parser_declaration_or_fndef): Propagate locus of closing } to
	finish_function.
	* c-decl.c (finish_function): Add end_loc argument, use it instead of
	input_location to set function_end_locus.

	* gcc.misc-tests/gcov-pr94029.c: New test.
2020-04-07 20:55:10 +02:00
Jakub Jelinek 484206967f c++: Fix up handling of captured vars in lambdas in OpenMP clauses [PR93931]
Without the parser.c change we were ICEing on the testcase, because while the
uses of the captured vars inside of the constructs were replaced with capture
proxy decls, we didn't do that for decls in OpenMP clauses.

With that fixed, we don't ICE anymore, but the testcase is miscompiled and FAILs
at runtime.  This is because the capture proxy decls have DECL_VALUE_EXPR and
during gimplification we were gimplifying those to their DECL_VALUE_EXPRs.
That is fine for shared vars, but for privatized ones we must not do that.
So that is what the cp-gimplify.c changes do.  Had to add a DECL_CONTEXT check
before calling is_capture_proxy because some VAR_DECLs don't have DECL_CONTEXT
set (yet) and is_capture_proxy relies on that being non-NULL always.

2020-03-19  Jakub Jelinek  <jakub@redhat.com>

	PR c++/93931
	* parser.c (cp_parser_omp_var_list_no_open): Call process_outer_var_ref
	on outer_automatic_var_p decls.
	* cp-gimplify.c (cxx_omp_disregard_value_expr): Return true also for
	capture proxy decls.

	* testsuite/libgomp.c++/pr93931.C: New test.
2020-04-07 20:55:10 +02:00
Jakub Jelinek 8db876e9c0 phiopt: Avoid -fcompare-debug bug in phiopt [PR94211]
Two years ago, I've added support for up to 2 simple preparation statements
in value_replacement, but the
-      && estimate_num_insns (assign, &eni_time_weights)
+      && estimate_num_insns (bb_seq (middle_bb), &eni_time_weights)
change, meant that we compute the cost of all those statements rather than
just the single assign that has been the single supported non-debug
statement in the bb before, doesn't do what I thought would do, gimple_seq
is just gimple * and thus it can't be really overloaded depending on whether
we pass a single gimple * or a whole sequence.  Which means in the last
two years it doesn't count all the statements, but only the first one.
With -g that happens to be a DEBUG_STMT, or it could be e.g. the first
preparation statement which could be much cheaper than the actual assign.

2020-03-19  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/94211
	* tree-ssa-phiopt.c (value_replacement): Use estimate_num_insns_seq
	instead of estimate_num_insns for bb_seq (middle_bb).  Rename
	emtpy_or_with_defined_p variable to empty_or_with_defined_p, adjust
	all uses.

	* gcc.dg/pr94211.c: New test.
2020-04-07 20:55:10 +02:00
Jakub Jelinek 87ce34fa00 c: Handle C_TYPE_INCOMPLETE_VARS even for ENUMERAL_TYPEs [PR94172]
The following testcases ICE, because they contain extern variable
declarations with incomplete enum types that is later completed and after
that those variables are accessed.  The ICEs are because the vars then may have
incorrect DECL_MODE etc., e.g. in the first case the var has SImode
DECL_MODE (the guessed mode for the enum), but the enum then actually has
DImode because its enumerators don't fit into unsigned int.

The following patch fixes it by using C_TYPE_INCOMPLETE_VARS not just on
incomplete struct/union types, but also incomplete enum types.
TYPE_VFIELD can't be used as it is TYPE_MIN_VALUE on ENUMERAL_TYPE,
thankfully TYPE_LANG_SLOT_1 has been used in the C FE only on
FUNCTION_TYPEs.

2020-03-17  Jakub Jelinek  <jakub@redhat.com>

	PR c/94172
	* c-tree.h (C_TYPE_INCOMPLETE_VARS): Define to TYPE_LANG_SLOT_1
	instead of TYPE_VFIELD, and support it on {RECORD,UNION,ENUMERAL}_TYPE.
	(TYPE_ACTUAL_ARG_TYPES): Check that it is only used on FUNCTION_TYPEs.
	* c-decl.c (pushdecl): Push C_TYPE_INCOMPLETE_VARS also to
	ENUMERAL_TYPEs.
	(finish_incomplete_vars): New function, moved from finish_struct.  Use
	relayout_decl instead of layout_decl.
	(finish_struct): Remove obsolete comment about C_TYPE_INCOMPLETE_VARS
	being TYPE_VFIELD.  Use finish_incomplete_vars.
	(finish_enum): Clear C_TYPE_INCOMPLETE_VARS.  Call
	finish_incomplete_vars.
	* c-typeck.c (c_build_qualified_type): Clear C_TYPE_INCOMPLETE_VARS
	also on ENUMERAL_TYPEs.

	* gcc.dg/pr94172-1.c: New test.
	* gcc.dg/pr94172-2.c: New test.
2020-04-07 20:55:09 +02:00
Jakub Jelinek 980a7a0be5 c++: Fix parsing of invalid enum specifiers [PR90995]
The testcase shows some accepts-invalid (the ones without alignas) and
ice-on-invalid-code (the ones with alignas) cases.
If the enum doesn't have an underlying type and is not a definition,
the caller retries to parse it as elaborated type specifier.
E.g. for enum struct S s it will then pedwarn that elaborated type specifier
shouldn't have the struct/class keywords.
The problem is if the enum specifier is not followed by { when it has
underlying type.  In that case we have already called
cp_parser_parse_definitely to end the tentative parsing started at the
beginning of cp_parser_enum_specifier.  But the
cp_parser_error (parser, "expected %<;%> or %<{%>");
doesn't emit any error because the whole function is called from yet another
tentative parse and the caller starts parsing the elaborated type
specifier where the cp_parser_enum_specifier stopped (i.e. after the
underlying type token(s)).  The ultimate caller than commits the tentative
parsing (and even if it wouldn't, it wouldn't know what kind of error
to report).  I think after seeing enum {,struct,class} : type not being
followed by { or ;, there is no reason not to report it right away, as it
can't be valid C++, which is what the patch does.  Not sure if we shouldn't
also return error_mark_node instead of NULL_TREE, so that the caller doesn't
try to parse it as elaborated type specifier (the patch doesn't do that
right now).

Furthermore, while reading the code, I've noticed that
parser->colon_corrects_to_scope_p is saved and set to false at the start
of the function, but not restored back in some cases.  Don't have a testcase
where this would be a problem, but it just seems wrong.  Either we can in
the two spots replace return NULL_TREE; with { type = NULL_TREE; goto out; }
or we could perhaps abuse warning_sentinel or create a special class with
dtor to clean the flag up.

And lastly, I've fixed some formatting issues in the function while reading
it.

2020-03-17  Jakub Jelinek  <jakub@redhat.com>

	PR c++/90995
	* parser.c (cp_parser_enum_specifier): Use temp_override for
	parser->colon_corrects_to_scope_p, replace goto out with return.
	If scoped enum or enum with underlying type is not followed by
	{ or ;, call cp_parser_commit_to_tentative_parse before calling
	cp_parser_error and make sure to return error_mark_node instead of
	NULL_TREE.  Formatting fixes.

	* g++.dg/cpp0x/enum40.C: New test.
2020-04-07 20:55:09 +02:00
Kyrylo Tkachov 470626394a [AArch64] PR target/94518: Fix memmodel index in aarch64_store_exclusive_pair
2020-04-07  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

        PR target/94518
        2019-09-23  Richard Sandiford  <richard.sandiford@arm.com>

        * config/aarch64/atomics.md (aarch64_store_exclusive_pair): Fix
        memmodel index.
2020-04-07 18:10:45 +01:00
Iain Buclaw e926d076f2 d: Fix ICE in add_symbol_to_partition_1, at lto/lto-partition.c:215
This patch addresses two problems with TypeInfo initializer generation.

1. D array fields pointing to compiler generated data are referencing
public symbols with no unique prefix, which can lead to duplicate
definition errors in some hard to reduce cases.  To avoid name clashes,
all symbols that are generated for TypeInfo initializers now use the
assembler name of the TypeInfo decl as a prefix.

2. An ICE would occur during LTO pass because these same decls are
considered to be part of the same comdat group as the TypeInfo decl that
it's referred by, despite itself being neither marked public nor comdat.
This resulted in decls being added to the LTRANS partition out of order,
triggering an assert when add_symbol_to_partition_1 attempted to add
them again.  To remedy, TREE_PUBLIC and DECL_COMDAT are now set on all
generated symbols.

gcc/d/ChangeLog:

	PR d/94240
	* typeinfo.cc (class TypeInfoVisitor): Replace type_ field with decl_.
	(TypeInfoVisitor::TypeInfoVisitor): Set decl_.
	(TypeInfoVisitor::result): Update.
	(TypeInfoVisitor::internal_reference): New function.
	(TypeInfoVisitor::layout_string): Use internal_reference.
	(TypeInfoVisitor::visit (TypeInfoTupleDeclaration *)): Likewise.
	(layout_typeinfo): Construct TypeInfoVisitor with typeinfo decl.
	(layout_classinfo): Likewise.
2020-04-07 18:02:47 +02:00
Jakub Jelinek 1168240fbe i386: Fix emit_reduc_half on V{64Q,32H}Imode [PR94500]
The following testcase is miscompiled in 8.x, because emit_reduc_half is
prepared to handle for 512-bit modes only i equal to 512, 256, 128 and 64.
V32HImode also needs i equal to 32 and V64QImode i equal to 32 and 16,
but emit_reduc_half in that case performs a redundant permutation exactly
like i == 32.  In 9+ the testcase works because Richard in r9-3393
changed the reduc_* expanders so that they actually don't call
ix86_expand_reduc on 512-bit modes, but only 128-bit ones.

The patch fixes emit_reduc_half to handle also i of 32 and 16 similarly to
how V32QImode/V16HImode are handled for AVX2.  I think it shouldn't hurt
to fix the function even on the trunk and 9 branch even when nothing uses
it ATM.

2020-04-07  Jakub Jelinek  <jakub@redhat.com>

	PR target/94500
	* config/i386/i386.c (emit_reduc_half): For V{64QI,32HI}mode
	handle i < 64 using avx512bw_lshrv4ti3.  Formatting fixes.

	* gcc.target/i386/avx512bw-pr94500.c: New test.
2020-04-07 08:33:10 +02:00
GCC Administrator af1c291f50 Daily bump. 2020-04-07 00:17:30 +00:00
Fritz Reese 83c9ff0291 Fix fortran/93686 -- ICE matching data statements with derived-type pointers.
gcc/fortran/ChangeLog:

2020-04-06  Fritz Reese  <foreese@gcc.gnu.org>

	Backport from master
	Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/93686
	* decl.c (gfc_match_data): Handle data matching for derived type
	pointers.

gcc/testsuite/ChangeLog:

2020-04-06  Fritz Reese  <foreese@gcc.gnu.org>

	Backport from master.
	Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/93686
	* gfortran.dg/pr93686_1.f90: New test.
	* gfortran.dg/pr93686_2.f90: Likewise.
	* gfortran.dg/pr93686_3.f90: Likewise.
	* gfortran.dg/pr93686_4.f90: Likewise.
2020-04-06 16:44:09 -04:00
Marek Polacek 6db837a528 c++: Fix ICE with lambda in operator function [PR93597]
If we are going to use get_first_fn let's make sure we operate on
is_overloaded_fn, as the rest of the codebase does, and if lookup finds
any class-scope declaration, return early too.

	PR c++/93597 - ICE with lambda in operator function.
	* name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.

	* g++.dg/cpp0x/lambda/lambda-93597.C: New test.
2020-04-05 20:35:26 -04:00
GCC Administrator e76564a81f Daily bump. 2020-04-06 00:17:27 +00:00
GCC Administrator 1aa6d76d00 Daily bump. 2020-04-05 00:17:25 +00:00
Jason Merrill ab525ec30f c++: Mangling of dependent conversions [PR91377]
We skip over other conversion codes when mangling expressions, we should do
the same with IMPLICIT_CONV_EXPR.

gcc/cp/ChangeLog
2020-04-04  Jason Merrill  <jason@redhat.com>

	PR c++/91377
	* mangle.c (write_expression): Skip IMPLICIT_CONV_EXPR.
2020-04-04 11:47:11 -04:00
Jason Merrill 5ed8c71b53 c++: Fix reuse of class constants [PR94453]
The testcase hit an ICE trying to expand a TARGET_EXPR temporary cached from
the other lambda-expression.  This patch fixes this in two ways:

1) Avoid reusing a TARGET_EXPR from another function.
2) Avoid ending up with a TARGET_EXPR at all; the use of 'p' had become
<TARGET_EXPR<NON_LVALUE_EXPR<TARGET_EXPR ...>>>, which doesn't make any
sense.

gcc/cp/ChangeLog
2020-04-04  Jason Merrill  <jason@redhat.com>

	PR c++/94453
	* constexpr.c (maybe_constant_value): Use break_out_target_exprs.
	* expr.c (mark_use) [VIEW_CONVERT_EXPR]: Don't wrap a TARGET_EXPR in
	NON_LVALUE_EXPR.
2020-04-04 11:08:59 -04:00
GCC Administrator 46fabc24d3 Daily bump. 2020-04-04 00:17:26 +00:00
Jason Merrill 70ae616922 c++: alias template and parameter packs (PR91966).
In this testcase, when we do a pack expansion of count_better_mins<nums>,
nums appears both in the definition of count_better_mins and as its template
argument.  The intent is that we get a expansion over pairs of elements of
the pack, i.e. less<2,2>, less<2,7>, less<7,2>, ....  But if we substitute
into the definition of count_better_mins when parsing the template, we end
up with sum<less<nums,nums>...>, which never gives us less<2,7>.  We could
deal with this by somehow marking up the use of 'nums' as an argument for
'num', but it's simpler to mark the alias as complex, so we need to
instantiate it later with all its arguments rather than replace it early
with its expansion.

gcc/cp/ChangeLog
2020-04-03  Jason Merrill  <jason@redhat.com>

	PR c++/91966
	* pt.c (complex_pack_expansion_r): New.
	(complex_alias_template_p): Use it.
2020-04-03 15:26:29 -04:00
Martin Jambor a1bb16994c gcc-9 sra: Cap number of sub-access propagations with a param (PR 93435)
This is non-trivial but rather straightforward backport of
29f23ed79b from master.  See
https://gcc.gnu.org/pipermail/gcc-patches/2020-March/542390.html for
more information.

2020-04-02  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/93435
	* params.def (PARAM_SRA_MAX_PROPAGATIONS): New parameter.
	* tree-sra.c (propagation_budget): New variable.
	(budget_for_propagation_access): New function.
	(propagate_subaccesses_across_link): Use it.
	(propagate_all_subaccesses): Set up and destroy propagation_budget.
	* doc/invoke.texi (sra-max-propagations): New.

	testsuite/
	* gcc.dg/tree-ssa/pr93435.c: New test.
2020-04-03 20:32:44 +02:00
Jonathan Wakely b20b7f7e88 libstdc++: Fix std::to_address for debug iterators (PR 93960)
It should be valid to use std::to_address on a past-the-end iterator,
but the debug mode iterators do a check for dereferenceable in their
operator->(). That check is generally useful, so rather than remove it
this changes std::__to_address to identify a debug mode iterator and
use base().operator->() to skip the check.

Backport from mainline
2020-04-03  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/93960
	* include/bits/ptr_traits.h (__to_address): Add special case for debug
	iterators, to avoid dereferenceable check.
	* testsuite/20_util/to_address/1_neg.cc: Adjust dg-error line number.
	* testsuite/20_util/to_address/debug.cc: New test.
2020-04-03 12:00:07 +01:00
Martin Liska 69df6742cb Backport 55a7380213
Backport from mainline
	2020-04-03  Martin Liska  <mliska@suse.cz>

	PR ipa/94445
	* ipa-icf-gimple.c (func_checker::compare_gimple_call):
	  Compare type attributes for gimple_call_fntypes.
2020-04-03 12:33:41 +02:00
GCC Administrator 7fe7c950c3 Daily bump. 2020-04-03 00:17:27 +00:00
Fritz Reese 86f7d3333b Fix fortran/85982 ICE in resolve_component.
2020-04-02  Fritz Reese  <foreese@gcc.gnu.org>

	Backport from master.
	2020-04-02  Fritz Reese  <foreese@gcc.gnu.org>

	PR fortran/85982
	* fortran/decl.c (match_attr_spec): Lump COMP_STRUCTURE/COMP_MAP into
	attribute checking used by TYPE.

2020-04-02  Fritz Reese  <foreese@gcc.gnu.org>

	Backport from master.
	2020-04-02  Fritz Reese  <foreese@gcc.gnu.org>

	PR fortran/85982
	* gfortran.dg/dec_structure_28.f90: New test.
2020-04-02 14:35:42 -04:00
Richard Biener 4b0b6303dd tree-optimization/94103 avoid CSE of loads with padding
VN currently replaces a load of a 16 byte entity 128 bits of precision
(TImode) with the result of a load of a 16 byte entity with 80 bits of
mode precision (XFmode).  That will go downhill since if the padding
bits are not actually filled with memory contents those bits are
missing.

2020-03-12  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/94103
	* tree-ssa-sccvn.c (visit_reference_op_load): Avoid type
	punning when the mode precision is not sufficient.

	* gcc.target/i386/pr94103.c: New testcase.
2020-04-02 13:16:16 +02:00
Richard Biener 4b1087f8dc middle-end/94206 fix memset folding to avoid types with padding
This makes sure that the store a memset is folded to uses a type
covering all bits.

2020-03-18   Richard Biener  <rguenther@suse.de>

	PR middle-end/94206
	* gimple-fold.c (gimple_fold_builtin_memset): Avoid using
	partial int modes or not mode-precision integer types for
	the store.

	* gcc.dg/torture/pr94206.c: New testcase.
2020-04-02 13:14:39 +02:00
Jakub Jelinek be64fc4cab aarch64: Fix ICE due to aarch64_gen_compare_reg_maybe_ze [PR94435]
The following testcase ICEs, because aarch64_gen_compare_reg_maybe_ze emits
invalid RTL.
For y_mode [QH]Imode it expects y to be of that mode (or CONST_INT that fits
into that mode) and x being SImode; for non-CONST_INT y it zero extends y
into SImode and compares that against x, for CONST_INT y it zero extends y
into SImode.  The problem is that when the zero extended constant isn't
usable directly, it forces it into a REG, but with y_mode mode, and then
compares against y.  That is wrong, because it should force it into a SImode
REG and compare that way.

2020-04-02  Jakub Jelinek  <jakub@redhat.com>

	PR target/94435
	* config/aarch64/aarch64.c (aarch64_gen_compare_reg_maybe_ze): For
	y_mode E_[QH]Imode and y being a CONST_INT, change y_mode to SImode.

	* gcc.target/aarch64/pr94435.c: New test.
2020-04-02 12:59:11 +02:00
Mark Eggleston b6e5469125 fortran : ICE in gfc_resolve_findloc PR93498
ICE occurs when findloc is used with character arguments of different
kinds.  If the character kinds are different reject the code.

Original patch provided by Steven G. Kargl  <kargl@gcc.gnu.org>.

gcc/fortran/ChangeLog:

	Backport from master
	Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/93498
	* check.c (gfc_check_findloc):  If the kinds of the arguments
	differ goto label "incompat".

gcc/testsuite/ChangeLog:

	Backport from master
	2020-04-02  Mark Eggleston <markeggleston@gcc.gnu.org>

	PR fortran/93498
	* gfortran.dg/pr93498_1.f90:  New test.
	* gfortran.dg/pr93498_2.f90:  New test.
2020-04-02 08:42:41 +01:00
Mark Eggleston 514bd32c52 fortran: ICE equivalence with an element of an array PR94030
Deferred size arrays can not be used in equivalance statements.

gcc/fortran/ChangeLog:

	Backport from master
	2020-04-02  Mark Eggleston <markeggleston@gcc.gnu.org>

	PR fortran/94030
	* resolve.c (resolve_equivalence): Correct formatting
	around the label "identical_types".  Instead of using
	gfc_resolve_array_spec use is_non_constants_shape_array
	to determine whether the array can be used in a in an
	equivalence statement.

gcc/testsuite/ChangeLog:

	Backport from master
	2020-04-02  Mark Eggleston <markeggleston@gcc.gnu.org>

	PR fortran/94030
	* gfortran.dg/pr94030_1.f90
	* gfortran.dg/pr94030_2.f90
2020-04-02 08:26:34 +01:00
GCC Administrator 0c509c6b5a Daily bump. 2020-04-02 00:17:24 +00:00
Zackery Spytz f0897a4521 doc: Fix a typo in the documentation of the copy attribute
2020-04-01  Zackery Spytz  <zspytz@gmail.com>

gcc/
	* doc/extend.texi: Fix a typo in the documentation of the
	copy function attribute.
2020-04-01 18:10:07 +01:00
Kyrylo Tkachov 13f6d5ac48 aarch64: Fix up aarch64_compare_and_swaphi pattern [PR94368]
2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	Backport from mainline
	2020-03-31  Jakub Jelinek  <jakub@redhat.com>

	PR target/94368
	* config/aarch64/constraints.md (Uph): New constraint.
	* config/aarch64/atomics.md (cas_short_expected_imm): New mode attr.
	(@aarch64_compare_and_swap<mode>): Use it instead of n in operand 2's
	constraint.

	* gcc.dg/pr94368.c: New test.
2020-04-01 13:53:05 +01:00
Kyrylo Tkachov c15ff4d080 aarch64: Configure for sys/auxv.h in libgcc for lse-init.c
2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	Backport from mainline
	2019-09-25  Richard Henderson  <richard.henderson@linaro.org>

	PR target/91833
	* config/aarch64/lse-init.c: Include auto-target.h.  Disable
	initialization if !HAVE_SYS_AUXV_H.
	* configure.ac (AC_CHECK_HEADERS): Add sys/auxv.h.
	* config.in, configure: Rebuild.
2020-04-01 12:13:39 +01:00
Kyrylo Tkachov bb9156ede0 aarch64: Fix store-exclusive in load-operate LSE helpers
2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	Backport from mainline
	2019-09-25  Richard Henderson  <richard.henderson@linaro.org>

	PR target/91834
	* config/aarch64/lse.S (LDNM): Ensure STXR output does not
	overlap the inputs.
2020-04-01 12:11:58 +01:00
Kyrylo Tkachov ea376dd471 [AArch64] Fix shrinkwrapping interactions with atomics (PR92692)
2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	Backport from mainline
	2020-01-17  Wilco Dijkstra  <wdijkstr@arm.com>

	PR target/92692
	* config/aarch64/atomics.md (aarch64_compare_and_swap<mode>)
	Use epilogue_completed rather than reload_completed.
2020-04-01 12:09:09 +01:00
Kyrylo Tkachov 9cf2784a69 aarch64: Implement -moutline-atomics
2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	Backport from mainline
	2019-09-19  Richard Henderson  <richard.henderson@linaro.org>

	* config/aarch64/aarch64.opt (-moutline-atomics): New.
	* config/aarch64/aarch64.c (aarch64_atomic_ool_func): New.
	(aarch64_ool_cas_names, aarch64_ool_swp_names): New.
	(aarch64_ool_ldadd_names, aarch64_ool_ldset_names): New.
	(aarch64_ool_ldclr_names, aarch64_ool_ldeor_names): New.
	(aarch64_expand_compare_and_swap): Honor TARGET_OUTLINE_ATOMICS.
	* config/aarch64/atomics.md (atomic_exchange<ALLI>): Likewise.
	(atomic_<atomic_op><ALLI>): Likewise.
	(atomic_fetch_<atomic_op><ALLI>): Likewise.
	(atomic_<atomic_op>_fetch<ALLI>): Likewise.
	* doc/invoke.texi: Document -moutline-atomics.

	* gcc.target/aarch64/atomic-op-acq_rel.c: Use -mno-outline-atomics.
	* gcc.target/aarch64/atomic-comp-swap-release-acquire.c: Likewise.
	* gcc.target/aarch64/atomic-op-acquire.c: Likewise.
	* gcc.target/aarch64/atomic-op-char.c: Likewise.
	* gcc.target/aarch64/atomic-op-consume.c: Likewise.
	* gcc.target/aarch64/atomic-op-imm.c: Likewise.
	* gcc.target/aarch64/atomic-op-int.c: Likewise.
	* gcc.target/aarch64/atomic-op-long.c: Likewise.
	* gcc.target/aarch64/atomic-op-relaxed.c: Likewise.
	* gcc.target/aarch64/atomic-op-release.c: Likewise.
	* gcc.target/aarch64/atomic-op-seq_cst.c: Likewise.
	* gcc.target/aarch64/atomic-op-short.c: Likewise.
	* gcc.target/aarch64/atomic_cmp_exchange_zero_reg_1.c: Likewise.
	* gcc.target/aarch64/atomic_cmp_exchange_zero_strong_1.c: Likewise.
	* gcc.target/aarch64/sync-comp-swap.c: Likewise.
	* gcc.target/aarch64/sync-op-acquire.c: Likewise.
	* gcc.target/aarch64/sync-op-full.c: Likewise.
2020-04-01 12:00:14 +01:00
Kyrylo Tkachov b36f6a808e aarch64: Add out-of-line functions for LSE atomics
This is the libgcc part of the interface -- providing the functions.
Rationale is provided at the top of libgcc/config/aarch64/lse.S.

2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	Backport from mainline
	2019-09-19  Richard Henderson  <richard.henderson@linaro.org>

	* config/aarch64/lse-init.c: New file.
	* config/aarch64/lse.S: New file.
	* config/aarch64/t-lse: New file.
	* config.host: Add t-lse to all aarch64 tuples.
2020-04-01 11:56:24 +01:00
Kyrylo Tkachov 43e46197c1 aarch64: Tidy aarch64_split_compare_and_swap
2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	Backport from mainline
	2019-09-19  Richard Henderson  <richard.henderson@linaro.org>

	* config/aarch64/aarch64 (aarch64_split_compare_and_swap): Disable
	strong_zero_p for aarch64_track_speculation; unify some code paths;
	use aarch64_gen_compare_reg instead of open-coding.
2020-04-01 11:54:14 +01:00
Kyrylo Tkachov 53c1356515 aarch64: Implement TImode compare-and-swap
2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	Backport from mainline
	2019-09-19  Richard Henderson  <richard.henderson@linaro.org>

	* config/aarch64/aarch64.c (aarch64_gen_compare_reg): Add support
	for NE comparison of TImode values.
	(aarch64_emit_load_exclusive): Add support for TImode.
	(aarch64_emit_store_exclusive): Likewise.
	(aarch64_split_compare_and_swap): Disable strong_zero_p for TImode.
	* config/aarch64/atomics.md (@atomic_compare_and_swap<ALLI_TI>):
	Change iterator from ALLI to ALLI_TI.
	(@atomic_compare_and_swap<JUST_TI>): New.
	(@atomic_compare_and_swap<JUST_TI>_lse): New.
	(aarch64_load_exclusive_pair): New.
	(aarch64_store_exclusive_pair): New.
	* config/aarch64/iterators.md (JUST_TI): New.
2020-04-01 11:48:52 +01:00
Kyrylo Tkachov ea7ffe1da0 aarch64: Extend %R for integer registers
2020-04-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

        Backport from mainline
        2019-09-19  Richard Henderson  <richard.henderson@linaro.org>

        * config/aarch64/aarch64.c (aarch64_print_operand): Allow integer
        registers with %R.
2020-04-01 11:43:00 +01:00
GCC Administrator 2594e9a069 Daily bump. 2020-04-01 00:17:49 +00:00
Jason Merrill 0e66150084 c++: Fix comparison of fn() and ns::fn() [PR90711]
The resolution of CWG issue 1321 clarified that when deciding whether two
expressions involving template parameters are equivalent, two dependent
function calls where the function is named with an unqualified-id are
considered to be equivalent if the name is the same, even if unqualified
lookup finds different sets of functions.  We were wrongly treating
qualified-ids the same way, so that EXISTS and test::EXISTS were considered
to be equivalent even though they are looking up the name in different
scopes.  This also causes a mangling bug, but I don't think it's safe to fix
that for GCC 10; this patch just fixes the comparison.

gcc/cp/ChangeLog
2020-03-30  Jason Merrill  <jason@redhat.com>

	PR c++/90711
	* tree.c (cp_tree_equal) [CALL_EXPR]: Compare KOENIG_LOOKUP_P.
	(called_fns_equal): Check DECL_CONTEXT.
2020-03-31 13:04:40 -04:00
Carl Love 02a201f715 rs6000: vec_rlnm fix to make builtin work according to ABI
Backport from mainline:
	  commit e97929e20b
	  Author: Carl Love <carll@us.ibm.com>
	  Date:   Wed Mar 25 18:33:37 2020 -0500

	gcc/ChangeLog

	PR target/93819
            * gcc/config/rs6000/altivec.h:
            Fixed swapped arguments for vec_rlnm define.
2020-03-31 11:45:29 -05:00
Carl Love 8ab40918a3 rs6000: Add command line and builtin compatibility check
2020-03-31  Carl Love  <cel@us.ibm.com>

	backport of mainline commit

	commit 68dd57808f
	Author: Carl Love <carll@us.ibm.com>
	Date:   Fri Mar 20 18:15:05 2020 -0500

	whith change log typo fixed.

	PR target/87583
	* gcc/config/rs6000/rs6000.c (rs6000_option_override_internal):
	Add check for TARGET_FPRND for Power 7 or newer.
2020-03-31 11:39:46 -05:00
GCC Administrator bebb360779 Daily bump. 2020-03-31 00:17:33 +00:00
Tobias Burnus 79166bd28d [Fortran] Fix result-variable handling of MODULE PROCEDURE (PR94348)
Backport from mainline
	2020-03-28  Tobias Burnus  <tobias@codesourcery.com>

	PR fortran/94348
	* decl.c (gfc_match_submod_proc): Add result var to the
	proc's namespace.

	PR fortran/94348
	* gfortran.dg/module_procedure_3.f90: New.
2020-03-30 09:23:12 +02:00
GCC Administrator 9251b78b9e Daily bump. 2020-03-30 00:17:31 +00:00
GCC Administrator 70fe4fc073 Daily bump. 2020-03-29 00:17:27 +00:00
GCC Administrator 26df22e390 Daily bump. 2020-03-28 00:17:31 +00:00
Nathan Sidwell 070a0b6392 c++: Fix ICE popping local scope [pr84733]
PR c++/84733
	* name-lookup.c (do_pushdecl): Look through cleanp levels.
2020-03-27 13:13:39 -07:00
GCC Administrator 1a17c0e113 Daily bump. 2020-03-27 00:17:36 +00:00
GCC Administrator 9b9d9fd072 Daily bump. 2020-03-26 00:17:37 +00:00
Mark Eggleston dff885cdc0 fortran: ICE using undeclared symbol in array constructor PR93484
Using undeclared symbol k in an expression in the following
array constructor results in an ICE:

    print *, [real(x(k))]

If the call to the intrinsic is not in a constructor a no IMPLICIT
type error is reported and the ICE does not occur.

Matching on an expression instead of an initialisation express an
and not converting a MATCH_ERROR return value into MATCH_NO results
in the no IMPLICIT error and no ICE.

Note: Steven G. Kargl  <kargl@gcc.gnu.org> is the author of the
changes except for the test cases.

gcc/fortran/ChangeLog:

	Backport from master
	2020-03-25  Mark Eggleston <markeggleston@gcc.gnu.org>

	PR fortran/93484
	* match.c (gfc_match_type_spec): Replace gfc_match_init_expr with
	gfc_match_expr. Return m if m is MATCH_NO or MATCH_ERROR.

gcc/testsuite

	Backport from master
	2020-03-25  Mark Eggleston <markeggleston@gcc.gnu.org>

	PR fortran/93484
	* gfortran.dg/pr93484_1.f90: New test.
	* gfortran.dg/pr93484_2.f90: New test.
2020-03-25 13:43:23 +00:00
Kewen Lin 768779dd11 [testsuite] Fix PR93935 to guard case under vect_hw_misalign
This patch is to apply the same fix as r267528 to another similar case
bb-slp-over-widen-2.c which requires misaligned vector access.

gcc/testsuite/ChangeLog

2020-03-25  Kewen Lin  <linkw@gcc.gnu.org>

    Backport from master
    2020-03-13  Kewen Lin  <linkw@gcc.gnu.org>

    PR testsuite/93935
    * gcc.dg/vect/bb-slp-over-widen-2.c: Expect basic block vectorized
    messages only on vect_hw_misalign targets.
2020-03-24 21:13:20 -05:00
GCC Administrator 76f7f2f965 Daily bump. 2020-03-25 00:17:25 +00:00
John David Anglin 366f69fdf4 Define __BIG_ENDIAN__
2020-03-24  John David Anglin  <danglin@gcc.gnu.org>

	PR lto/94249
	* config/pa/pa.h (TARGET_CPU_CPP_BUILTINS): Define __BIG_ENDIAN__.
2020-03-24 17:07:23 +00:00
Tamar Christina 8fa2081ca6 AArch64: Break apart paradoxical subregs for VSTRUCT writes (PR target/94052)
This works around an ICE in reload where from expand we get the following RTL
generated for VSTRUCT mode writes:

(insn 446 354 445 2 (set (reg:CI 383)
 (subreg:CI (reg:V4SI 291) 0)) "small.i":146:22 3408 {*aarch64_movci}
 (nil))

This sequence is trying to say two things:

1) liveliness: It's trying to say that eventually the whole CI reg will be
	       written to. It does this by generating the paradoxical subreg.
2) write data: It's trying to in the same instruction also write the V4SI mode
	       component at offset 0 in the CI reg.

This patch fixes it by in the backend when we see such a paradoxical
construction breaking it apart and issuing a clobber to correct the liveliness
information and then emitting a normal subreg write for the component that the
paradoxical subreg was trying to write to.

Concretely we generate this:

(insn 42 41 43 (clobber (reg/v:CI 122 [ diD.5226 ])) "small.i":121:23 -1
     (nil))

(insn 43 42 44 (set (subreg:V4SI (reg/v:CI 122 [ diD.5226 ]) 0)
        (reg:V4SI 136)) "small.i":121:23 -1
     (nil))

gcc/ChangeLog:

	PR target/94052
	* config/aarch64/aarch64-simd.md (mov<mode>): Remove paradoxical
	subregs of VSTRUCT modes.

gcc/testsuite/ChangeLog:

	PR target/94052
        * g++.target/aarch64/pr94052.C: New test.
2020-03-24 14:54:09 +00:00
Bin Cheng 95c969e58f backport PR94125: Update post order number for merged SCC.
Function loop_distribution::break_alias_scc_partitions needs to compute
SCC with runtime alias edges skipped.  As a result, partitions could be
re-assigned larger post order number than SCC's precedent partition and
distributed before the precedent one.  This fixes the issue by updating
the merged partition to the minimal post order in SCC.

Backport from mainline.
    PR tree-optimization/94125
    * tree-loop-distribution.c
    (loop_distribution::break_alias_scc_partitions): Update post order
    number for merged scc.

    * gcc.dg/tree-ssa/pr94125.c: New test.
2020-03-24 17:40:21 +08:00
GCC Administrator 2e432a9783 Daily bump. 2020-03-24 00:17:39 +00:00
Joseph Myers c7bc3b6562 Remove wrongly committed file. 2020-03-23 19:07:40 +00:00
Will Schmidt 5c7bd28d1c backport PR90763: PowerPC vec_xl_len should take const argument.
2020-03-23  Will Schmidt  <will_schmidt@vnet.ibm.com>

    Backport from mainline.
    2020-03-10  Will Schmidt  <will_schmidt@vnet.ibm.com>

    PR target/90763
    * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
    add clause to handle P9V_BUILTIN_VEC_LXVL with const arguments.

    * gcc.target/powerpc/pr90763.c: New.
2020-03-23 14:04:20 -05:00
Iain Sandoe 46de8b3eb1 Darwin: Fix i686 bootstrap when the assembler supports GOTOFF in data.
When we use an assembler that supports " .long XX@GOTOFF", the current
combination of configuration parameters and conditional compilation
(when building an i686-darwin compiler with mdynamic-no-pic) assume that
it's OK to put jump tables in the .const section.

However, when we encounter a weak function with a jump table, this
produces relocations that directly access the weak symbol section from
the .const section - which is deemed illegal by the linker (since that
would mean that the weak symbol could not be replaced).

Arguably, this is a limitation (maybe even a bug) in the linker - but
it seems that we'd have to change the ABI to fix it - since it would
require some annotation (maybe just using a special section for the
jump tables) to tell the linker that this specific circumstance is OK
because the direct access to the weak symbol can only occur from that
symbol itself.

The fix is to force jump tables into the text section for all X86 Darwin
versions (PIC code already had this change).

gcc/ChangeLog:

2020-03-23  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from master.
	2020-03-22  Iain Sandoe  <iain@sandoe.co.uk>

	* config/i386/darwin.h (JUMP_TABLES_IN_TEXT_SECTION): Remove
	references to Darwin.
	* config/i386/i386.h (JUMP_TABLES_IN_TEXT_SECTION): Define this
	unconditionally and comment on why.
2020-03-23 17:14:34 +00:00
GCC Administrator a5ef37f868 Daily bump. 2020-03-23 00:17:27 +00:00
GCC Administrator 938de7cbb1 Daily bump. 2020-03-22 12:52:15 +00:00
GCC Administrator ecce469d89 Daily bump. 2020-03-21 00:17:31 +00:00
GCC Administrator bf061b9a5f Daily bump. 2020-03-20 00:17:30 +00:00
Jonathan Wakely 337111a234 doc: Note that some warnings depend on optimizations (PR 92757)
Backport from mainline
2020-01-13  Jonathan Wakely  <jwakely@redhat.com>

	PR driver/92757
	* doc/invoke.texi (Warning Options): Add caveat about some warnings
	depending on optimization settings.
2020-03-19 15:33:02 +00:00
Jiufu Guo d01cb80e0f rs6000: Check -+0 and NaN for smax/smin generation
PR93709 mentioned regressions on maxlocval_4.f90 and minlocval_f.f90 which
relates to max of '-inf' and 'nan'. This regression occur on P9 because
P9 new instruction 'xsmaxcdp' is generated.
And for C code `a < b ? b : a` is also generated as `xsmaxcdp` under -O2
for P9. While this instruction behavior more like C/C++ semantic (a>b?a:b).
In GCC9, the issue also occur as the new test case shows.

This generates prevents 'xsmaxcdp' to be generated for those cases.
'xsmincdp' also is handled in patch.

gcc/
2020-03-19  Jiufu Guo  <guojiufu@linux.ibm.com>

	PR target/93709
	* gcc/config/rs6000/rs6000.c (rs6000_emit_p9_fp_minmax): Check
	NAN and SIGNED_ZEROR for smax/smin.

gcc/testsuite
2020-03-19  Jiufu Guo  <guojiufu@linux.ibm.com>

	PR target/93709
	* gcc.target/powerpc/p9-minmax-3.c: New test.
2020-03-19 12:27:57 +08:00
GCC Administrator 883465f79e Daily bump. 2020-03-19 00:17:31 +00:00
GCC Administrator c78b41b23b Daily bump. 2020-03-18 00:17:30 +00:00
Jakub Jelinek 65de83595f expand: Don't depend on warning flags in code generation of strnlen [PR94189]
The following testcase FAILs with -O2 -fcompare-debug, but the reason isn't
that we'd emit different code based on -g or non-debug, but rather that
we emit different code depending on whether -w is used or not (or e.g.
-Wno-stringop-overflow or whether some other pass emitted some other warning
already on the call).

Code generation shouldn't depend on whether we emit a warning or not if at
all possible.

The following patch punts (i.e. doesn't optimize the strnlen call to a
constant value) if we would emit the warning if it was enabled.
In the PR there is an alternate patch which does optimize the strnlen call
no matter if we emit the warning or not, though I think I prefer the version
below, e.g. the strnlen call might be crossing field boundaries, which is in
strict reading undefined, but I'd be afraid people do that in the real
world programs.

2020-03-17  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/94189
	* builtins.c (expand_builtin_strnlen): Do return NULL_RTX if we would
	emit a warning if it was enabled and don't depend on TREE_NO_WARNING
	for code-generation.

	* gcc.dg/pr94189.c: New test.
2020-03-17 18:25:26 +01:00
Jakub Jelinek 378e830538 tree-inline: Fix a -fcompare-debug issue in the inliner [PR94167]
The following testcase fails with -fcompare-debug.  The problem is that
bar is marked as address_taken only with -g and not without.
I've tracked it down to insert_init_stmt calling gimple_regimplify_operands
even on DEBUG_STMTs.  That function will just insert normal stmts before
the DEBUG_STMT if the DEBUG_STMT operand isn't gimple val or invariant.
While DCE will turn those statements into debug temporaries, it can cause
differences in SSA_NAMEs and more importantly, the ipa references are
generated from those before the DCE happens.
On the testcase, the DEBUG_STMT value is (int)bar.

We could generate DEBUG_STMTs with debug temporaries instead, but I fail to
see the reason to do that, DEBUG_STMTs allow other expressions and all we
want to ensure is that the expressions aren't too large (arbitrarily
complex), but during inlining/function versioning I don't see why something
would queue a DEBUG_STMT with arbitrarily complex expressions in there.

2020-03-16  Jakub Jelinek  <jakub@redhat.com>

	PR debug/94167
	* tree-inline.c (insert_init_stmt): Don't gimple_regimplify_operands
	DEBUG_STMTs.

	* gcc.dg/pr94167.c: New test.
2020-03-17 18:24:28 +01:00
Jakub Jelinek a8fc40fd55 tree-nested: Fix handling of *reduction clauses with C array sections [PR93566]
tree-nested.c didn't handle C array sections in {,task_,in_}reduction clauses.

2020-03-14  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/93566
	* tree-nested.c (convert_nonlocal_omp_clauses,
	convert_local_omp_clauses): Handle {,in_,task_}reduction clauses
	with C/C++ array sections.

	* testsuite/libgomp.c/pr93566.c: New test.
2020-03-17 18:22:56 +01:00
Jakub Jelinek c2f836c413 aarch64: Fix another bug in aarch64_add_offset_1 [PR94121]
> I'm getting this ICE with -mabi=ilp32:
>
> during RTL pass: fwprop1
> /opt/gcc/gcc-20200312/gcc/testsuite/gcc.dg/pr94121.c: In function 'bar':
> /opt/gcc/gcc-20200312/gcc/testsuite/gcc.dg/pr94121.c:16:1: internal compiler error: in decompose, at rtl.h:2279

That is a preexisting issue, caused by another bug in the same function.
When mode is SImode and moffset is 0x80000000 (or anything else with the
bit 31 set), we need to sign-extend it.

2020-03-13  Jakub Jelinek  <jakub@redhat.com>

	PR target/94121
	* config/aarch64/aarch64.c (aarch64_add_offset_1): Use gen_int_mode
	instead of GEN_INT.
2020-03-17 18:22:13 +01:00
Jakub Jelinek 3739894d0c maintainer-scripts: Fix up gcc_release without -l, where mkdir was using umask 077 after migration
2020-03-12  Jakub Jelinek  <jakub@redhat.com>

	* gcc_release (upload_files): Without -l, pass -m 755 to the mkdir
	command invoked through ssh.
2020-03-17 18:21:24 +01:00
Jakub Jelinek 9a8af207d7 doc: Fix up ASM_OUTPUT_ALIGNED_DECL_LOCAL description
When looking into PR94134, I've noticed bugs in the
ASM_OUTPUT_ALIGNED_DECL_LOCAL documentation.  varasm.c has:
  #if defined ASM_OUTPUT_ALIGNED_DECL_LOCAL
    unsigned int align = symtab_node::get (decl)->definition_alignment ();
    ASM_OUTPUT_ALIGNED_DECL_LOCAL (asm_out_file, decl, name,
                                   size, align);
    return true;
  #elif defined ASM_OUTPUT_ALIGNED_LOCAL
    unsigned int align = symtab_node::get (decl)->definition_alignment ();
    ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, align);
    return true;
  #else
    ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded);
    return false;
  #endif
and the ASM_OUTPUT_ALIGNED_LOCAL documentation properly mentions:
Like @code{ASM_OUTPUT_LOCAL} and mentions the same macro in another place.
The ASM_OUTPUT_ALIGNED_DECL_LOCAL description mentions non-existing macros
ASM_OUTPUT_ALIGNED_DECL and ASM_OUTPUT_DECL instead of the right ones
ASM_OUTPUT_ALIGNED_LOCAL and ASM_OUTPUT_LOCAL.

2020-03-12  Jakub Jelinek  <jakub@redhat.com>

	* doc/tm.texi.in (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Change
	ASM_OUTPUT_ALIGNED_DECL in description to ASM_OUTPUT_ALIGNED_LOCAL
	and ASM_OUTPUT_DECL to ASM_OUTPUT_LOCAL.
	* doc/tm.texi: Regenerated.
2020-03-17 18:18:40 +01:00
Jakub Jelinek a545ffafa3 tree-dse: Fix mem* head trimming if call has lhs [PR94130]
As the testcase shows, if DSE decides to head trim {mem{set,cpy,move},strncpy}
and the call has lhs, it is incorrect to leave the lhs as is, because it
will then point to the adjusted address (base + head_trim) instead of the
original base.
The following patch fixes that by dropping the lhs of the call and assigning
lhs the original base in a following statement.

2020-03-12  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/94130
	* tree-ssa-dse.c: Include gimplify.h.
	(increment_start_addr): If stmt has lhs, drop the lhs from call and
	set it after the call to the original value of the first argument.
	Formatting fixes.
	(decrement_count): Formatting fix.

	* gcc.c-torture/execute/pr94130.c: New test.
2020-03-17 18:16:15 +01:00
Jakub Jelinek f1125cf88a pdp11: Fix handling of common (local and global) vars [PR94134]
As mentioned in the PR, the generic code decides to put the a variable into
lcomm_section, which is a NOSWITCH section and thus the generic code doesn't
switch into a particular section before using
ASM_OUTPUT{_ALIGNED{,_DECL}_}_LOCAL, on many targets that results just in
.lcomm (or for non-local .comm) directives which don't need a switch to some
section, other targets put switch_to_section (bss_section) at the start of
that macro.
pdp11 doesn't do that (and doesn't have bss_section), and so emits the
lcomm/comm variables in whatever section is current (it has only .text/.data
and for DEC assembler rodata).

The following patch fixes that by putting it always into data section, and
additionally avoids emitting an empty line in the assembly for the lcomm
vars.

2020-03-11  Jakub Jelinek  <jakub@redhat.com>

	PR target/94134
	* config/pdp11/pdp11.c (pdp11_asm_output_var): Call switch_to_section
	at the start to switch to data section.  Don't print extra newline if
	.globl directive has not been emitted.

	* gcc.c-torture/execute/pr94134.c: New test.
2020-03-17 18:13:12 +01:00
Jakub Jelinek a644079a70 aarch64: Fix ICE in aarch64_add_offset_1 [PR94121]
abs_hwi asserts that the argument is not HOST_WIDE_INT_MIN and as the
(invalid) testcase shows, the function can be called with such an offset.
The following patch is IMHO minimal fix, absu_hwi unlike abs_hwi allows even
that value and will return (unsigned HOST_WIDE_INT) HOST_WIDE_INT_MIN
in that case.  The function then uses moffset in two spots which wouldn't
care if the value is (unsigned HOST_WIDE_INT) HOST_WIDE_INT_MIN or
HOST_WIDE_INT_MIN and wouldn't accept it (!moffset and
aarch64_uimm12_shift (moffset)), then in one spot where the signedness of
moffset does matter and using unsigned is the right thing -
moffset < 0x1000000 - and finally has code which will handle even this
value right; the assembler doesn't really care for DImode immediates if
        mov     x1, -9223372036854775808
or
        mov     x1, 9223372036854775808
is used and similarly it doesn't matter if we add or sub it in DImode.

2020-03-11  Jakub Jelinek  <jakub@redhat.com>

	PR target/94121
	* config/aarch64/aarch64.c (aarch64_add_offset_1): Use absu_hwi
	instead of abs_hwi, change moffset type to unsigned HOST_WIDE_INT.

	* gcc.dg/pr94121.c: New test.
2020-03-17 18:11:54 +01:00
Jakub Jelinek 343c467ccd dfp: Fix decimal_to_binary [PR94111]
As e.g. decimal_from_decnumber shows, the REAL_VALUE_TYPE representation
contains a decimal128 embedded in ->sig only if it is rvc_normal, for
other kinds like rvc_inf or rvc_nan, ->sig is ignored and everything is
contained in the REAL_VALUE_TYPE flags (cl, sign, signalling and decimal).
decimal_to_binary which is used when folding a decimal{32,64,128} constant
to a binary floating point type ignores this and thus folds infinities and
NaNs into +0.0.
The following patch fixes that by only doing that for rvc_normal.
Similarly to the binary to decimal folding, it goes through a string, in
order to e.g. deal with canonical NaN mantissas, or binary float formats
that don't support infinities and/or NaNs.

2020-03-11  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/94111
	* dfp.c (decimal_to_binary): Only use decimal128ToString if from->cl
	is rvc_normal, otherwise use real_to_decimal to print the number to
	string.

	* gcc.dg/dfp/pr94111.c: New test.
2020-03-17 18:10:17 +01:00
Jakub Jelinek 2fd27691f2 ldist: Further fixes for -ftrapv [PR94114]
As the testcase shows, arithmetics that for -ftrapv would need multiple
basic blocks can show up not just in nb_bytes expressions where we
are calling rewrite_to_non_trapping_overflow for a while already,
but also in the pointer expression to the start of the region.
While the testcase covers just the first hunk and I've failed to create
a testcase for the latter, it is at least in theory possible too, so I've
adjusted that hunk too.

2020-03-11  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/94114
	* tree-loop-distribution.c (generate_memset_builtin): Call
	rewrite_to_non_trapping_overflow even on mem.
	(generate_memcpy_builtin): Call rewrite_to_non_trapping_overflow even
	on dest and src.

	* gcc.dg/pr94114.c: New test.
2020-03-17 18:07:09 +01:00
Jakub Jelinek e0d6777cda print-rtl: Fix printing of CONST_STRING in DEBUG_INSNs [PR93399]
The following testcase fails to assemble, as CONST_STRING in the DEBUG_INSNs
is printed as is, so if it contains \n and/or \r, we are in trouble:
        .loc 1 14 3
        # DEBUG haystack => [si]
        # DEBUG needle => "
"
In the gimple dumps we print those (STRING_CSTs) as
  # DEBUG haystack => D#1
  # DEBUG needle => "\n"
so this patch uses what we use in tree printing for the CONST_STRINGs too.

2020-03-05  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/93399
	* tree-pretty-print.h (pretty_print_string): Declare.
	* tree-pretty-print.c (pretty_print_string): Remove forward
	declaration, no longer static.  Change nbytes parameter type
	from unsigned to size_t.
	* print-rtl.c (print_value) <case CONST_STRING>: Use
	pretty_print_string and for shrink way too long strings.

	* gcc.dg/pr93399.c: New test.
2020-03-17 18:04:43 +01:00
Jakub Jelinek d2a810ee83 inliner: Copy DECL_BY_REFERENCE in copy_decl_to_var [PR93888]
In the following testcase we emit wrong debug info for the karg
parameter in the DW_TAG_inlined_subroutine into main.
The problem is that the karg PARM_DECL is DECL_BY_REFERENCE and thus
in the IL has const K & type, but in the source just const K.
When the function is inlined, we create a VAR_DECL for it, but don't
set DECL_BY_REFERENCE, so when emitting DW_AT_location, we treat it like
a const K & typed variable, but it has DW_AT_abstract_origin which has
just the const K type and thus the debugger thinks the variable has
const K type.

Fixed by copying the DECL_BY_REFERENCE flag.  Not doing it in
copy_decl_for_dup_finish, because copy_decl_no_change already copies
that flag through copy_node and in copy_result_decl_to_var it is
undesirable, as we handle DECL_BY_REFERENCE in that case instead
by changing the type.

2020-03-04  Jakub Jelinek  <jakub@redhat.com>

	PR debug/93888
	* tree-inline.c (copy_decl_to_var): Copy DECL_BY_REFERENCE flag.

	* g++.dg/guality/pr93888.C: New test.
2020-03-17 18:03:16 +01:00
Jakub Jelinek 5de0dc84c7 tailcall: Fix up process_assignment [PR94001]
When a function returns void or the return value is ignored, ass_var
is NULL_TREE.  The tail recursion handling generally assumes DCE has been
performed and so doesn't expect to encounter useless assignments after the
call and expects them to be part of the return value adjustment that need
to be changed into tail recursion additions/multiplications.
process_assignment does some verification and has a way to tell the caller
to try to move dead or whatever other stmts that don't participate in the
return value modifications before it is returned.
For binary rhs assignments it is just fine, neither op0 nor op1 will be
NULL_TREE and thus if *ass_var is NULL_TREE, it will not match, but unary
rhs is handled by only setting op0 to rhs1 and setting op1 to NULL_TREE.
And at this point, NULL_TREE == NULL_TREE and thus we think e.g. the
  c_2 = -e_3(D);
dead stmt is actually a return value modification, so we queue it as
multiplication and then create a void type SSA_NAME accumulator for it
and ICE shortly after.

Fixed by making sure op1 == *ass_var comparison is done only if *ass_var.

2020-03-04  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/94001
	* tree-tailcall.c (process_assignment): Before comparing op1 to
	*ass_var, verify *ass_var is non-NULL.

	* gcc.dg/pr94001.c: New test.
2020-03-17 18:01:13 +01:00
Kewen Lin 05409a1edd [testsuite] Fix PR94019 to check vector char when vect_hw_misalign
As PR94019 shows, without misaligned vector access support but with
realign load, the vectorized loop will end up with realign scheme.
It generates mask (control vector) with return type vector signed
char which breaks the not check.

gcc/testsuite/ChangeLog

2020-03-17  Kewen Lin  <linkw@gcc.gnu.org>

    Backport from master
    2020-03-09  Kewen Lin  <linkw@gcc.gnu.org>

    PR testsuite/94019
    * gcc.dg/vect/vect-over-widen-17.c: Don't expect vector char if it's
    without misaligned vector access support.
2020-03-16 22:16:18 -05:00
Kewen Lin 62960ccdef [testsuite] Fix PR94023 to guard case under vect_hw_misalign
As PR94023 shows, the expected SLP requires misaligned vector access
support.  This patch is to guard the check under the target condition
vect_hw_misalign to ensure that.

2020-03-17  Kewen Lin  <linkw@gcc.gnu.org>

    Backport from master
    2020-03-09  Kewen Lin  <linkw@gcc.gnu.org>

    PR testsuite/94023
    * gcc.dg/vect/slp-perm-12.c: Expect loop vectorized messages only on
    vect_hw_misalign targets.
2020-03-16 22:10:22 -05:00
GCC Administrator 9a532a94e3 Daily bump. 2020-03-17 00:17:21 +00:00
Jonathan Wakely 31b204ace2 libstdc++: Add default constructor to net::service_already_exists (PR 94199)
The service_already_exists exception type specified in the TS doesn't
have any constructors defined. Since its base class isn't default
constructible, that means has no usable constructors. This may be a
defect in the TS.

This patch fixes it by adding a default constructor, but making it
private. The make_service function is declared as a friend to be able to
call that private constructor.

Backport from mainline
2020-03-16  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/94199
	* include/experimental/executor (service_already_exists): Add default
	constructor. Declare make_service to be a friend.
	* testsuite/experimental/net/execution_context/make_service.cc: New
	test.
2020-03-16 22:55:48 +00:00
GCC Administrator a81912b074 Daily bump. 2020-03-16 00:17:28 +00:00
Jason Merrill c3747bca38 c++: Find parameter pack in typedef in lambda [92909].
find_parameter_packs_r doesn't look through typedefs, which is normally
correct, but that means we need to handle their declarations specially.

gcc/cp/ChangeLog
2020-03-14  Jason Merrill  <jason@redhat.com>

	PR c++/92909
	* pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk
	DECL_ORIGINAL_TYPE of a typedef.
2020-03-15 12:24:27 -04:00
Jason Merrill 2fa5f9e380 c++: Fix ICE-after-error on partial spec [92068]
Here the template arguments for the partial specialization are valid
arguments for the template, but not for a partial specialization, because
'd' can never be deduced to anything other than an empty pack.

gcc/cp/ChangeLog
2020-03-14  Jason Merrill  <jason@redhat.com>

	PR c++/92068
	* pt.c (process_partial_specialization): Error rather than crash on
	extra pack expansion.
2020-03-15 05:47:28 -04:00
Jason Merrill cb05d702a1 c++: Fix CTAD with multiple-arg ctor template [93248].
When cp_unevaluated_operand is set, tsubst_decl thinks that if it sees a
PARM_DECL that isn't already in local_specializations, we're in a decltype
in a trailing return type or some such, and so we only want a substitution
for a single PARM_DECL.  In this case, we want the whole chain, so make sure
cp_unevaluated_operand is cleared.

gcc/cp/ChangeLog
2020-03-14  Jason Merrill  <jason@redhat.com>

	PR c++/93248
	* pt.c (build_deduction_guide): Clear cp_unevaluated_operand for
	substituting DECL_ARGUMENTS.
2020-03-15 05:47:28 -04:00
GCC Administrator 6c7e43f470 Daily bump. 2020-03-15 00:17:26 +00:00
GCC Administrator 0f66f1d803 Daily bump. 2020-03-14 00:17:41 +00:00
Eric Botcazou ab768006bc Fix wrong year in ChangeLog. 2020-03-13 18:03:41 +01:00
Richard Biener db35845528 tree-optimization/94163 constrain alignment set by PRE
This avoids HWI -> unsigned truncation to end up with zero alignment
which set_ptr_info_alignment ICEs on.

2020-03-13  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/94163
	* tree-ssa-pre.c (create_expression_by_pieces): Check
	whether alignment would be zero.
2020-03-13 13:59:07 +01:00
Eric Botcazou 593e47a613 Fix incorrect filling of delay slots in branchy code at -O2
The issue is that relax_delay_slots can streamline the CFG in some cases,
in particular remove BARRIERs, but removing BARRIERs changes the way the
instructions are associated with (basic) blocks by the liveness analysis
code in resource.c (find_basic_block) and thus can cause entries in the
cache maintained by resource.c to become outdated, thus producing wrong
answers downstream.

The fix is to invalidate the cache entries affected by the removal of
BARRIERs in relax_delay_slots, i.e. for the instructions down to the
next BARRIER.

	PR rtl-optimization/94119
	* resource.h (clear_hashed_info_until_next_barrier): Declare.
	* resource.c (clear_hashed_info_until_next_barrier): New function.
	* reorg.c (add_to_delay_list): Fix formatting.
	(relax_delay_slots): Call clear_hashed_info_until_next_barrier on
	the next instruction after removing a BARRIER.
2020-03-13 10:07:10 +01:00
GCC Administrator 0816fafce9 Daily bump. 2020-03-13 00:17:19 +00:00
Bill Schmidt de8e3b71c8 rs6000: Fix -mpower9-vector -mno-altivec ICE (PR87560)
PR87560 reports an ICE when a test case is compiled with -mpower9-vector
and -mno-altivec.  This patch terminates compilation with an error when
this combination (and other unreasonable ones) are requested.

Bootstrapped and tested on powerpc64le-unknown-linux-gnu with no
regressions.  Reported error is now:

f951: Error: '-mno-altivec' turns off '-mpower9-vector'

2020-03-12  Bill Schmidt  <wschmidt@linux.ibm.com>

	Backport from master
	2020-03-02  Bill Schmidt  <wschmidt@linux.ibm.com>

	PR target/87560
	* rs6000-cpus.def (OTHER_ALTIVEC_MASKS): New #define.
	* rs6000.c (rs6000_disable_incompatible_switches): Add table entry
	for OPTION_MASK_ALTIVEC.
2020-03-12 15:28:50 -05:00
Jonathan Wakely 7ef07b622d libstdc++: Handle type-changing path concatenations (PR 94063)
The filesystem::path::operator+= and filesystem::path::concat functions
operate directly on the native format of the path and so can cause a
path to mutate to a completely different type.

For Windows combining a filename "x" with a filename ":" produces a
root-name "x:". Similarly, a Cygwin root-directory "/" combined with a
root-directory and filename "/x" produces a root-name "//x".

Before this patch the implemenation didn't support those kind of
mutations, assuming that concatenating two filenames would always
produce a filename and concatenating with a root-dir would still have a
root-dir.

This patch fixes it simply by checking for the problem cases and
creating a new path by re-parsing the result of the string
concatenation. This is slightly suboptimal because the argument has
already been parsed if it's a path, but more importantly it doesn't
reuse any excess capacity that the path object being modified might
already have allocated.

Backport from mainline
2020-03-09  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/94063
	* src/c++17/fs_path.cc (path::operator+=(const path&)): Add kluge to
	handle concatenations that change the type of the first component.
	(path::operator+=(basic_string_view<value_type>)): Likewise.
	* testsuite/27_io/filesystem/path/concat/94063.cc: New test.
2020-03-12 17:39:05 +00:00
Jonathan Wakely 95a82afc8a libstdc++: Fix name of macro in #undef directive
The macro that is defined is _GLIBCXX_NOT_FN_CALL_OP but the macro that
was named in the #undef directive was _GLIBCXX_NOT_FN_CALL. This fixes
the #undef.

Backport from mainline
2020-02-04  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/functional (_GLIBCXX_NOT_FN_CALL_OP): Un-define after
	use.
2020-03-12 17:39:05 +00:00
Jonathan Wakely 55925fe3a9 libstdc++: Fix test failure due to -Wnonnull warnings
This test fails in the Fedora RPM build (but not elsewhere, for unknown
reasons). The warning is correct, we're passing a null pointer.

Backport from mainline
2020-03-12  Jonathan Wakely  <jwakely@redhat.com>

	* testsuite/tr1/8_c_compatibility/cstdlib/functions.cc: Do not pass
	a null pointer to functions with nonnull(1) attribute.
2020-03-12 17:39:05 +00:00
Jonathan Wakely 2fa3247fef libstdc++: Fix FS-dependent filesystem tests
These tests were failing on XFS because it doesn't support setting file
timestamps past 2038, so the expected overflow when reading back a huge
timestamp into a file_time_type didn't happen.

Additionally, the std::filesystem::file_time_type::clock has an
epoch that is out of range of 32-bit time_t so testing times around that
epoch may also fail.

This fixes the tests to give up gracefully if the filesystem doesn't
support times that can't be represented in 32-bit time_t.

Backport from mainline
2020-02-28  Jonathan Wakely  <jwakely@redhat.com>

	* testsuite/27_io/filesystem/operations/last_write_time.cc: Fixes for
	filesystems that silently truncate timestamps.
	* testsuite/experimental/filesystem/operations/last_write_time.cc:
	Likewise.
2020-03-12 17:39:04 +00:00
Jonathan Wakely 362c8772e7 libstdc++: Ensure root-dir converted to forward slash (PR93244)
Backport from mainline
2020-01-13  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/93244
	* include/bits/fs_path.h (path::generic_string<C,A>)
	[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Convert root-dir to forward-slash.
	* testsuite/27_io/filesystem/path/generic/generic_string.cc: Check
	root-dir is converted to forward slash in generic pathname.
	* testsuite/27_io/filesystem/path/generic/utf.cc: New test.
	* testsuite/27_io/filesystem/path/generic/wchar_t.cc: New test.
2020-03-12 17:39:04 +00:00
Richard Earnshaw 08f00a213f arm: correct constraints on movsi_compare0 [PR91913]
The peephole that detects a mov of one register to another followed by
a comparison of the original register against zero is only used in Arm
state; but the instruction that matches this is generic to all 32-bit
compilation states.  That instruction lacks support for SP which is
permitted in Arm state, but has restrictions in Thumb2 code.

This patch fixes the problem by allowing SP when in ARM state for all
registers; in Thumb state it allows SP only as a source when the
register really is copied to another target.

gcc/ChangeLog:
	PR target/91913
	Backport from master
	* config/arm/arm.md (movsi_compare0): Allow SP as a source register
	in Thumb state and also as a destination in Arm state.  Add T16
	variants.

gcc/testsuite/ChangeLog:
	2020-02-10  Jakub Jelinek  <jakub@redhat.com>

	PR target/91913
	Backport from master
	* gfortran.dg/pr91913.f90: New test.
2020-03-12 14:35:05 +00:00
Martin Liska 716cc43745 Backport 314b91220a
Backport from mainline
	2020-03-09  Martin Liska  <mliska@suse.cz>

	PR target/93800
	* config/rs6000/rs6000.c (rs6000_option_override_internal):
	Remove set of str_align_loops and str_align_jumps as these
	should be set in previous 2 conditions in the function.
	Backport from mainline
	2020-03-09  Martin Liska  <mliska@suse.cz>

	PR target/93800
	* gcc.target/powerpc/pr93800.c: New test.
2020-03-12 13:36:17 +01:00
Jakub Jelinek 9f26e5863a Bump BASE-VER to 9.3.1.
2020-03-12  Jakub Jelinek  <jakub@redhat.com>

	* BASE-VER: Set to 9.3.1.
2020-03-12 12:38:50 +01:00
Jakub Jelinek 4212a6a3e4 Update ChangeLog and version files for release 2020-03-12 11:08:05 +00:00
GCC Administrator f7589b1c8b Daily bump. 2020-03-12 00:17:18 +00:00
Eric Botcazou c9858be2e7 Fix internal error on locally-defined subpools
If the type is derived in the current compilation unit, and Allocate
is not overridden on derivation (as is typically the case with
Root_Storage_Pool_With_Subpools), the entity for Allocate of the
derived type is an alias for System.Storage_Pools.Subpools.Allocate.

The main assertion in gnat_to_gnu_entity fails in this case, since
this is not a definition and Is_Public is false (since the entity
is nested in the same compilation unit).

2020-03-11  Richard Wai  <richard@annexi-strayline.com>

	* gcc-interface/decl.c (gnat_to_gnu_entity): Also test Is_Public on
	the Alias of the entitiy, if is present, in the main assertion.
2020-03-11 11:11:33 +01:00
GCC Administrator 3b0babc396 Daily bump. 2020-03-11 00:17:22 +00:00
Xionghu Luo 85c08558c6 Backport to gcc-9: PR92398: Fix testcase failure of pr72804.c
Backport the patch to fix failures on P9 and P8BE, P7LE for PR94036.
Tested pass on P9/P8/P7.
(gcc-8 is not needed as the test doesn't exists.)

P9LE generated instruction is not worse than P8LE.
mtvsrdd;xxlnot;stxv vs. not;not;std;std.
It can have longer latency, but latency via memory is not so critical,
and this does save decode and other resources.  It's hard to choose
which is best.  Update the test case to fix failures.

gcc/testsuite/ChangeLog:

	2020-03-10  Luo Xiong Hu  <luoxhu@linux.ibm.com>

	backport from master.
	PR testsuite/94036

	2019-12-02  Luo Xiong Hu  <luoxhu@linux.ibm.com>

	PR testsuite/92398
	* gcc.target/powerpc/pr72804.c: Split the store function to...
	* gcc.target/powerpc/pr92398.h: ... this one.  New.
	* gcc.target/powerpc/pr92398.p9+.c: New.
	* gcc.target/powerpc/pr92398.p9-.c: New.
	* lib/target-supports.exp (check_effective_target_p8): New.
	(check_effective_target_p9+): New.
2020-03-09 20:48:24 -05:00
GCC Administrator 5b1a849ee4 Daily bump. 2020-03-10 00:17:26 +00:00
GCC Administrator 7341a55741 Daily bump. 2020-03-09 00:18:12 +00:00
GCC Administrator 3786be0288 Daily bump. 2020-03-07 00:18:25 +00:00
Jonathan Wakely 39bdebf372 libstdc++: Fix call to __glibcxx_rwlock_init (PR 94069)
When the target doesn't define PTHREAD_RWLOCK_INITIALIZER we use a
wrapper around pthread_wrlock_init, but the wrapper only takes one
argument and we try to call it with two.

This went unnnoticed on most targets because they do define the
PTHREAD_RWLOCK_INITIALIZER macro, but it causes a bootstrap failure on
darwin8.

Backport from mainline
2020-03-06  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/94069
	* include/std/shared_mutex [!PTHREAD_RWLOCK_INITIALIZER]
	(__shared_mutex_pthread::__shared_mutex_pthread()): Remove incorrect
	second argument to __glibcxx_rwlock_init.
	* testsuite/30_threads/shared_timed_mutex/94069.cc: New test.
2020-03-06 12:52:51 +00:00
GCC Administrator c5edde44f5 Daily bump. 2020-03-06 00:18:37 +00:00
Jason Merrill e50627ff8c c++: Avoid ICE on infinite recursion with concepts.
This was simple enough to backport even though it's concepts.

gcc/cp/ChangeLog
2020-03-05  Jason Merrill  <jason@redhat.com>

	PR c++/88395
	PR c++/93551
	* constraint.cc (constraints_satisfied_p): Use push_tinst_level.
2020-03-05 14:13:24 -05:00
Jakub Jelinek 07d52e63d9 i386: Fix some -O0 avx2intrin.h and xopintrin.h intrinsic macros [PR94046]
As the testcases show, the macros we have for -O0 for intrinsics that require
constant argument(s) should first cast the argument to the type the -O1+
inline uses and afterwards to whatever type e.g. a builtin needs.
The PR reported one which violated this, and I've grepped for all double-casts
and grepped out from that meaningful casts where the __m{128,256,512}{,d,i}
first cast is cast to same sized __v* type and has the same kind of element
type (float, double, integral).  These 7 macros were using different casts,
and I've double checked them against the inline function types.

2020-03-05  Jakub Jelinek  <jakub@redhat.com>

	PR target/94046
	* config/i386/avx2intrin.h (_mm_mask_i32gather_ps): Fix first cast of
	SRC and MASK arguments to __m128 from __m128d.
	(_mm256_mask_i32gather_ps): Fix first cast of MASK argument to __m256
	from __m256d.
	(_mm_mask_i64gather_ps): Fix first cast of MASK argument to __m128
	from __m128d.
	* config/i386/xopintrin.h (_mm_permute2_pd): Fix first cast of C
	argument to __m128i from __m128d.
	(_mm256_permute2_pd): Fix first cast of C argument to __m256i from
	__m256d.
	(_mm_permute2_ps): Fix first cast of C argument to __m128i from __m128.
	(_mm256_permute2_ps): Fix first cast of C argument to __m256i from
	__m256.

	* g++.target/i386/pr94046-1.C: New test.
	* g++.target/i386/pr94046-2.C: New test.
2020-03-05 19:53:08 +01:00
Jonathan Wakely 128418afd7 libstdc++: Fix some warnings in filesystem tests
There's a -Wunused-but-set-variable warning in operations/all.cc which
can be fixed with [[maybe_unused]].

The statements in operations/copy.cc give -Wunused-value warnings. I
think I meant to use |= rather than !=.

And operations/file_size.cc gets -Wsign-compare warnings.

Backport from mainline
2020-03-05  Jonathan Wakely  <jwakely@redhat.com>

	* testsuite/27_io/filesystem/operations/all.cc: Mark unused variable.
	* testsuite/27_io/filesystem/operations/copy.cc: Fix typo.
	* testsuite/experimental/filesystem/operations/copy.cc: Likewise.
	* testsuite/27_io/filesystem/operations/file_size.cc: Use correct type
	for return value, and in comparison.
	* testsuite/experimental/filesystem/operations/file_size.cc: Likewise.
2020-03-05 17:43:27 +00:00
Jonathan Wakely 9d0ad2d40e PR libstdc++/91910 fix data race in Debug Mode destructors
Fix data race when _Safe_iterator_base::_M_detach() runs concurrently with
the _Safe_container_base destructor.

Backport from mainline
2019-09-27  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/91910
	* src/c++11/debug.cc (_Safe_iterator_base::_M_detach()): Load pointer
	atomically and lock the mutex before accessing the sequence.
	(_Safe_local_iterator_base::_M_detach()): Likewise.
	(_Safe_iterator_base::_M_reset()): Clear _M_sequence atomically.
2020-03-05 17:43:16 +00:00
Jonathan Wakely 494166791e Add 'noexcept' to std::lerp
Backport from mainline
2019-06-17  Jonathan Wakely  <jwakely@redhat.com>

	* include/c_global/cmath (__lerp, lerp): Add noexcept (LWG 3201).
2020-03-05 17:32:16 +00:00
Jonathan Wakely 65d75048c4 libstdc++: make negative count safe with std::for_each_n
The Library Working Group have approved a change to std::for_each_n that
requires it to handle negative N gracefully, which we were not doing for
random access iterators.

Backport from mainline
2019-11-07  Jonathan Wakely  <jwakely@redhat.com>

	* include/bits/stl_algo.h (for_each_n): Handle negative count.
	* testsuite/25_algorithms/for_each/for_each_n_debug.cc: New test.
2020-03-05 17:32:16 +00:00
Jonathan Wakely 08ed34284f libstdc++: Avoid using sizeof with function types (PR 93470)
Backport from mainline
2020-01-28  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/93470
	* include/bits/refwrap.h (reference_wrapper::operator()): Restrict
	static assertion to object types.
2020-03-05 17:32:16 +00:00
Richard Earnshaw d37244b40d arm: Fix incorrect modes with 'borrow' operations [PR90311]
Looking through the arm backend I noticed that the modes used to pass
comparison types into subtract-with-carry operations were being
incorrectly set.  The result is that the compiler is not truly
self-consistent.  To clean this up I've introduced a new predicate,
arm_borrow_operation (borrowed from the AArch64 backend) which can
match the comparison type with the required mode and then fixed all
the patterns to use this.  The split patterns that were generating
incorrect modes have all obviously been fixed as well.

The basic rule for the use of a borrow is:
- if the condition code was set by a 'subtract-like' operation (subs, cmp),
  then use CCmode and LTU.
- if the condition code was by unsigned overflow of addition (adds), then
  use CC_Cmode and GEU.

gcc:
	PR target/90311
	Backport from master
	* config/arm/predicates.md (arm_borrow_operation): New predicate.
	* config/arm/arm.c (subdi3_compare1): Use CCmode for the split.
	(arm_subdi3, subdi_di_zesidi, subdi_di_sesidi): Likewise.
	(subdi_zesidi_zesidi): Likewise.
	(negdi2_compare, negdi2_insn): Likewise.
	(negdi_extensidi): Likewise.
	(negdi_zero_extendsidi): Likewise.
	(arm_cmpdi_insn): Likewise.
	(subsi3_carryin): Use arm_borrow_operation.
	(subsi3_carryin_const): Likewise.
	(subsi3_carryin_const0): Likewise.
	(subsi3_carryin_compare): Likewise.
	(subsi3_carryin_compare_const): Likewise.
	(subsi3_carryin_compare_const0): Likewise.
	(subsi3_carryin_shift): Likewise.
	(rsbsi3_carryin_shift): Likewise.
	(negsi2_carryin_compare): Likewise.

gcc/testsuite:
2020-03-05  Jakub Jelinek  <jakub@redhat.com>

	Backport from master
	PR target/90311
	* gcc.c-torture/execute/pr90311.c: New test.
2020-03-05 17:25:52 +00:00
Uros Bizjak 8f34b64454 testsuite: Compile asan_test.C with -Wno-alloc-size-larger-than
asan_test.cc tries to allocate 0xf0000000 bytes for 32bit targets in
a disabled DISABLED_DemoOOM test.  Since the testcase is compiled with
-Werror, the compilation fails with:

error: argument 1 value '4026531840' exceeds maximum object size 2147483647

Compile with -Wno-alloc-size-larger-than to avoid compilation failure.

	* g++.dg/asan/asan_test.C (dg-options): Add
	-Wno-alloc-size-larger-than.
2020-03-05 17:53:03 +01:00
Martin Sebor 9ca4280a92 Backport fix for PR c++/93753 from trunk.
gcc/cp/ChangeLog:
	Backport from trunk.
	2020-02-21  Martin Sebor  <msebor@redhat.com>

	PR c++/93753
	* class.c (check_flexarrays): Tighten up a test for potential members
	of anonymous structs or unions.

gcc/testsuite/ChangeLog:

	Backport from trunk.
	2020-02-21  Martin Sebor  <msebor@redhat.com>

	PR c++/93753
	* g++.dg/ext/flexary36.C: New test.
2020-03-05 09:37:25 -07:00
Jason Merrill c47f6f6974 c++: Fix SFINAE for invalid non-type tparm types.
Just missing the usual SFINAE pattern here.  This was fixed for GCC 10 as a
drive-by in r277902.

gcc/cp/ChangeLog
2020-03-05  Jason Merrill  <jason@redhat.com>

	PR c++/90338
	* pt.c (invalid_nontype_parm_type_p): Check complain for non-literal
	and mutable errors.
2020-03-05 10:22:25 -05:00
Paul Thomas 7beafc829c Fix ICE in trans_associate_var
2020-03-05  Paul Thomas  <pault@gcc.gnu.org>

	Backport from trunk
	PR fortran/92976
	* match.c (select_type_set_tmp): Variable 'selector' to replace
	select_type_stack->selector. If the selector array spec has
	explicit bounds, make the temporary's bounds deferred.

2020-03-05  Paul Thomas  <pault@gcc.gnu.org>

	Backport from trunk
	PR fortran/92976
	* gfortran.dg/select_type_48.f90 : New test.
2020-03-05 11:04:09 +01:00
Jason Merrill e19f06538c c++: Fix constexpr ICE from const mismatch [PR91607]
gcc/cp/ChangeLog
2020-03-04  Jason Merrill  <jason@redhat.com>

	PR c++/91607
	* constexpr.c (constexpr_call_hasher::equal): Use
	same_type_ignoring_top_level_qualifiers_p.
2020-03-05 00:09:41 -05:00
Martin Sebor 1665d97d37 PR c++/90938 - Initializing array with {1} works, but not {0}
gcc/cp/ChangeLog:

	PR c++/90938
	* tree.c (type_initializer_zero_p): Fail for structs initialized
	with non-structs.

gcc/testsuite/ChangeLog:

	PR c++/90938
	* g++.dg/init/array55.C: New test.
	* g++.dg/init/array56.C: New test.
	* g++.dg/cpp2a/nontype-class33.C: New test.
2020-03-04 18:32:40 -07:00
GCC Administrator 29bb27b7ef Daily bump. 2020-03-05 00:18:25 +00:00
Marek Polacek 2b5d109ba3 c++: Fix ICE in tsubst_copy with parenthesized expression [PR93299]
PR c++/93299 - ICE in tsubst_copy with parenthesized expression.
	* pt.c (tsubst_copy): Handle a REF_PARENTHESIZED_P VIEW_CONVERT_EXPR.

	* g++.dg/cpp1y/paren5.C: New test.
2020-03-04 19:04:31 -05:00
Marek Polacek d8b65123ea sanopt: Avoid crash on anonymous parameter [PR93436]
PR sanitizer/93436
            * sanopt.c (sanitize_rewrite_addressable_params): Avoid crash on
            null DECL_NAME.
2020-03-04 19:02:22 -05:00
Marek Polacek b38d6242be c++: Fix value-init crash in template [PR93676]
PR c++/93676 - value-init crash in template.
	* init.c (build_new_1): Don't call build_vec_init in a template.

	* g++.dg/cpp0x/nsdmi-template19.C: New test.
2020-03-04 18:57:08 -05:00
Marek Polacek 581825efc3 c++: Fix mismatch in template argument deduction [PR90505]
2020-03-03  Jason Merrill  <jason@redhat.com>
	    Marek Polacek  <polacek@redhat.com>

	PR c++/90505 - mismatch in template argument deduction.
	* pt.c (tsubst): Don't reduce the template level of template
	parameters when tf_partial.

	* g++.dg/template/deduce4.C: New test.
	* g++.dg/template/deduce5.C: New test.
	* g++.dg/template/deduce6.C: New test.
	* g++.dg/template/deduce7.C: New test.
2020-03-04 18:49:37 -05:00
Jason Merrill 9af9e00483 c++: Fix [[no_unique_address]] and default mem-init [PR90432]
output_constructor doesn't like two consecutive entries with fields at the
same position; let's avoid adding the one for the empty field.

gcc/cp/ChangeLog
2020-03-04  Jason Merrill  <jason@redhat.com>

	PR c++/90432
	* init.c (perform_member_init): Don't do aggregate initialization of
	empty field.
	* constexpr.c (cx_check_missing_mem_inits): Don't enforce
	initialization of empty field.
2020-03-04 17:33:10 -05:00
Jason Merrill 831d4a6900 c++: avoid ICE with __builtin_memset (PR90997).
warn_for_memset calls fold_for_warn, which calls fold_non_dependent_expr, so
also calling instantiate_non_dependent_expr here is undesirable.

gcc/cp/ChangeLog
2020-03-04  Jason Merrill  <jason@redhat.com>

	PR c++/90997
	* semantics.c (finish_call_expr): Don't call
	instantiate_non_dependent_expr before warn_for_memset.
2020-03-04 17:33:10 -05:00
Will Schmidt bde2e6e598 Remove unnecessary XFAILs from existing testcase 20050603-3.c.
The XFAILs in this testcase (20050603-3.c) are no longer necessary
since the fix to PR68803 was committed with svn revision r242681.

2020-03-04  Will Schmidt  <will_schmidt@vnet.ibm.com>

testsuite

	* gcc.target/powerpc/20050603-3.c: Remove XFAILS.
2020-03-04 10:34:33 -06:00
Jakub Jelinek f33d2797d4 maintainer-scripts: Speed up git clone in gcc_release
When doing the 8.4-rc1, I've noticed (probably also because of the dying
disk on sourceware) that git clone is extremely slow, and furthermore when
all of us have some local snapshots, it is a waste of resources to download
everything again.  Especially for the -f runs when we'll need to wait until
git tag -s asks us for a gpg password interactively.

The following patch adds an option through which one can point the script
at a local gcc .git directory from which it can --dissociate --reference ...
during cloning to speed it up.

2020-02-27  Jakub Jelinek  <jakub@redhat.com>

	* gcc_release: Add support for -b local-git-repo argument.
2020-03-04 10:39:33 +01:00
GCC Administrator 7b20c8645a Daily bump. 2020-03-04 00:18:24 +00:00
Iain Sandoe 224ca3bfe8 Darwin, libsanitizer: Update minimum supported system version.
The imported sources from 'upstream' do not support Darwin10
or earlier, so do not enable these by default.
2020-03-03 10:17:15 +00:00
Jakub Jelinek e913d4f477 explow: Fix ICE caused by plus_constant [PR94002]
The following testcase ICEs in cross to riscv64-linux.  The problem is
that we have a DImode integral constant (that doesn't fit into SImode),
which is pushed into a constant pool and later access just the first half of
it using a MEM.  When plus_constant is called on such a MEM, if the constant
has mode, we verify the mode, but if it doesn't, we don't and ICE later on
when we think the CONST_INT is a valid SImode constant.

2020-03-03  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/94002
	* explow.c (plus_constant): Punt if cst has VOIDmode and
	get_pool_mode is different from mode.

	* gcc.dg/pr94002.c: New test.
2020-03-03 10:47:17 +01:00
GCC Administrator 010204594d Daily bump. 2020-03-03 00:18:29 +00:00
Jason Merrill 054aeaef27 c++: Fix ({ ... }) array mem-initializer.
Here, we were going down the wrong path in perform_member_init because of
the incorrect parens around the mem-initializer for the array.  And then
cxx_eval_vec_init_1 didn't know what to do with a CONSTRUCTOR as the
initializer.  For GCC 9, let's just fix the latter issue.

gcc/cp/ChangeLog
2020-03-02  Jason Merrill  <jason@redhat.com>

	PR c++/86917
	* constexpr.c (cxx_eval_vec_init_1): Handle CONSTRUCTOR.
2020-03-02 15:49:58 -05:00
Jason Merrill b4e53e9b3c c++: Allow parm of empty class type in constexpr.
Since copying a class object is defined in terms of the copy constructor,
copying an empty class is OK even if it would otherwise not be usable in a
constant expression.  Relatedly, using a parameter as an lvalue is no more
problematic than a local variable, and calling a member function uses the
object as an lvalue.

gcc/cp/ChangeLog
2020-03-02  Jason Merrill  <jason@redhat.com>

	PR c++/91953
	* constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
	empty class type.
	[COMPONENT_REF]: A member function reference doesn't use the object
	as an rvalue.
2020-03-02 15:49:58 -05:00
Jason Merrill f137a7c6b1 c++: Fix cast to pointer to VLA.
The C front-end fixed this issue in r257620 by adding a DECL_EXPR from
grokdeclarator.  We don't have an easy way to do that in the C++ front-end,
but it works fine to create and prepend a DECL_EXPR when we are genericizing
the NOP_EXPR for the cast.

The C patch wraps the DECL_EXPR in a BIND_EXPR, but that seems unnecessary
in C++; this is just a hook to run gimplify_type_sizes, we aren't actually
declaring anything that we need to worry about scoping for.

gcc/cp/ChangeLog
2020-03-02  Jason Merrill  <jason@redhat.com>

	PR c++/88256
	* cp-gimplify.c (predeclare_vla): New.
	(cp_genericize_r) [NOP_EXPR]: Call it.
2020-03-02 15:49:58 -05:00
Jason Merrill 9d5df8e322 checking: avoid verify_type_variant crash on incomplete type.
Here, we end up calling gen_type_die_with_usage for a type that's in the
middle of finish_struct_1, after we set TYPE_NEEDS_CONSTRUCTING on it but
before we copy all the flags to the variants--and, significantly, before we
set its TYPE_SIZE.  It seems reasonable to only look at
TYPE_NEEDS_CONSTRUCTING on complete types, since we aren't going to try to
create an object of an incomplete type any other way.

gcc/ChangeLog
2020-03-02  Jason Merrill  <jason@redhat.com>

	PR c++/92601
	* tree.c (verify_type_variant): Only verify TYPE_NEEDS_CONSTRUCTING
	of complete types.
2020-03-02 15:49:57 -05:00
Jason Merrill e83a2d943a c++: Fix return deduction of lambda in discarded stmt.
A return statement in a discarded statement is not used for return type
deduction, but we still want to do deduction for a return statement in a
lambda in a discarded statement.

gcc/cp/ChangeLog
2020-03-02  Jason Merrill  <jason@redhat.com>

	PR c++/93442
	* parser.c (cp_parser_lambda_expression): Clear in_discarded_stmt.
2020-03-02 15:49:57 -05:00
Jason Merrill 1ccbda907d PR c++/90732 - ICE with VLA capture and generic lambda.
We were failing to handle VLA capture in tsubst_lambda_expr; initially
building a DECLTYPE_TYPE for the capture and then tsubsting it doesn't give
the special VLA handling.  So with this patch we call add_capture again for
VLAs.

gcc/cp/ChangeLog
2020-03-02  Jason Merrill  <jason@redhat.com>

	PR c++/90732 - ICE with VLA capture and generic lambda.
	* pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
2020-03-02 15:49:57 -05:00
Jason Merrill 166c024a19 c++: Fix attributes with lambda and trailing return type.
My fix for 60503 fixed handling of C++11 attributes following the
lambda-declarator.  My patch for 89640 re-added support for GNU attributes,
but attributes after the trailing return type were parsed as applying to the
return type rather than to the function.  This patch adjusts parsing of a
trailing-return-type to ignore GNU attributes at the end of the declaration
so that they will be applied to the declaration as a whole.

I also considered parsing the attributes between the closing paren and the
trailing-return-type, and tried a variety of approaches to implementing
that, but I think it's better to stick with the documented rule that "An
attribute specifier list may appear immediately before the comma, '=' or
semicolon terminating the declaration of an identifier...."  Anyone
disagree?

Meanwhile, C++ committee discussion about the lack of any way to apply
attributes to a lambda op() seems to have concluded that they should go
between the introducer and declarator, so I've implemented that as well.

gcc/cp/ChangeLog
2020-03-02  Jason Merrill  <jason@redhat.com>

	PR c++/90333
	PR c++/89640
	PR c++/60503
	* parser.c (cp_parser_type_specifier_seq): Don't parse attributes in
	a trailing return type.
	(cp_parser_lambda_declarator_opt): Parse C++11 attributes before
	parens.
2020-03-02 15:49:57 -05:00
H.J. Lu cb54729240 lto: Also copy .note.gnu.property section
When generating the separate file with LTO debug sections, we should
also copy .note.gnu.property section.

	PR lto/93966
	* simple-object.c (handle_lto_debug_sections): Also copy
	.note.gnu.property section.

(cherry picked from commit 577350603a)
2020-03-02 03:12:31 -08:00
Peter Bergner 6bf890660d Readd ChangeLog entries for
r9-8308-g8fdde048c9e40b9ef4de14612326378d4831ac49^..r9-8311-ga0e22367235f5cd092f9d7800f17081ca4dc79e8

plus add entries for their reversion.
2020-03-02 09:42:43 +01:00
GCC Administrator eaaee438bf Daily bump. 2020-03-02 00:18:23 +00:00
H.J. Lu 4630b748e6 x32: Update baseline_symbols.txt
* config/abi/post/x86_64-linux-gnu/x32/baseline_symbols.txt: Updated.

(cherry picked from commit fed76afb95)
2020-03-01 06:17:03 -08:00
GCC Administrator c799cb1de9 Daily bump. 2020-03-01 00:18:41 +00:00
John David Anglin d00fd3cfc0 Fix/skip various tests for hppa*-*-hpux*.
2020-02-29  John David Anglin  <danglin@gcc.gnu.org>

	* gcc.dg/pr90756.c: Add -fno-common option on hppa*-*-hpux*.
	* gcc.dg/torture/20190327-1.c: Likewise.
	* gcc.dg/torture/pr90020.c: Skip on hppa*-*-hpux*.
2020-02-29 22:39:20 +00:00
Peter Bergner a0e2236723 Revert "Fix bad code of vector extract of PC-relative address with variable element #."
This reverts commit 48558cdf49.
See PR93974.
2020-02-29 16:31:45 -06:00
Peter Bergner c24e196189 Revert "Adjust how variable vector extraction is done."
This reverts commit 428a4feef8.
See PR93974.
2020-02-29 16:31:44 -06:00
Peter Bergner b060b7424f Revert "rs6000: Fix infinite loop building ghostscript and icu [PR93658]"
This reverts commit 066184a282.
See PR93974.
2020-02-29 16:31:44 -06:00
Peter Bergner 8fdde048c9 Revert "rs6000: Fix more testsuite fallout from rs6000_legitimate_address_p() fix. [PR93913]"
This reverts commit 98529e6d74.
See PR93974.
2020-02-29 16:31:44 -06:00
John David Anglin fa8a705d1f Fix libbacktrace build on hppa-hpux.
2020-02-29  John David Anglin  <danglin@gcc.gnu.org>

	Backport from mainline
	2019-09-26  Ian Lance Taylor  <iant@golang.org>

	PR libbacktrace/91908
	* pecoff.c (backtrace_initialize): Explicitly cast unchecked
	__sync_bool_compare_and_swap to void.
	* xcoff.c (backtrace_initialize): Likewise.
2020-02-29 22:25:04 +00:00
John David Anglin c3fed15104 Skip charset.cc tests on *-*-hpux*.
2020-02-29  John David Anglin  <danglin@gcc.gnu.org>

	* testsuite/17_intro/headers/c++1998/charset.cc: Skip on *-*-hpux*.
	* testsuite/17_intro/headers/c++2011/charset.cc: Likewise.
	* testsuite/17_intro/headers/c++2014/charset.cc: Likewise.
	* testsuite/17_intro/headers/c++2017/charset.cc: Likewise.
	* testsuite/17_intro/headers/c++2020/charset.cc: Likewise.
2020-02-29 21:07:08 +00:00
John David Anglin 11d93ca76c Disable gnat.dg/socket1.adb on hppa*-*-hpux*.
2020-02-29  John David Anglin  <danglin@gcc.gnu.org>

	PR ada/91100
	* gnat.dg/socket1.adb: Disable on hppa*-*-hpux*.
2020-02-29 20:39:09 +00:00
GCC Administrator d3a2867484 Daily bump. 2020-02-29 00:18:33 +00:00
Martin Liska 9179ae6a0d Backport 08bf7bde9f
Backport from mainline
	2020-02-28  Martin Liska  <mliska@suse.cz>

	PR other/93965
	* configure.ac: Improve detection of ld_date by requiring
	either two dashes or none.
	* configure: Regenerate.
2020-02-28 18:52:55 +01:00
GCC Administrator 9d8aaf46f0 Daily bump. 2020-02-28 00:19:11 +00:00
Peter Bergner 98529e6d74 rs6000: Fix more testsuite fallout from rs6000_legitimate_address_p() fix. [PR93913]
Backport from trunk
	2020-02-26  Peter Bergner  <bergner@linux.ibm.com>

	PR target/93913
	* gcc.target/powerpc/fold-vec-st-char.c (scan-assembler-times): Allow
	stxv and stxvx instructions as well.
	* gcc.target/powerpc/fold-vec-st-float.c: Likewise.
	* gcc.target/powerpc/fold-vec-st-int.c: Likewise.
	* gcc.target/powerpc/fold-vec-st-short.c: Likewise.
2020-02-27 11:44:53 -06:00
Jakub Jelinek b51057817d gimplify: Don't optimize register const vars to static [PR93949]
The following testcase is rejected, while it was accepted in 3.4 and earlier
(before tree-ssa merge).
The problem is that we decide to promote the const variable to TREE_STATIC,
but TREE_STATIC DECL_REGISTER VAR_DECLs may only be the global register vars
and so assemble_variable/make_decl_rtl diagnoses it.

Either we do what the following patch does, where we could consider
register as a hint the user doesn't want such optimization, because if
something is forced static, it is not "register" anymore and register static
is not valid in C either, or we could clear DECL_REGISTER instead, but would
still need to punt at least on DECL_HARD_REGISTER cases.

2020-02-27  Jakub Jelinek  <jakub@redhat.com>

	PR c/93949
	* gimplify.c (gimplify_init_constructor): Don't promote readonly
	DECL_REGISTER variables to TREE_STATIC.

	* gcc.c-torture/compile/pr93949.c: New test.
2020-02-27 11:23:32 +01:00
Jakub Jelinek a460bf38dc sccvn: Punt on ref->size not multiple of 8 for memset (, 123, ) in 9.x [PR93945]
And here is the corresponding 9.x change where we the patch just punts if
ref->size is not whole bytes, like we already punt if offseti is not byte
aligned.

2020-02-27  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/93945
	* tree-ssa-sccvn.c (vn_reference_lookup_3): For memset with non-zero
	second operand, require ref->size to be a multiple of BITS_PER_UNIT.

	* gcc.c-torture/execute/pr93945.c: New test.
2020-02-27 11:21:52 +01:00
Carl Love 526fadb010 PPC64, fix documentation for __builtin_crypto_vpmsum* builtin functions.
PR target/91276 - Doc typos in __builtin_crypto_vpmsum*

gcc/ChangeLog:

2020-02-26  Carl Love  <cel@us.ibm.com>

	PR target/91276
	* doc/extend.texi (PowerPC AltiVec Built-in Functions available on
	ISA 3.0): The builtin-function name __builtin_crypto_vpmsumb is only
	for the vector unsigned short arguments.  It is also listed as the
	name of the built-in for arguments vector unsigned short,
	vector unsigned int and vector unsigned long long built-ins.  The
	name of the builtins for these arguments should be:
	__builtin_crypto_vpmsumh, __builtin_crypto_vpmsumw and
	__builtin_crypto_vpmsumd respectively.
2020-02-26 18:22:46 -06:00
GCC Administrator 24ed8ed364 Daily bump. 2020-02-27 00:18:33 +00:00
Joseph Myers 096ba1951f Revert "setup branch"
This reverts commit 65e894738f.

Commit appears to have been made on the wrong branch, and breaks
contrib/gcc_update because it checks in a file gcc/REVISION.
2020-02-26 21:08:19 +00:00
Michael Meissner 65e894738f setup branch 2020-02-26 15:56:56 -05:00
Marek Polacek c890c9650f PR c++/92745 - bogus error when initializing array of vectors.
In r268428 I changed reshape_init_r in such a way that when it sees
a nested { } in a CONSTRUCTOR with missing braces, it just returns
the initializer:
+     else if (COMPOUND_LITERAL_P (stripped_init)
...
+         ++d->cur;
+         gcc_assert (!BRACE_ENCLOSED_INITIALIZER_P (stripped_init));
+         return init;

But as this test shows, that's incorrect: if TYPE is an array, we need
to proceed to reshape_init_array_1 which will iterate over the array
initializers:
 6006   /* Loop until there are no more initializers.  */
 6007   for (index = 0;
 6008        d->cur != d->end && (!sized_array_p || index <= max_index_cst);
 6009        ++index)
 6010     {
and update d.cur accordingly.  In other words, when reshape_init gets

{{col[0][0], col[1][0], col[2][0], col[3][0]},
 {col[0][1], col[1][1], col[2][1], col[3][1]},
 {col[0][2], col[1][2], col[2][2], col[3][2]},
 {col[0][3], col[1][3], col[2][3], col[3][3]}}

we recurse on the first element:
  {col[0][0], col[1][0], col[2][0], col[3][0]}
and we can't just move d.cur to point to
  {col[0][1], col[1][1], col[2][1], col[3][1]}
and return; we need to iterate, so that d.cur ends up being properly
updated, and after all initializers have been seen, points to d.end.
Currently we skip the loop, wherefore we hit this:

 6502   /* Make sure all the element of the constructor were used. Otherwise,
 6503      issue an error about exceeding initializers.  */
 6504   if (d.cur != d.end)
 6505     {
 6506       if (complain & tf_error)
 6507         error ("too many initializers for %qT", type);
 6508       return error_mark_node;
 6509     }

gcc/cp/ChangeLog
2019-12-19  Marek Polacek  <polacek@redhat.com>

	PR c++/92745 - bogus error when initializing array of vectors.
	* decl.c (reshape_init_r): For a nested compound literal, do
	call reshape_init_{class,array,vector}.

gcc/testsuite/ChangeLog
2019-12-19  Marek Polacek  <polacek@redhat.com>
	    Jakub Jelinek  <jakub@redhat.com>

	PR c++/92745 - bogus error when initializing array of vectors.
	* g++.dg/cpp0x/initlist118.C: New test.
	* g++.dg/cpp0x/initlist118.C: Add -Wno-psabi -w to dg-options.
2020-02-26 14:09:03 -05:00
Jason Merrill f2f70af7c5 cgraph: A COMDAT decl always has non-zero address.
We should be able to assume that a template instantiation or other COMDAT
has non-zero address even if MAKE_DECL_ONE_ONLY for the target sets
DECL_WEAK and we haven't yet decided to emit a definition in this
translation unit.

gcc/ChangeLog
2020-02-26  Jason Merrill  <jason@redhat.com>

	PR c++/92003
	* symtab.c (symtab_node::nonzero_address): A DECL_COMDAT decl has
	non-zero address even if weak and not yet defined.
2020-02-26 14:09:03 -05:00
Jason Merrill c51ac41714 c++: Fix constexpr vs. omitted aggregate init.
Value-initialization is importantly different from {}-initialization for
this testcase, where the former calls the deleted S constructor and the
latter initializes S happily.

gcc/cp/ChangeLog
2020-02-26  Jason Merrill  <jason@redhat.com>

	PR c++/90951
	* constexpr.c (cxx_eval_array_reference): {}-initialize missing
	elements instead of value-initializing them.
2020-02-26 14:09:03 -05:00
Jason Merrill 1a8996b0a7 c++: Fix decltype of empty pack expansion of parm.
In unevaluated context, we only substitute a single PARM_DECL, not the
entire chain, but the handling of an empty pack expansion was missing that
check.

gcc/cp/ChangeLog
2020-02-26  Jason Merrill  <jason@redhat.com>

	PR c++/93140
	* pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
	handling of TREE_CHAIN for empty pack.
2020-02-26 14:09:03 -05:00
Jason Merrill b6678d67c4 c++: Preserve location in maybe_constant_value.
If cxx_eval_outermost_constant_expr doesn't change the argument, we really
shouldn't unshare it when we try to fold it again.

gcc/cp/ChangeLog
2020-02-26  Jason Merrill  <jason@redhat.com>

	PR c++/92852
	* constexpr.c (maybe_constant_value): Don't unshare if the cached
	value is the same as the argument.
2020-02-26 14:09:02 -05:00
Jonathan Wakely a29236a23c libstdc++: Fix undefined behaviour in random dist serialization (PR93205)
The deserialization functions for random number distributions fail to
check the stream state before using the extracted values. In some cases
this leads to using indeterminate values to resize a vector, and then
filling that vector with indeterminate values.

No values that affect control flow should be used without checking that a
good value was read from the stream.

Additionally, where reasonable to do so, defer modifying any state in
the distribution until all values have been successfully read, to avoid
modifying some of the distribution's parameters and leaving others
unchanged.

Backport from mainline
2020-01-09  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/93205
	* include/bits/random.h (operator>>): Check stream operation succeeds.
	* include/bits/random.tcc: (operator>>): Likewise.
	(__extract_params): New function to fill a vector from a stream.
	* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error line.
2020-02-26 16:31:19 +00:00
Jonathan Wakely 7a7ef79651 libstdc++: Fix description of std::ios::trunc (PR 92886)
Backport from mainline
2019-12-10  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/92886
	* include/bits/ios_base.h (std::ios_base::trunc): Fix comment.
2020-02-26 16:31:19 +00:00
Matheus Castanho 5328027977 rs6000: fixinc: Skip machine_name fix for powerpc*-*-linux*
Some system headers can be broken by the machine_name fix performed
by GCC during the fixincludes step. According to the comment in
fixincludes/fixinc.h:130 :

   On some platforms, machine_name doesn't work properly and
   breaks some of the header files.  Since everything works
   properly without it, just wipe the macro list to
   disable the fix.

So we can just skip it to avoid trouble.

	Backport from trunk
	2020-02-13  Matheus Castanho  <msc@linux.ibm.com>

fixincludes/
	* fixinc.in: Skip machine_name fix on powerpc*-*-linux*.
2020-02-26 15:50:28 +00:00
Jonathan Wakely 08a70a6567 libstdc++: Replace glibc-specific check for clock_gettime (PR 93325)
It's wrong to assume that clock_gettime is unavailable on any *-*-linux*
target that doesn't have glibc 2.17 or later. Use a generic test instead
of using __GLIBC_PREREQ. Only do that test when is_hosted=yes so that we
don't get an error for cross targets without a working linker.

This ensures that C library's clock_gettime will be used on non-glibc
targets, instead of an incorrect syscall to SYS_clock_gettime.

Backport from mainline
2020-01-28  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/93325
	* acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Use AC_SEARCH_LIBS for
	clock_gettime instead of explicit glibc version check.
	* configure: Regenerate.
2020-02-26 15:32:34 +00:00
Jonathan Wakely 30cb4c78ea libstdc++: Fix regressions in unique_ptr::swap (PR 93562)
The requirements for this function are only that the deleter is
swappable, but we incorrectly require that the element type is complete
and that the deleter can be swapped using std::swap (which requires it
to be move cosntructible and move assignable).

The fix is to add __uniq_ptr_impl::swap which swaps the pointer and
deleter individually, instead of using the generic std::swap on the
tuple containing them.

	PR libstdc++/93562
	* include/bits/unique_ptr.h (__uniq_ptr_impl::swap): Define.
	(unique_ptr::swap, unique_ptr<T[], D>::swap): Call it.
	* testsuite/20_util/unique_ptr/modifiers/93562.cc: New test.
2020-02-26 15:04:53 +00:00
Jonathan Wakely 1b522a7913 libstdc++: Fix freestanding build (PR 92376)
In a freestanding library we don't install the <pstl/pstl_config.h>
header, so don't try to include it unless it exists.

Explicitly declare aligned alloc functions for freestanding, because
<cstdlib> doesn't declare them.

Backport from mainline
2020-01-17  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/92376
	* include/bits/c++config: Only do PSTL config when the header is
	present, to fix freestanding.
	* libsupc++/new_opa.cc [!_GLIBCXX_HOSTED]: Declare allocation
	functions if they were detected by configure.
2020-02-26 14:24:06 +00:00
Jonathan Wakely 84a5534ce2 PR libstdc++/78552 only construct std::locale for C locale once
Backport from mainline
2019-10-09  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/78552
	* src/c++98/locale_init.cc (locale::classic()): Do not construct a new
	locale object for every call.
	(locale::_S_initialize_once()): Construct C locale here.
2020-02-26 14:00:07 +00:00
Jiufu Guo 0ce89ea10d rs6000: mark clobber for registers changed by untpyed_call
As PR93047 said, __builtin_apply/__builtin_return does not work well with
-frename-registers.  This is caused by return register(e.g. r3) is used to
rename another register, before return register is stored to stack.
This patch fix this issue by emitting clobber for those egisters which
maybe changed by untyped call.

gcc/
2020-02-26  Jiufu Guo  <guojiufu@linux.ibm.com>

	PR target/93047
	* config/rs6000/rs6000.md (untyped_call): Add emit_clobber.

gcc/testsuite
2020-02-26  Jiufu Guo  <guojiufu@linux.ibm.com>

	PR target/93047
	* gcc.dg/torture/stackalign/builtin-return-2.c: New test case.
2020-02-26 18:13:44 +08:00
Jakub Jelinek d0eff1793d store-merging: Fix coalesce_immediate_stores [PR93820]
The following testcase is miscompiled in 8+.
The problem is that check_no_overlap has a special case for INTEGER_CST
marked stores (i.e. stores of constants), if both all currenly merged stores
and the one under consideration for merging with them are marked that way,
it anticipates that other INTEGER_CST marked stores that overlap with those
and precede those (have smaller info->order) could be merged with those and
doesn't punt for them.
In PR86844 and PR87859 fixes I've then added quite large code that is
performed after check_no_overlap and tries to find out if we need and can
merge further INTEGER_CST marked stores, or need to punt.
Unfortunately, that code is there only in the overlapping case code and
the testcase below shows that we really need it even in the adjacent store
case.  After sort_by_bitpos we have:
bitpos	width	order	rhs_code
96	32	3	INTEGER_CST
128	32	1	INTEGER_CST
128	128	2	INTEGER_CST
192	32	0	MEM_REF
Because of the missing PR86844/PR87859-ish code in the adjacent store
case, we merge the adjacent (memory wise) stores 96/32/3 and 128/32/1,
and then we consider the 128-bit store which is in program-order in between
them, but in this case we punt, because the merging would extend the
merged store region from bitpos 96 and 64-bits to bitpos 96 and 160-bits
and that has an overlap with an incompatible store (the MEM_REF one).
The problem is that we can't really punt this way, because the 128-bit
store is in between those two we've merged already, so either we manage
to merge even that one together with the others, or would need to avoid
already merging the 96/32/3 and 128/32/1 stores together.
Now, rather than copying around the PR86844/PR87859 code to the other spot,
we can actually just use the overlapping code, merge_overlapping is really
a superset of merge_into, so that is what the patch does.  If doing
adjacent store merge for rhs_code other than INTEGER_CST, I believe the
current code is already fine, check_no_overlap in that case doesn't make
the exception and will punt if there is some earlier (smaller order)
non-mergeable overlapping store.  There is just one case that could be
problematic, if the merged_store has BIT_INSERT_EXPRs in them and the
new store is a constant store (INTEGER_CST rhs_code), then check_no_overlap
would do the exception and still would allow the special case.  But we
really shouldn't have the special case in that case, so this patch also
changes check_no_overlap to just have a bool whether we should have the
special case or not.

Note, as I said in the PR, for GCC11 we could consider performing some kind
of cheap DSE during the store merging (perhaps guarded with flag_tree_dse).
And another thing to consider is only consider as problematic non-mergeable
stores that not only have order smaller than last_order as currently, but
also have order larger than first_order, as in this testcase if we actually
ignored (not merged with anything at all) the 192/32/0 store, because it is
not in between the other stores we'd merge, it would be fine to merge the
other 3 stores, though of course the testcase can be easily adjusted by
putting the 192/32 store after the 128/32 store and then this patch would be
still needed.  Though, I think I'd need more time thinking this over.

2020-02-26  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/93820
	* gimple-ssa-store-merging.c (check_no_overlap): Change RHS_CODE
	argument to ALL_INTEGER_CST_P boolean.
	(imm_store_chain_info::try_coalesce_bswap): Adjust caller.
	(imm_store_chain_info::coalesce_immediate_stores): Likewise.  Handle
	adjacent INTEGER_CST store into merged_store->only_constants like
	overlapping one.

	* gcc.dg/pr93820.c: New test.
2020-02-26 09:35:52 +01:00
Jakub Jelinek c6b81c4519 c++: Fix rejects-valid bug in cxx_eval_outermost_constant_expr [PR93905]
Add testcase for a bug that has been just on the 8 branch.

2020-02-26  Jakub Jelinek  <jakub@redhat.com>

	PR c++/93905
	* g++.dg/cpp0x/pr93905.C: New test.
2020-02-26 09:06:15 +01:00
GCC Administrator 45d71b554b Daily bump. 2020-02-26 00:18:29 +00:00
Christophe Lyon 7edf9fa1c5 ARM: Fix -mpure-code for v6m
When running the testsuite with -fdisable-rtl-fwprop2 and -mpure-code
for cortex-m0, I noticed that some testcases were failing because we
still generate "ldr rX, .LCY", which is what we want to avoid with
-mpure-code. This is latent since a recent improvement in fwprop
(PR88833).

In this patch I change the thumb1_movsi_insn pattern so that it emits
the desired instruction sequence when arm_disable_literal_pool is set.

To achieve that, I introduce a new required_for_purecode attribute to
enable the corresponding alternative in thumb1_movsi_insn and take the
actual instruction sequence length into account.

gcc/ChangeLog:

2020-02-25  Christophe Lyon  <christophe.lyon@linaro.org>

	Backport from mainline
	2020-02-25  Christophe Lyon  <christophe.lyon@linaro.org>

	* config/arm/arm.md (required_for_purecode): New attribute.
	(enabled): Handle required_for_purecode.
	* config/arm/thumb1.md (thumb1_movsi_insn): Add alternative to
	work with -mpure-code.
2020-02-25 16:11:46 +00:00
Christophe Lyon 9c5db942ca ARM: Add support for -mpure-code in thumb-1 (v6m)
This patch extends support for -mpure-code to all thumb-1 processors,
by removing the need for MOVT.

Symbol addresses are built using upper8_15, upper0_7, lower8_15 and
lower0_7 relocations, and constants are built using sequences of
movs/adds and lsls instructions.

The extension of the *thumb1_movhf pattern uses always the same size
(6) although it can emit a shorter sequence when possible. This is
similar to what *arm32_movhf already does.

CASE_VECTOR_PC_RELATIVE is now false with -mpure-code, to avoid
generating invalid assembly code with differences from symbols from
two different sections (the difference cannot be computed by the
assembler).

Tests pr45701-[12].c needed a small adjustment to avoid matching
upper8_15 when looking for the r8 register.

Test no-literal-pool.c is augmented with __fp16, so it now uses
-mfp16-format=ieee.

Test thumb1-Os-mult.c generates an inline code sequence with
-mpure-code and computes the multiplication by using a sequence of
add/shift rather than using the multiply instruction, so we skip it in
presence of -mpure-code.

With -mcpu=cortex-m0, the pure-code/no-literal-pool.c fails because
code like:
static char *p = "Hello World";
char *
testchar ()
{
  return p + 4;
}

generates 2 indirections (I removed non-essential directives/code)
          .section        .rodata
	  .LC0:
	  .ascii  "Hello World\000"
	  .data
	  p:
	  .word   .LC0
	  .section        .rodata
	  .LC2:
	  .word   p
	  .section .text,"0x20000006",%progbits
	  testchar:
	  push    {r7, lr}
	  add     r7, sp, #0
	  movs    r3, #:upper8_15:#.LC2
	  lsls    r3, #8
	  adds    r3, #:upper0_7:#.LC2
	  lsls    r3, #8
	  adds    r3, #:lower8_15:#.LC2
	  lsls    r3, #8
	  adds    r3, #:lower0_7:#.LC2
	  ldr     r3, [r3]
	  ldr     r3, [r3]
	  adds    r3, r3, #4
	  movs    r0, r3
	  mov     sp, r7
	  @ sp needed
	  pop     {r7, pc}

By contrast, when using -mcpu=cortex-m4, the code looks like:
        .section        .rodata
	.LC0:
	.ascii  "Hello World\000"
	.data
	p:
	.word   .LC0
	testchar:
	push    {r7}
	add     r7, sp, #0
	movw    r3, #:lower16:p
	movt    r3, #:upper16:p
	ldr     r3, [r3]
	adds    r3, r3, #4
	mov     r0, r3
	mov     sp, r7
	pop     {r7}
	bx      lr

I haven't found yet how to make code for cortex-m0 apply upper/lower
relocations to "p" instead of .LC2. The current code looks functional,
but could be improved.

2020-02-25  Christophe Lyon  <christophe.lyon@linaro.org>

	Backport from mainline
	2019-10-18  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/
	* config/arm/arm-protos.h (thumb1_gen_const_int): Add new prototype.
	* config/arm/arm.c (arm_option_check_internal): Remove restriction
	on MOVT for -mpure-code.
	(thumb1_gen_const_int): New function.
	(thumb1_legitimate_address_p): Support -mpure-code.
	(thumb1_rtx_costs): Likewise.
	(thumb1_size_rtx_costs): Likewise.
	(arm_thumb1_mi_thunk): Likewise.
	* config/arm/arm.h (CASE_VECTOR_PC_RELATIVE): Likewise.
	* config/arm/thumb1.md (thumb1_movsi_symbol_ref): New.
	(*thumb1_movhf): Support -mpure-code.

	gcc/testsuite/
	* gcc.target/arm/pr45701-1.c: Adjust for -mpure-code.
	* gcc.target/arm/pr45701-2.c: Likewise.
	* gcc.target/arm/pure-code/no-literal-pool.c: Add tests for
	__fp16.
	* gcc.target/arm/pure-code/pure-code.exp: Remove thumb2 and movt
	conditions.
	* gcc.target/arm/thumb1-Os-mult.c: Skip if -mpure-code is used.
2020-02-25 16:11:46 +00:00
Jakub Jelinek eeb31391b7 combine: Fix find_split_point handling of constant store into ZERO_EXTRACT [PR93908]
git is miscompiled on s390x-linux with -O2 -march=zEC12 -mtune=z13.
I've managed to reduce it into the following testcase.  The problem is that
during combine we see the s->k = -1; bitfield store and change the SET_SRC
from a pseudo into a constant:
(set (zero_extract:DI (mem/j:HI (plus:DI (reg/v/f:DI 60 [ s ])
                (const_int 10 [0xa])) [0 +0 S2 A16])
        (const_int 2 [0x2])
        (const_int 7 [0x7]))
    (const_int -1 [0xffffffffffffffff]))
This on s390x with the above option isn't recognized as valid instruction,
so find_split_point decides to handle it as IOR or IOR/AND.
src is -1, mask is 3 and pos is 7.
src != mask (this is also incorrect, we want to set all (both) bits in the
bitfield), so we go for IOR/AND, but instead of trying
mem = (mem & ~0x180) | ((-1 << 7) & 0x180)
we actually try
mem = (mem & ~0x180) | (-1 << 7)
and that is further simplified into:
mem = mem | (-1 << 7)
aka
mem = mem | 0xff80
which doesn't set just the 2-bit bitfield, but also many other bitfields
that shouldn't be touched.
We really should do:
mem = mem | 0x180
instead.
The problem is that we assume that no bits but those low len (2 here) will
be set in the SET_SRC, but there is nothing that can prevent that, we just
should ignore the other bits.

The following patch fixes it by masking src with mask, this way already
the src == mask test will DTRT, and as the code for or_mask uses
gen_int_mode, if the most significant bit is set after shifting it left by
pos, it will be properly sign-extended.

2020-02-25  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/93908
	* combine.c (find_split_point): For store into ZERO_EXTRACT, and src
	with mask.

	* gcc.c-torture/execute/pr93908.c: New test.
2020-02-25 14:01:55 +01:00
Eric Botcazou a6b74eaedf Fix link failure with debug info in LTO mode
This fixes a regression whereby the program fails to link with debug
info in LTO mode because of an undefined reference to a symbol coming
from the object files containing the early debug info.

	* dwarf2out.c (dwarf2out_size_function): Run in early-DWARF mode.
2020-02-25 12:44:19 +01:00
Roman Zhuykov 468664e1b7 doc: backport proper description of --enable-checking behavior
This patch rewords the whole description to fix minor issues:
 - documents 'gimple' and 'types' checks,
 - clarifies what happens when option is used without '=list',
 - fixes inaccurate wrong wording about release snapshots,
 - describes that release checks can only be disabled explicitly.

	Backport from master
	2020-02-24  Roman Zhuykov  <zhroma@ispras.ru>

	* doc/install.texi (--enable-checking): Properly document current
	behavior.
	(--enable-stage1-checking): Minor clarification about bootstrap.
2020-02-25 14:32:42 +03:00
GCC Administrator 788483065b Daily bump. 2020-02-25 00:18:29 +00:00
Richard Sandiford f9be6e10c9 vect: Fix offset calculation for -ve strides [PR93767]
This PR is a regression caused by r256644, which added support for alias
checks involving variable strides.  One of the changes in that commit
was to split the access size out of the segment length.  The PR shows
that I hadn't done that correctly for the handling of negative strides
in vect_compile_time_alias.  The old code was:

      const_length_a = (-wi::to_poly_wide (segment_length_a)).force_uhwi ();
      offset_a = (offset_a + vect_get_scalar_dr_size (a)) - const_length_a;

where vect_get_scalar_dr_size (a) was cancelling out the subtraction
of the access size inherent in "- const_length_a".  Taking the access
size out of the segment length meant that the addition was no longer
needed/correct.

2020-02-24  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	Backport from mainline
	2020-02-19  Richard Sandiford  <richard.sandiford@arm.com>

	PR tree-optimization/93767
	* tree-vect-data-refs.c (vect_compile_time_alias): Remove the
	access-size bias from the offset calculations for negative strides.

gcc/testsuite/
	Backport from mainline
	2020-02-19  Richard Sandiford  <richard.sandiford@arm.com>

	PR tree-optimization/93767
	* gcc.dg/vect/pr93767.c: New test.
2020-02-24 21:24:11 +00:00
Mark Eggleston ba74009251 fortran: ICE using SHAPE with FINDLOC PR93835
Backported from mainline
	2020-02-24  Mark Eggleston  <markeggleston@gcc.gnu.org>

	PR fortran/93835
	* simplify.c (simplify_findloc_nodim) : Fix whitespace issues.
	(gfc_simplify_shape) : Create and initialise one shape value
	for the result expression. Set shape value with the rank of
	the source array.

	PR fortran/93835
	* gfortran.dg/pr77351.f90 : Check for one error instead of two.
	* gfortran.dg/pr93835.f08 : New test.
2020-02-24 15:53:24 +00:00
Bernd Edlinger 8389fcc4c1 Avoid collect2 calling signal unsafe functions and/or unlink with uninitialized memory
2020-02-24  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* collect2.c (tool_cleanup): Avoid calling not signal-safe
	functions.
	(maybe_run_lto_and_relink): Avoid possible signal handler
	access to unintialzed memory (lto_o_files).
2020-02-24 14:43:06 +01:00
Peter Bergner 066184a282 rs6000: Fix infinite loop building ghostscript and icu [PR93658]
Fix rs6000_legitimate_address_p(), which erroneously marks a valid Altivec
address as being invalid, which causes LRA's process_address()  to go into
an infinite loop spilling the same address over and over again.
Include Mike's earlier commits that fix bugs this patch exposes.

	Backport from master
	2020-02-20  Peter Bergner  <bergner@linux.ibm.com>

	PR target/93658
	* config/rs6000/rs6000.c (rs6000_legitimate_address_p): Handle VSX
	vector modes.

	* gcc.target/powerpc/pr93658.c: New test.
2020-02-23 18:31:56 -06:00
Michael Meissner 428a4feef8 Adjust how variable vector extraction is done.
Backport from master
	2020-02-03  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/rs6000.c (get_vector_offset): New helper function
	to calculate the offset in memory from the start of a vector of a
	particular element.  Add code to keep the element number in
	bounds if the element number is variable.
	(rs6000_adjust_vec_address): Move calculation of offset of the
	vector element to get_vector_offset.
	(rs6000_split_vec_extract_var): Do not do the initial AND of
	element here, move the code to get_vector_offset.

Fix PR 93568 (thinko)

	Backport from master
	2020-02-05  Michael Meissner  <meissner@linux.ibm.com>

	PR target/93568
	* config/rs6000/rs6000.c (get_vector_offset): Fix Q constraint assert
	to use MEM.
2020-02-23 18:31:56 -06:00
Michael Meissner 48558cdf49 Fix bad code of vector extract of PC-relative address with variable element #.
Backport from master
	2020-01-06  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/vsx.md (vsx_extract_<mode>_var, VSX_D iterator):
	Use 'Q' for doing vector extract from memory.
	(vsx_extract_v4sf_var): Use 'Q' for doing vector extract from
	memory.
	(vsx_extract_<mode>_var, VSX_EXTRACT_I iterator): Use 'Q' for
	doing vector extract from memory.
	(vsx_extract_<mode>_<VS_scalar>mode_var): Use 'Q' for doing vector
	extract from memory.
2020-02-23 18:31:56 -06:00
GCC Administrator 9f2a74ab43 Daily bump. 2020-02-24 00:18:31 +00:00
GCC Administrator 6900c1ec9a Daily bump. 2020-02-23 00:18:39 +00:00
Thomas König c080a6fb6f Use au->lock exclusively for locking in async I/O.
2020-02-18  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/93599
	* io/async.c (destroy_adv_cond): Do not destroy lock.
	(async_io): Make sure au->lock is locked for finishing of thread.
	Do not lock/unlock around signalling emptysignal. Unlock au->lock
	before return.
	(init_adv_cond): Do not initialize lock.
	(enqueue_transfer): Unlock after signal.
	(enqueue_done_id): Likewise.
	(enqueue_done): Likewise.
	(enqueue_close): Likewise.
	(enqueue_data_transfer): Likewise.
	(async_wait_id): Do not lock/unlock around signalling au->work.
	(async_wait): Unlock after signal.
	* io/async.h (SIGNAL): Add comment about needed au->lock.
	Remove locking/unlocking of advcond->lock.
	(WAIT_SIGNAL_MUTEX): Add comment. Remove locking/unlocking of
	advcond->lock.  Unlock mutex only at the end.  Loop on
	__ghread_cond_wait returning zero.
	(REVOKE_SIGNAL): Add comment. Remove locking/unlocking of
	advcond->lock.
	(struct adv_cond): Remove mutex from struct.
2020-02-22 12:31:18 +01:00
GCC Administrator 3004aba7a0 Daily bump. 2020-02-22 00:18:28 +00:00
John David Anglin 4ccda0308e Fix handling of floating-point homogeneous aggregates.
2020-02-21  John David Anglin  <danglin@gcc.gnu.org>

	* gcc/config/pa/pa.c (pa_function_value): Fix check for word and
	double-word size when handling aggregate return values.
	* gcc/config/pa/som.h (ASM_DECLARE_FUNCTION_NAME): Fix to indicate
	that homogeneous SFmode and DFmode aggregates are passed and returned
	in general registers.
2020-02-21 23:34:09 +00:00
GCC Administrator 8b3c0979ea Daily bump. 2020-02-21 00:18:50 +00:00
Uros Bizjak bd2537ed5d i386: Fix *vec_extractv2sf_1 and *vec_extractv2sf_1 shufps alternative [PR93828]
shufps moves two of the four packed single-precision floating-point values
from *destination* operand (first operand) into the low quadword of the
destination operand.  Match source operand to the destination.

	PR target/93828
	* config/i386/mmx.md (*vec_extractv2sf_1): Match source operand
	to destination operand for shufps alternative.
	(*vec_extractv2si_1): Ditto.
2020-02-20 21:58:57 +01:00
H.J. Lu f55bf4ddbf i386: Skip ENDBR32 at the target function entry
Skip ENDBR32 at the target function entry when initializing trampoline.

Tested on Linux/x86-64 CET machine with and without -m32.

gcc/

	Backport from master
	PR target/93656
	* config/i386/i386.c (ix86_trampoline_init): Skip ENDBR32 at
	the target function entry.

gcc/testsuite/

	Backport from master
	PR target/93656
	* gcc.target/i386/pr93656.c: New test.

(cherry picked from commit 1d69147af2)
2020-02-20 03:05:27 -08:00
GCC Administrator 2ee6afc2b4 Daily bump. 2020-02-20 00:19:06 +00:00
Mark Eggleston 00244172f8 [fortran] xfail no longer necessary in typebound_call_22.f03
PR91984 changes resulted in an expected failure. Backport of PR92113
negated the need for the xfail.

gcc/testsuite/ChangeLog

	* typebound_call_22.d03 : Remove xfail clause.
2020-02-19 16:19:54 +00:00
Mark Eggleston 44ea6508f1 [Fortran] ICE assign character pointer to non target PR93714
An ICE occurred if an attempt was made to assign a pointer to a
character variable that has an length incorrectly specified using
a real constant and does not have the target attribute.

	Backported from mainline
	2020-02-18  Mark Eggleston  <markeggleston@gcc.gnu.org>

	PR fortran/93714
	* expr.c (gfc_check_pointer_assign): Move check for
	matching character length to after checking the lvalue
	attributes for target or pointer.

	PR fortran/93714
	* gfortran.dg/char_pointer_assign_6.f90: Look for no target
	message instead of length mismatch.
	* gfortran.dg/pr93714_1.f90
	* gfortran.dg/pr93714_2.f90
2020-02-19 09:36:42 +00:00
liuhongt fa463e6f42 Add -mavx512vbmi2 to i386-2.C and i386-3.C
2020-02-18  Hongtao Liu  <hongtao.liu@intel.com>

gcc/testsuite/
	* g++.dg/other/i386-2.C: Add -mavx512vbmi2.
	* g++.dg/other/i386-3.C: Ditto.
2020-02-19 10:13:29 +08:00
GCC Administrator 9f2bbf581e Daily bump. 2020-02-19 00:18:36 +00:00
Richard Sandiford 2408b93a10 Check for bitwise identity when encoding VECTOR_CSTs [PR92768]
This PR shows that we weren't checking for bitwise-identical values
when trying to encode a VECTOR_CST, so -0.0 was treated the same as
0.0 for -fno-signed-zeros.  The patch adds a new OEP flag to select
that behaviour.

2020-02-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	Backport from mainline
	2019-12-05  Richard Sandiford  <richard.sandiford@arm.com>

	PR middle-end/92768
	* tree-core.h (OEP_BITWISE): New flag.
	* fold-const.c (operand_compare::operand_equal_p): Handle it.
	* tree-vector-builder.h (tree_vector_builder::equal_p): Pass it.

gcc/testsuite/
	PR middle-end/92768
	* gcc.dg/pr92768.c: New test.
2020-02-18 12:26:03 +00:00
Richard Sandiford 52db14c1f7 Reject tail calls that read from an escaped RESULT_DECL [PR90313]
In this PR we have two return paths from a function "map".  The common
code sets <result> to the value returned by one path, while the other
path does:

   <retval> = map (&<retval>, ...);

We treated this call as tail recursion, losing the copy semantics
on the value returned by the recursive call.

We'd correctly reject the same thing for variables:

   local = map (&local, ...);

The problem is that RESULT_DECLs didn't get the same treatment.

2020-02-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	Backport from mainline
	2019-08-09  Richard Sandiford  <richard.sandiford@arm.com>

	PR middle-end/90313
	* tree-tailcall.c (find_tail_calls): Reject calls that might
	read from an escaped RESULT_DECL.

gcc/testsuite/
	PR middle-end/90313
	* g++.dg/torture/pr90313.cc: New test.
2020-02-18 12:26:02 +00:00
Mark Eggleston 5601394812 [fortran] ICE in gfc_validate_kind(): Got bad kind [PR93580]
Caused by using invalid part_refs in kind specifications,
e.g. %re or %im on non-complex expressions and %len on
non character expressions.

Check whether %re, %im and %len are valid when checking
kind specification.

The original patch from Steven G. Kargl  <kargl@gcc.gnu.org> only
checked for %re and %im.

	Backported from mainline
	2020-02-18  Mark Eggleston <markeggleston@gcc.gnu.org>

	PR fortran/93580
	* primary.c (gfc_match_varspec): If the symbol following %
	is re or im and the primary expression type is not BT_COMPLEX
	issue an error. If the symbol is len and the primary
	expression type is not BT_CHARACTER is an error.

	PR fortran/93580
	* gfortran.dg/dg/pr93580.f90: New test.
2020-02-18 10:56:38 +00:00
Richard Sandiford e129cd5283 predcom: Fix invalid store-store commoning [PR93434]
predcom has the following code to stop one rogue load from
interfering with other store-load opportunities:

      /* If A is read and B write or vice versa and there is unsuitable
	 dependence, instead of merging both components into a component
	 that will certainly not pass suitable_component_p, just put the
	 read into bad component, perhaps at least the write together with
	 all the other data refs in it's component will be optimizable.  */

But when store-store commoning was added later, this had the effect
of ignoring loads that occur between two candidate stores.

There is code further up to handle loads and stores with unknown
dependences:

      /* Don't do store elimination if there is any unknown dependence for
	 any store data reference.  */
      if ((DR_IS_WRITE (dra) || DR_IS_WRITE (drb))
	  && (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know
	      || DDR_NUM_DIST_VECTS (ddr) == 0))
	eliminate_store_p = false;

But the store-load code above skips loads for *known* dependences
if (a) the load has already been marked "bad" or (b) the data-ref
machinery knows the dependence distance, but determine_offsets
can't handle the combination.

(a) happens to be the problem in the testcase, but a different
sequence could have given (b) instead.  We have writes to individual
fields of a structure and reads from the whole structure.  Since
determine_offsets requires the types to be the same, it returns false
for each such read/write combination.

This patch records which components have had loads removed and
prevents store-store commoning for them.  It's a bit too pessimistic,
since there shouldn't be a problem if a "bad" load dominates all stores
in a component.  But (a) we can't AFAIK use pcom_stmt_dominates_stmt_p
here and (b) the handling for that case would probably need to be
removed again if we handled more exotic cases in future.

2020-02-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	Backport from mainline
	2020-01-28  Richard Sandiford  <richard.sandiford@arm.com>

	PR tree-optimization/93434
	* tree-predcom.c (split_data_refs_to_components): Record which
	components have had aliasing loads removed.  Prevent store-store
	commoning for all such components.

gcc/testsuite/
	PR tree-optimization/93434
	* gcc.c-torture/execute/pr93434.c: New test.
2020-02-18 08:52:01 +00:00
Richard Sandiford 84a4651717 Don't pass booleans as mask types to simd clones [PR92710]
In this PR we assigned a vector mask type to the result of a comparison
and then tried to pass that mask type to a simd clone, which expected
a normal (non-mask) type instead.

This patch simply punts on call arguments that have a mask type.
A better fix would be to pattern-match the comparison to a COND_EXPR,
like we would if the comparison was stored to memory, but doing that
isn't gcc 9 or 10 material.

Note that this doesn't affect x86_64-linux-gnu because the ABI promotes
bool arguments to ints.

2020-02-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	Backport from mainline
	2019-11-29  Richard Sandiford  <richard.sandiford@arm.com>

	PR tree-optimization/92710
	* tree-vect-stmts.c (vectorizable_simd_clone_call): Reject
	vector mask arguments.

gcc/testsuite/
	PR tree-optimization/92710
	* gcc.dg/vect/pr92710.c: New test.
2020-02-18 08:52:00 +00:00
Richard Sandiford 2d8ea3a0a6 Fix SLP downward group access classification [PR92420]
This PR was caused by the SLP handling in get_group_load_store_type
returning VMAT_CONTIGUOUS rather than VMAT_CONTIGUOUS_REVERSE for
downward groups.

A more elaborate fix would be to try to combine the reverse permutation
into SLP_TREE_LOAD_PERMUTATION for loads, but that's really a follow-on
optimisation and not backport material.  It might also not necessarily
be a win, if the target supports (say) reversing and odd/even swaps
as independent permutes but doesn't recognise the combined form.

2020-02-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	Backport from mainline
	2019-11-11  Richard Sandiford  <richard.sandiford@arm.com>

	PR tree-optimization/92420
	* tree-vect-stmts.c (get_negative_load_store_type): Move further
	up file.
	(get_group_load_store_type): Use it for reversed SLP accesses.

gcc/testsuite/
	PR tree-optimization/92420
	* gcc.dg/vect/pr92420.c: New test.
2020-02-18 08:51:59 +00:00
Prathamesh Kulkarni 65709f4b93 re PR target/90724 (ICE with __sync_bool_compare_and_swap with -march=armv8.2-a+sve)
2020-02-18  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	Backport from mainline
	2019-08-21  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	PR target/90724
	* config/aarch64/aarch64.c (aarch64_gen_compare_reg_maybe_ze): Force y
	in reg if it fails aarch64_plus_operand predicate.
2020-02-18 08:51:58 +00:00
GCC Administrator e28336b595 Daily bump. 2020-02-18 00:18:43 +00:00
liuhongt 0692bc0ca7 Add Changelog entries to relavent Changelog files for my last commit. 2020-02-17 08:55:17 +08:00
GCC Administrator a63e65cd14 Daily bump. 2020-02-17 00:18:48 +00:00
Uros Bizjak bfa537a2ff i386: Fix atan2l argument order [PR93743]
PR target/93743
	* config/i386/i386.md (atan2xf3): Swap operands 1 and 2.
	(atan2<mode>3): Update operand order in the call to gen_atan2xf3.

testsuite/ChangeLog:

	PR target/93743
	* gcc.target/i386/pr93743.c : New test.
2020-02-16 23:43:22 +01:00
GCC Administrator 1e85e18ab7 Daily bump. 2020-02-16 00:18:33 +00:00
Jakub Jelinek 4980553313 match.pd: Disallow side-effects in GENERIC for non-COND_EXPR to COND_EXPR simplifications [PR93744]
As the following testcases show (the first one reported, last two
found by code inspection), we need to disallow side-effects
in simplifications that turn some unconditional expression into conditional
one.  From my little understanding of genmatch.c, it is able to
automatically disallow side effects if the same operand is used multiple
times in the match pattern, maybe if it is used multiple times in the
replacement pattern, and if it is used in conditional contexts in the match
pattern, could it be taught to handle this case too?  If yes, perhaps
just the first hunk could be usable for 8/9 backports (+ the testcases).

2020-02-15  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/93744
	* match.pd (((m1 >/</>=/<= m2) * d -> (m1 >/</>=/<= m2) ? d : 0,
	A - ((A - B) & -(C cmp D)) -> (C cmp D) ? B : A,
	A + ((B - A) & -(C cmp D)) -> (C cmp D) ? B : A): For GENERIC, make
	sure @2 in the first and @1 in the other patterns has no side-effects.

	* gcc.c-torture/execute/pr93744-1.c: New test.
	* gcc.c-torture/execute/pr93744-2.c: New test.
	* gcc.c-torture/execute/pr93744-3.c: New test.
2020-02-15 13:22:10 +01:00
GCC Administrator 2d625a6d4b Daily bump. 2020-02-15 00:19:32 +00:00
Eric Botcazou c1379a1c64 Fix problematic TLS sequences for the Solaris linker
This is an old thinko pertaining to the interaction between TLS
sequences and delay slot filling: the compiler knows that it cannot
put instructions with TLS relocations into delay slots with the
original Sun TLS model, but it tests TARGET_SUN_TLS in this context,
which depends only on the assembler.  So if the compiler is configured
with the GNU assembler and the Solaris linker, then TARGET_GNU_TLS is
set instead and the limitation is not enforced.

	PR target/93704
	* config/sparc/sparc.c (eligible_for_call_delay): Test HAVE_GNU_LD
	in conjunction with TARGET_GNU_TLS in early return.
2020-02-14 19:26:46 +01:00
Jakub Jelinek f0a72494ea c++: Fix thinko in enum_min_precision [PR61414]
When backporting the PR61414 fix to 8.4, I've noticed that the caching
of prec is actually broken, as it would fail to actually store the computed
precision into the hash_map's value and so next time we'd think the enum needs
0 bits.

2020-02-14  Jakub Jelinek  <jakub@redhat.com>

	PR c++/61414
	* class.c (enum_min_precision): Change prec type from int to int &.

	* g++.dg/cpp0x/enum39.C: New test.
2020-02-14 17:41:42 +01:00
Alexander Monakov 0f7b7aeb71 sel-sched: allow negative insn priority (PR 88879)
PR rtl-optimization/88879
	* sel-sched.c (sel_target_adjust_priority): Remove assert.
2020-02-14 16:55:27 +03:00
Richard Biener b8c42b4d0a middle-end/90648 fend off builtin calls with not enough arguments from match
This adds guards to genmatch generated code before accessing call
expression or stmt arguments that might be out of bounds when
the user provided bogus prototypes for what we consider builtins.

2020-02-05  Richard Biener  <rguenther@suse.de>

	PR middle-end/90648
	* genmatch.c (dt_node::gen_kids_1): Emit number of argument
	checks before matching calls.

	* gcc.dg/pr90648.c: New testcase.
2020-02-14 14:35:26 +01:00
Richard Biener b00c322804 tree-optimization/93381 fix integer offsetting in points-to analysis
We were incorrectly assuming a merge operation is conservative enough
for not explicitely handled operations but we also need to consider
offsetting within fields when field-sensitive analysis applies.

2020-01-22  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/93381
	* tree-ssa-structalias.c (find_func_aliases): Assume offsetting
	throughout, handle all conversions the same.

	* gcc.dg/torture/pr93381.c: New testcase.
2020-02-14 11:50:15 +01:00
Richard Biener 03d2b1d797 tree-optimization/93439 move clique bookkeeping to OMP expansion
Autopar was doing clique bookkeeping too early when creating destination
functions but then later introducing new cliques via versioning loops.
The following moves the bookkeeping to the actual outlining process.

2020-02-14  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2020-01-28  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/93439
	* tree-parloops.c (create_loop_fn): Move clique bookkeeping...
	* tree-cfg.c (move_sese_region_to_fn): ... here.
	(verify_types_in_gimple_reference): Verify used cliques are
	tracked.

	* gfortran.dg/graphite/pr93439.f90: New testcase.
2020-02-14 11:01:50 +01:00
Richard Biener 3bcda566d6 middle-end/93054 deal with undefs in call gimplification
2020-02-14  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2020-01-09  Richard Biener  <rguenther@suse.de>

	PR middle-end/93054
	* gimplify.c (gimplify_expr): Deal with NOP definitions.

	* gcc.dg/pr93054.c: New testcase.
2020-02-14 11:01:50 +01:00
Richard Biener 794bb8c2f5 debug/92763 keep DIEs that might be used in DW_TAG_inlined_subroutine
We were pruning type-local subroutine DIEs if their context is unused
despite us later needing those DIEs as abstract origins for inlines.
The patch makes code already present for -fvar-tracking-assignments
unconditional.

2020-02-14  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2020-01-20  Richard Biener  <rguenther@suse.de>

	PR debug/92763
	* dwarf2out.c (prune_unused_types): Unconditionally mark
	called function DIEs.

	* g++.dg/debug/pr92763.C: New testcase.
2020-02-14 11:01:50 +01:00
Richard Biener 4230afc0f4 tree-optimization/92704 fix ifcvt ICE with loops without stores
2020-02-14  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-11-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92704
	* tree-if-conv.c (combine_blocks): Deal with virtual PHIs
	in loops performing only loads.

	* gcc.dg/torture/pr92704.c: New testcase.
2020-02-14 11:01:49 +01:00
Richard Biener c6480e01fc middle-end/92674 delay purging EH edges when folding during inlining
2020-02-14  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-11-27  Richard Biener  <rguenther@suse.de>

	PR middle-end/92674
	* tree-inline.c (expand_call_inline): Delay purging EH/abnormal
	edges and instead record blocks in bitmap.
	(gimple_expand_calls_inline): Adjust.
	(fold_marked_statements): Delay EH cleanup until all folding is
	done.
	(optimize_inline_calls): Do EH/abnormal cleanup for calls after
	inlining finished.
2020-02-14 11:01:49 +01:00
liuhongt d7ab361df6 Intrinsic macro of vpshr* and vpshl* lack a closing parenthesis which would cause failure in O0.
2020-02-14 Hongtao Liu  <hongtao.liu@intel.com>

gcc/
	PR target/93724
	* config/i386/avx512vbmi2intrin.h
	(_mm512_shrdi_epi16, _mm512_mask_shrdi_epi16,
	_mm512_maskz_shrdi_epi16, _mm512_shrdi_epi32,
	_mm512_mask_shrdi_epi32, _mm512_maskz_shrdi_epi32,
	_m512_shrdi_epi64, _m512_mask_shrdi_epi64,
	_m512_maskz_shrdi_epi64, _mm512_shldi_epi16,
	_mm512_mask_shldi_epi16, _mm512_maskz_shldi_epi16,
	_mm512_shldi_epi32, _mm512_mask_shldi_epi32,
	_mm512_maskz_shldi_epi32, _mm512_shldi_epi64,
	_mm512_mask_shldi_epi64, _mm512_maskz_shldi_epi64): Fix typo
	of lacking a closing parenthesis.
	* config/i386/avx512vbmi2vlintrin.h
	(_mm256_shrdi_epi16, _mm256_mask_shrdi_epi16,
	_mm256_maskz_shrdi_epi16, _mm256_shrdi_epi32,
	_mm256_mask_shrdi_epi32, _mm256_maskz_shrdi_epi32,
	_m256_shrdi_epi64, _m256_mask_shrdi_epi64,
	_m256_maskz_shrdi_epi64, _mm256_shldi_epi16,
	_mm256_mask_shldi_epi16, _mm256_maskz_shldi_epi16,
	_mm256_shldi_epi32, _mm256_mask_shldi_epi32,
	_mm256_maskz_shldi_epi32, _mm256_shldi_epi64,
	_mm256_mask_shldi_epi64, _mm256_maskz_shldi_epi64,
	_mm_shrdi_epi16, _mm_mask_shrdi_epi16,
	_mm_maskz_shrdi_epi16, _mm_shrdi_epi32,
	_mm_mask_shrdi_epi32, _mm_maskz_shrdi_epi32,
	_mm_shrdi_epi64, _mm_mask_shrdi_epi64,
	_m_maskz_shrdi_epi64, _mm_shldi_epi16,
	_mm_mask_shldi_epi16, _mm_maskz_shldi_epi16,
	_mm_shldi_epi32, _mm_mask_shldi_epi32,
	_mm_maskz_shldi_epi32, _mm_shldi_epi64,
	_mm_mask_shldi_epi64, _mm_maskz_shldi_epi64): Ditto.

gcc/testsuite/
	* gcc.target/i386/avx512vbmi2-vpshld-1.c: New test.
	* gcc.target/i386/avx512vbmi2-vpshrd-1.c: Ditto.
	* gcc.target/i386/sse-12.c: Add -mavx512vbmi2.
	* gcc.target/i386/sse-13.c: Ditto.
	* gcc.target/i386/sse-14.c: Add -mavx512vbmi2 and tests.
	* gcc.target/i386/sse-22.c: Ditto.
2020-02-14 17:09:44 +08:00
GCC Administrator 7866f9ebf1 Daily bump. 2020-02-14 00:18:35 +00:00
Jakub Jelinek 7276dd4c74 c: Fix ICE with cast to VLA [93576]
The following testcase ICEs, because the PR84305 changes try to evaluate
the size earlier.  If size has side-effects, that is desirable, and the
side-effects will actually be wrapped in a SAVE_EXPR.  The problem on this
testcase is that there are no side-effects, and c_fully_fold doesn't fold
those COMPOUND_EXPRs to constant, and while before gimplification we unshare
trees found in the expressions, the unsharing doesn't involve TYPE_SIZE etc.
of used types.  Gimplification is destructive though, so when we gimplify
the two nested COMPOUND_EXPRs and then try to gimplify it the second time
for the TYPE_SIZEs, we ICE.
Now, we could use unshare_expr in what we push to *expr, SAVE_EXPRs and
their operands in there aren't unshared, but I really don't see a point of
evaluating expressions that don't have side-effects before, so instead
this just pushes there expressions that do have side-effects.

2020-02-13  Jakub Jelinek  <jakub@redhat.com>

	PR c/93576
	* c-decl.c (grokdeclarator): If this_size_varies, only push size into
	*expr if it has side effects.

	* gcc.dg/pr93576.c: New test.
2020-02-13 21:50:45 +01:00
Jakub Jelinek 08cf145f99 i386: Fix up _mm*_mask_popcnt_epi* [PR93696]
As mentioned in the PR and as
https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mask_popcnt_epi
also documents, _mm*_popcnt_epi* intrinsics are consistent with all other
unary AVX512* intrinsics regarding arguments, i.e. the
_mm*_whatever has just single argument (called a in the docs, and __A in the
GCC headers),
_mm*_mask_whatever has 3 arguments (called src, k, a in the docs and
_W, __U, __A in GCC headers) and
_mm*_maskz_whatever 2 arguments (called k, a in the docs and __U, __A in GCC
headers).  Unfortunately, whomever implemented the _mm*_popcnt_epi*
intrinsics got it wrong for the _mm*_mask_popcnt_epi* ones, calling the
args __A, __U, __B and not passing them in the canonical order to the
builtins, making it API incompatible with ICC as well as clang (tested on
godbolts clang 7/8/9/trunk and ICC 19.0.{0,1}, older clang/ICC don't
understand those, so it isn't that it used to be broken even in other
compilers and got changed afterwards).

2020-02-13  Jakub Jelinek  <jakub@redhat.com>

	PR target/93696
	* config/i386/avx512bitalgintrin.h (_mm512_mask_popcnt_epi8,
	_mm512_mask_popcnt_epi16, _mm256_mask_popcnt_epi8,
	_mm256_mask_popcnt_epi16, _mm_mask_popcnt_epi8,
	_mm_mask_popcnt_epi16): Rename __B argument to __A and __A to __W,
	pass __A to the builtin followed by __W instead of __A followed by
	__B.
	* config/i386/avx512vpopcntdqintrin.h (_mm512_mask_popcnt_epi32,
	_mm512_mask_popcnt_epi64): Likewise.
	* config/i386/avx512vpopcntdqvlintrin.h (_mm_mask_popcnt_epi32,
	_mm256_mask_popcnt_epi32, _mm_mask_popcnt_epi64,
	_mm256_mask_popcnt_epi64): Likewise.

	* gcc.target/i386/pr93696-1.c: New test.
	* gcc.target/i386/pr93696-2.c: New test.
	* gcc.target/i386/avx512bitalg-vpopcntw-1.c (TEST): Fix argument order
	of _mm*_mask_popcnt_*.
	* gcc.target/i386/avx512vpopcntdq-vpopcntq-1.c (TEST): Likewise.
	* gcc.target/i386/avx512vpopcntdq-vpopcntd-1.c (TEST): Likewise.
	* gcc.target/i386/avx512bitalg-vpopcntb-1.c (TEST): Likewise.
	* gcc.target/i386/avx512bitalg-vpopcntb.c (foo): Likewise.
	* gcc.target/i386/avx512bitalg-vpopcntbvl.c (foo): Likewise.
	* gcc.target/i386/avx512vpopcntdq-vpopcntd.c (foo): Likewise.
	* gcc.target/i386/avx512bitalg-vpopcntwvl.c (foo): Likewise.
	* gcc.target/i386/avx512bitalg-vpopcntw.c (foo): Likewise.
	* gcc.target/i386/avx512vpopcntdq-vpopcntq.c (foo): Likewise.
2020-02-13 21:50:15 +01:00
Jakub Jelinek 488a947b2d i386: Fix k*shift* intrinsics [PR93673]
As mentioned in the PR, the intrinsics allow counts from 0 to 255, but
we actually reject values from 128 to 255.  That is because QImode
CONST_INTs can be only -128 to 127.  Fixed by using const_0_to_255_operand
and dropping the modes for the operands with those predicates
(the IL actually contains the CONST_INT which has VOIDmode).

2020-02-13  Jakub Jelinek  <jakub@redhat.com>

	PR target/93673
	* config/i386/sse.md (k<code><mode>): Drop mode from last operand and
	use const_0_to_255_operand predicate instead of immediate_operand.
	(avx512dq_fpclass<mode><mask_scalar_merge_name>,
	avx512dq_vmfpclass<mode><mask_scalar_merge_name>,
	vgf2p8affineinvqb_<mode><mask_name>,
	vgf2p8affineqb_<mode><mask_name>): Drop mode from
	const_0_to_255_operand predicated operands.

	* gcc.target/i386/avx512f-pr93673.c: New test.
	* gcc.target/i386/avx512dq-pr93673.c: New test.
	* gcc.target/i386/avx512bw-pr93673.c: New test.
2020-02-13 21:49:35 +01:00
Jakub Jelinek 20ac13c895 i386: Fix up vec_extract_lo* patterns [PR93670]
The VEXTRACT* insns have way too many different CPUID feature flags (ATT
syntax)
vextractf128 $imm, %ymm, %xmm/mem		AVX
vextracti128 $imm, %ymm, %xmm/mem		AVX2
vextract{f,i}32x4 $imm, %ymm, %xmm/mem {k}{z}	AVX512VL+AVX512F
vextract{f,i}32x4 $imm, %zmm, %xmm/mem {k}{z}	AVX512F
vextract{f,i}64x2 $imm, %ymm, %xmm/mem {k}{z}	AVX512VL+AVX512DQ
vextract{f,i}64x2 $imm, %zmm, %xmm/mem {k}{z}	AVX512DQ
vextract{f,i}32x8 $imm, %zmm, %ymm/mem {k}{z}	AVX512DQ
vextract{f,i}64x4 $imm, %zmm, %ymm/mem {k}{z}	AVX512F

As the testcase shows and the patch too, we didn't get it right in all
cases.

The first hunk is about avx512vl_vextractf128v8s[if] incorrectly
requiring TARGET_AVX512DQ.  The corresponding insn is the first
vextract{f,i}32x4 above, so it requires VL+F, and the builtins have it
correct (TARGET_AVX512VL implies TARGET_AVX512F):
BDESC (OPTION_MASK_ISA_AVX512VL, 0, CODE_FOR_avx512vl_vextractf128v8sf, "__builtin_ia32_extractf32x4_256_mask", IX86_BUILTIN_EXTRACTF32X4_256, UNKNOWN, (int) V4SF_FTYPE_V8SF_INT_V4SF_UQI)
BDESC (OPTION_MASK_ISA_AVX512VL, 0, CODE_FOR_avx512vl_vextractf128v8si, "__builtin_ia32_extracti32x4_256_mask", IX86_BUILTIN_EXTRACTI32X4_256, UNKNOWN, (int) V4SI_FTYPE_V8SI_INT_V4SI_UQI)
We only need TARGET_AVX512DQ for avx512vl_vextractf128v4d[if].

The second hunk is about vec_extract_lo_v16s[if]{,_mask}.  These are using
the vextract{f,i}32x8 insns (AVX512DQ above), but we weren't requiring that,
but instead incorrectly && 1 for non-masked and && (64 == 64 && TARGET_AVX512VL)
for masked insns.  This is extraction from ZMM, so it doesn't need VL for
anything.  The hunk actually only requires TARGET_AVX512DQ when the insn
is masked, if it is not masked, when TARGET_AVX512DQ isn't available we can
use vextract{f,i}64x4 instead which is available already in TARGET_AVX512F
and does the same thing, extracts the low 256 bits from 512 bits vector
(often we split it into just nothing, but there are some special cases like
when using xmm16+ when we can't without AVX512VL).

The last hunk is about vec_extract_lo_v8s[if]{,_mask}.  The non-_mask
suffixed ones are ok already and just split into nothing (lowpart subreg).
The masked ones were incorrectly requiring TARGET_AVX512VL and
TARGET_AVX512DQ, when we only need TARGET_AVX512VL.

2020-02-12  Jakub Jelinek  <jakub@redhat.com>

	PR target/93670
	* config/i386/sse.md (VI48F_256_DQ): New mode iterator.
	(avx512vl_vextractf128<mode>): Use it instead of VI48F_256.  Remove
	TARGET_AVX512DQ from condition.
	(vec_extract_lo_<mode><mask_name>): Use <mask_avx512dq_condition>
	instead of <mask_mode512bit_condition> in condition.  If
	TARGET_AVX512DQ is false, emit vextract*64x4 instead of
	vextract*32x8.
	(vec_extract_lo_<mode><mask_name>): Drop <mask_avx512dq_condition>
	from condition.

	* gcc.target/i386/avx512vl-pr93670.c: New test.
2020-02-13 21:47:53 +01:00
Jakub Jelinek b7cbce7a17 i386: Fix -mavx -mno-mavx2 ICE with VEC_COND_EXPR [PR93637]
As mentioned in the PR, for -mavx -mno-avx2 the backend does support
vcondv4div4df and vcondv8siv8sf optabs (while generally 32-byte vectors
aren't much supported in that case, it is performed using
vandps/vandnps/vorps).  The problem is that after the last generic vector
lowering (where the VEC_COND_EXPR still compares two V4DF vectors and
has two V4DI last operands and V4DI result and so is considered ok) fre4
folds the condition into constant, at which point the middle-end during
expansion will try vcond_mask_optab and fall back to trying to expand it
as the constant vector < 0 vcondv4div4di, but neither of them is supported
for -mavx -mno-avx2 and thus we ICE.

So, the options I see is either what the following patch does, also support
vcond_mask_v4div4di and vcond_mask_v4siv4si already for TARGET_AVX, or
require for vcondv4div4df and vcondv8siv8sf TARGET_AVX2 rather than current
TARGET_AVX.

2020-02-10  Jakub Jelinek  <jakub@redhat.com>

	PR target/93637
	* config/i386/sse.md (VI_256_AVX2): New mode iterator.
	(vcond_mask_<mode><sseintvecmodelower>): Use it instead of VI_256.
	Change condition from TARGET_AVX2 to TARGET_AVX.

	* gcc.target/i386/avx-pr93637.c: New test.
2020-02-13 21:47:07 +01:00
Jakub JelinekandUroš Bizjak a91e5d8897 i386: Make xmm16-xmm31 call used even in ms ABI [PR65782]
On Tue, Feb 04, 2020 at 11:16:06AM +0100, Uros Bizjak wrote:
> I guess that Comment #9 patch form the PR should be trivially correct,
> but althouhg it looks obvious, I don't want to propose the patch since
> I have no means of testing it.

I don't have means of testing it either.
https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention?view=vs-2019
is quite explicit that [xyz]mm16-31 are call clobbered and only xmm6-15 (low
128-bits only) are call preserved.

We are talking e.g. about
/* { dg-options "-O2 -mabi=ms -mavx512vl" } */

typedef double V __attribute__((vector_size (16)));
void foo (void);
V bar (void);
void baz (V);
void
qux (void)
{
  V c;
  {
    register V a __asm ("xmm18");
    V b = bar ();
    asm ("" : "=x" (a) : "0" (b));
    c = a;
  }
  foo ();
  {
    register V d __asm ("xmm18");
    V e;
    d = c;
    asm ("" : "=x" (e) : "0" (d));
    baz (e);
  }
}
where according to the MSDN doc gcc incorrectly holds the c value
in xmm18 register across the foo call; if foo is compiled by some Microsoft
compiler (or LLVM), then it could clobber %xmm18.
If all xmm18 occurrences are changed to say xmm15, then it is valid to hold
the 128-bit value across the foo call (though, surprisingly, LLVM saves it
into stack anyway).

The other parts are I guess mainly about SEH.  Consider e.g.
void
foo (void)
{
  register double x __asm ("xmm14");
  register double y __asm ("xmm18");
  asm ("" : "=x" (x));
  asm ("" : "=v" (y));
  x += y;
  y += x;
  asm ("" : : "x" (x));
  asm ("" : : "v" (y));
}
looking at cross-compiler output, with -O2 -mavx512f this emits
	.file	"abcdeq.c"
	.text
	.align 16
	.globl	foo
	.def	foo;	.scl	2;	.type	32;	.endef
	.seh_proc	foo
foo:
	subq	$40, %rsp
	.seh_stackalloc	40
	vmovaps %xmm14,	(%rsp)
	.seh_savexmm	%xmm14, 0
	vmovaps %xmm18,	16(%rsp)
	.seh_savexmm	%xmm18, 16
	.seh_endprologue
	vaddsd	%xmm18, %xmm14, %xmm14
	vaddsd	%xmm18, %xmm14, %xmm18
	vmovaps	(%rsp), %xmm14
	vmovaps	16(%rsp), %xmm18
	addq	$40, %rsp
	ret
	.seh_endproc
	.ident	"GCC: (GNU) 10.0.1 20200207 (experimental)"
Does whatever assembler mingw64 uses even assemble this (I mean the
.seh_savexmm %xmm16, 16 could be problematic)?
I can find e.g.
https://stackoverflow.com/questions/43152633/invalid-register-for-seh-savexmm-in-cygwin/43210527
which then links to
https://gcc.gnu.org/PR65782

2020-02-08  Uroš Bizjak  <ubizjak@gmail.com>
	    Jakub Jelinek  <jakub@redhat.com>

	PR target/65782
	* config/i386/i386.h (CALL_USED_REGISTERS): Make
	xmm16-xmm31 call-used even in 64-bit ms-abi.

	* gcc.target/i386/pr65782.c: New test.

Co-authored-by: Uroš Bizjak <ubizjak@gmail.com>
2020-02-13 21:46:13 +01:00
Jakub Jelinek 05fa0de35e openmp: Fix handling of non-addressable shared scalars in parallel nested inside of target [PR93515]
As the following testcase shows, we need to consider even target to be a construct
that forces not to use copy in/out for shared on parallel inside of the target.
E.g. for parallel nested inside another parallel or host teams, we already avoid
copy in/out and we need to treat target the same.

2020-02-06  Jakub Jelinek  <jakub@redhat.com>

	PR libgomp/93515
	* omp-low.c (use_pointer_for_field): For nested constructs, also
	look for map clauses on target construct.
	(scan_omp_1_stmt) <case GIMPLE_OMP_TARGET>: Bump temporarily
	taskreg_nesting_level.

	* testsuite/libgomp.c-c++-common/pr93515.c: New test.
2020-02-13 21:45:15 +01:00
Jakub Jelinek d3266b1311 openmp: Notice reduction decl in outer contexts after adding it to shared [PR93515]
If we call omp_add_variable, following omp_notice_variable will already find it
on that construct and not go through outer constructs, the following patch fixes that.
Note, this still doesn't follow OpenMP 5.0 semantics on target combined with other
constructs with reduction/lastprivate/linear clauses, will handle that for GCC11.

2020-02-06  Jakub Jelinek  <jakub@redhat.com>

	PR libgomp/93515
	* gimplify.c (gimplify_scan_omp_clauses) <do_notice>: If adding
	shared clause, call omp_notice_variable on outer context if any.
2020-02-13 21:44:14 +01:00
Jakub Jelinek 520b364da0 c++: Mark __builtin_convertvector operand as read [PR93557]
In C++ we weren't calling mark_exp_read on the __builtin_convertvector first
argument.  I guess it could misbehave even with lambda implicit captures.

Fixed by calling decay_conversion on the argument, we use the argument as
rvalue so we want the standard lvalue to rvalue conversions, but as the
argument must be a vector type, e.g. integral promotions aren't really
needed.

2020-02-05  Jakub Jelinek  <jakub@redhat.com>

	PR c++/93557
	* semantics.c (cp_build_vec_convert): Call decay_conversion on arg
	prior to passing it to c_build_vec_convert.

	* c-c++-common/Wunused-var-17.c: New test.
2020-02-13 21:42:32 +01:00
Jakub Jelinek d42f9eaa3e openmp: Avoid ICEs with declare simd; declare simd inbranch [PR93555]
The testcases ICE because when processing the declare simd inbranch,
we don't create the i == 0 clone as it already exists, which means
clone_info->nargs is not adjusted, but we then rely on it being adjusted
when trying other clones.

2020-02-05  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/93555
	* omp-simd-clone.c (expand_simd_clones): If simd_clone_mangle or
	simd_clone_create failed when i == 0, adjust clone->nargs by
	clone->inbranch.

	* c-c++-common/gomp/pr93555-1.c: New test.
	* c-c++-common/gomp/pr93555-2.c: New test.
	* gfortran.dg/gomp/pr93555.f90: New test.
2020-02-13 21:33:47 +01:00
Jakub Jelinek 329475795c combine: Punt on out of range rotate counts [PR93505]
What happens on this testcase is with the out of bounds rotate we get:
Trying 13 -> 16:
   13: r129:SI=r132:DI#0<-<0x20
      REG_DEAD r132:DI
   16: r123:DI=r129:SI<0
      REG_DEAD r129:SI
Successfully matched this instruction:
(set (reg/v:DI 123 [ <retval> ])
    (const_int 0 [0]))
during combine.  So, perhaps we could also change simplify-rtx.c to punt
if it is out of bounds rather than trying to optimize anything.
Or, but probably GCC11 material, if we decide that ROTATE/ROTATERT doesn't
have out of bounds counts or introduce targetm.rotate_truncation_mask,
we should truncate the argument instead of punting.
Punting is better for backports though.

2020-01-30  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/93505
	* combine.c (simplify_comparison) <case ROTATE>: Punt on out of range
	rotate counts.

	* gcc.c-torture/compile/pr93505.c: New test.
2020-02-13 21:32:23 +01:00
Jakub Jelinek 4b124e3c9c openmp: c++: Consider typeinfo decls to be predetermined shared [PR91118]
If the typeinfo decls appear in OpenMP default(none) regions, as we no longer
predetermine const with no mutable members, they are diagnosed as errors,
but it isn't something the users can actually provide explicit sharing for in
the clauses.

2020-01-29  Jakub Jelinek  <jakub@redhat.com>

	PR c++/91118
	* cp-gimplify.c (cxx_omp_predetermined_sharing): Return
	OMP_CLAUSE_DEFAULT_SHARED for typeinfo decls.

	* g++.dg/gomp/pr91118-1.C: New test.
	* g++.dg/gomp/pr91118-2.C: New test.
2020-02-13 21:31:01 +01:00
Jakub Jelinek 244f4b8c28 openmp: Handle rest of EXEC_OACC_* in oacc_code_to_statement [PR93463]
As the testcase shows, some EXEC_OACC_* codes weren't handled in
oacc_code_to_statement.  Fixed thusly.

2020-01-29  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/93463
	* openmp.c (oacc_code_to_statement): Handle
	EXEC_OACC_{ROUTINE,UPDATE,WAIT,CACHE,{ENTER,EXIT}_DATA,DECLARE}.

	* gfortran.dg/goacc/pr93463.f90: New test.
2020-02-13 21:29:47 +01:00
Jakub Jelinek 764e831291 i386: Fix ix86_fold_builtin shift folding [PR93418]
The following testcase is miscompiled, because the variable shift left
operand, { -1, -1, -1, -1 } is represented as a VECTOR_CST with
VECTOR_CST_NPATTERNS 1 and VECTOR_CST_NELTS_PER_PATTERN 1, so when
we call builder.new_unary_operation, builder.encoded_nelts () will be just 1
and thus we encode the resulting vector as if all the elements were the
same.
For non-masked is_vshift, we could perhaps call builder.new_binary_operation
(TREE_TYPE (args[0]), args[0], args[1], false), but then there are masked
shifts, for non-is_vshift we could perhaps call it too but with args[2]
instead of args[1], but there is no builder.new_ternary_operation.
All this stuff is primarily for aarch64 anyway, on x86 we don't have any
variable length vectors, and it is not a big deal to compute all elements
and just let builder.finalize () find the most efficient VECTOR_CST
representation of the vector.  So, instead of doing too much, this just
keeps using new_unary_operation only if only one VECTOR_CST is involved
(i.e. non-masked shift by constant) and for the rest just compute all elts.

2020-01-28  Jakub Jelinek  <jakub@redhat.com>

	PR target/93418
	* config/i386/i386.c (ix86_fold_builtin) <do_shift>: If mask is not
	-1 or is_vshift is true, use new_vector with number of elts npatterns
	rather than new_unary_operation.

	* gcc.target/i386/avx2-pr93418.c: New test.
2020-02-13 21:27:53 +01:00
Jakub Jelinek 3b2fbe3e72 postreload: Fix up postreload combine [PR93402]
The following testcase is miscompiled, because the postreload pass changes:
-(insn 14 13 23 2 (parallel [
-            (set (reg:DI 1 dx [94])
-                (plus:DI (reg:DI 1 dx [95])
-                    (reg:DI 5 di [92])))
-            (clobber (reg:CC 17 flags))
-        ]) "pr93402.c":8:30 186 {*adddi_1}
-     (expr_list:REG_EQUAL (plus:DI (reg:DI 5 di [92])
-            (const_int 111111111111 [0x19debd01c7]))
-        (nil)))
-(insn 23 14 25 2 (set (reg:SI 0 ax)
+(insn 23 13 25 2 (set (reg:SI 0 ax)
         (const_int 0 [0])) "pr93402.c":10:1 67 {*movsi_internal}
      (nil))
 (insn 25 23 26 2 (use (reg:SI 0 ax)) "pr93402.c":10:1 -1
      (nil))
-(insn 26 25 35 2 (use (reg:DI 1 dx)) "pr93402.c":10:1 -1
+(insn 26 25 35 2 (use (plus:DI (reg:DI 1 dx [95])
+            (reg:DI 5 di [92]))) "pr93402.c":10:1 -1
      (nil))
A USE insn is not a normal insn and verify_changes called from
apply_change_group is happy about any changes into it.
The following patch avoids this optimization if we were to change
the USE operand (this routine only changes a reg into (plus reg reg2)).

2020-01-23  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/93402
	* postreload.c (reload_combine_recognize_pattern): Don't try to adjust
	USE insns.

	* gcc.c-torture/execute/pr93402.c: New test.
2020-02-13 21:21:43 +01:00
GCC Administrator 889cc2d87b Daily bump. 2020-02-13 00:18:36 +00:00
GCC Administrator 541431facd Daily bump. 2020-02-12 00:18:39 +00:00
Tamar Christina f6e9ae4da8 middle-end: Fix logical shift truncation (PR rtl-optimization/91838) (gcc-9 backport)
This fixes a fall-out from a patch I had submitted two years ago which started
allowing simplify-rtx to fold logical right shifts by offsets a followed by b
into >> (a + b).

However this can generate inefficient code when the resulting shift count ends
up being the same as the size of the shift mode.  This will create some
undefined behavior on most platforms.

This patch changes to code to truncate to 0 if the shift amount goes out of
range.  Before my older patch this used to happen in combine when it saw the
two shifts.  However since we combine them here combine never gets a chance to
truncate them.

The issue mostly affects GCC 8 and 9 since on 10 the back-end knows how to deal
with this shift constant but it's better to do the right thing in simplify-rtx.

Note that this doesn't take care of the Arithmetic shift where you could replace
the constant with MODE_BITS (mode) - 1, but that's not a regression so punting it.

gcc/ChangeLog:

	Backport from mainline
	2020-01-31  Tamar Christina  <tamar.christina@arm.com>

	PR rtl-optimization/91838
	* simplify-rtx.c (simplify_binary_operation_1): Update LSHIFTRT case
	to truncate if allowed or reject combination.

gcc/testsuite/ChangeLog:

	Backport from mainline
	2020-01-31  Tamar Christina  <tamar.christina@arm.com>
		    Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/91838
	* g++.dg/opt/pr91838.C: New test.
2020-02-11 10:50:15 +00:00
GCC Administrator 9248369630 Daily bump. 2020-02-11 00:18:28 +00:00
H.J. Lu 3fde339834 i386: Properly pop restore token in signal frame
Linux CET kernel places a restore token on shadow stack for signal
handler to enhance security.  The restore token is 8 byte and aligned
to 8 bytes.  It is usually transparent to user programs since kernel
will pop the restore token when signal handler returns.  But when an
exception is thrown from a signal handler, now we need to pop the
restore token from shadow stack.  For x86-64, we just need to treat
the signal frame as normal frame.  For i386, we need to search for
the restore token to check if the original shadow stack is 8 byte
aligned.  If the original shadow stack is 8 byte aligned, we just
need to pop 2 slots, one restore token, from shadow stack.  Otherwise,
we need to pop 3 slots, one restore token + 4 byte padding, from
shadow stack.

This patch also includes 2 tests, one has a restore token with 4 byte
padding and one without.

Tested on Linux/x86-64 CET machine with and without -m32.

libgcc/

	Backport from mainline
	PR libgcc/85334
	* config/i386/shadow-stack-unwind.h (_Unwind_Frames_Increment):
	New.

gcc/testsuite/

	Backport from mainline
	PR libgcc/85334
	* g++.target/i386/pr85334-1.C: New test.
	* g++.target/i386/pr85334-2.C: Likewise.

(cherry picked from commit bf6465d046)
2020-02-10 08:10:49 -08:00
GCC Administrator f1ee6f0fe4 Daily bump. 2020-02-10 00:18:34 +00:00
GCC Administrator 060c5df73b Daily bump. 2020-02-09 00:18:28 +00:00
GCC Administrator 3f764f459a Daily bump. 2020-02-08 00:18:45 +00:00
H.J. Lu 850c38f5f4 x86-64: Pass aggregates with only float/double in GPRs for MS_ABI
MS_ABI requires passing aggregates with only float/double in integer
registers as shown in the output from MSVC v19.10 at:

https://godbolt.org/z/2NPygd

This patch fixed:

FAIL: libffi.bhaible/test-callback.c -W -Wall -Wno-psabi -DDGTEST=54 -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-uninitialized -O0 -DABI_NUM=FFI_GNUW64 -DABI_ATTR=MSABI execution test
FAIL: libffi.bhaible/test-callback.c -W -Wall -Wno-psabi -DDGTEST=54 -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-uninitialized -O2 -DABI_NUM=FFI_GNUW64 -DABI_ATTR=MSABI execution test
FAIL: libffi.bhaible/test-callback.c -W -Wall -Wno-psabi -DDGTEST=55 -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-uninitialized -O0 -DABI_NUM=FFI_GNUW64 -DABI_ATTR=MSABI execution test
FAIL: libffi.bhaible/test-callback.c -W -Wall -Wno-psabi -DDGTEST=55 -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-uninitialized -O2 -DABI_NUM=FFI_GNUW64 -DABI_ATTR=MSABI execution test
FAIL: libffi.bhaible/test-callback.c -W -Wall -Wno-psabi -DDGTEST=56 -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-uninitialized -O0 -DABI_NUM=FFI_GNUW64 -DABI_ATTR=MSABI execution test
FAIL: libffi.bhaible/test-callback.c -W -Wall -Wno-psabi -DDGTEST=56 -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-uninitialized -O2 -DABI_NUM=FFI_GNUW64 -DABI_ATTR=MSABI execution test

in libffi testsuite.

gcc/

	Backport from mainline
	PR target/85667
	* config/i386/i386.c (function_arg_ms_64): Add a type argument.
	Don't return aggregates with only SFmode and DFmode in SSE
	register.
	(ix86_function_arg): Pass type to function_arg_ms_64.

gcc/testsuite/

	Backport from mainline
	PR target/85667
	* gcc.target/i386/pr85667-10.c: New test.
	* gcc.target/i386/pr85667-7.c: Likewise.
	* gcc.target/i386/pr85667-8.c: Likewise.
	* gcc.target/i386/pr85667-9.c: Likewise.

(cherry picked from commit ea5ca698dc)
2020-02-07 03:52:26 -08:00
GCC Administrator 13f225a4f2 Daily bump. 2020-02-07 00:18:37 +00:00
GCC Administrator 763cec3a13 Daily bump. 2020-02-06 00:18:31 +00:00
GCC Administrator 533d051f6d Daily bump. 2020-02-05 00:18:32 +00:00
GCC Administrator e0cd0469a2 Daily bump. 2020-02-04 00:18:45 +00:00
Tobias Burnus 41ef25ed05 [OpenMP] Add missing parameters to omp_lib documentation (PR fortran/93541)
Backported from mainline
        2020-02-03  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/93541
        * intrinisic.texi (OpenMP Modules OMP_LIB and OMP_LIB_KINDS):
        Add undocumented parameters from omp_lib.f90.in.
2020-02-03 12:14:58 +01:00
Tobias Burnus e5446f2201 [Fortran] Disable front-end optimization for OpenACC atomic (PR93462)
Backported from mainline
	2020-01-31  Tobias Burnus  <tobias@codesourcery.com>

	PR fortran/93462
	* frontend-passes.c (gfc_code_walker): For EXEC_OACC_ATOMIC, set
	in_omp_atomic to true prevent front-end optimization.

	PR fortran/93462
	* gfortran.dg/goacc/atomic-1.f90: New.
2020-02-03 12:09:46 +01:00
Tobias Burnus 5c80a1bd42 Fortran] PR93309 – permit repeated 'implicit none(external)'
Backported from mainline
	2020-01-21  Tobias Burnus  <tobias@codesourcery.com>

	PR fortran/93309
	* interface.c (gfc_procedure_use): Also check parent namespace for
	'implict none (external)'.
	* symbol.c (gfc_get_namespace): Don't set has_implicit_none_export
	to parent namespace's setting.

	Backported from mainline
	2020-01-21  Tobias Burnus  <tobias@codesourcery.com>

	PR fortran/93309
	* gfortran.dg/external_implicit_none_2.f90: New.
2020-02-03 11:48:17 +01:00
GCC Administrator 2210e437a3 Daily bump. 2020-02-03 00:18:50 +00:00
GCC Administrator 40f23be6e9 Daily bump. 2020-02-02 00:18:32 +00:00
GCC Administrator bf4ee21e21 Daily bump. 2020-02-01 00:18:28 +00:00
GCC Administrator 6da4411d95 Daily bump. 2020-01-31 00:18:49 +00:00
John David Anglin 6957d3e4ee Fix ICE in pa_elf_select_rtx_section.
2020-01-30  John David Anglin  <danglin@gcc.gnu.org>

	* config/pa/pa.c (pa_elf_select_rtx_section): Place function pointers
	without a DECL in .data.rel.ro.local.
2020-01-30 07:29:35 -05:00
Kito Cheng afb84a42ad RISC-V: Disallow regrenme if the TO register never used before for interrupt functions
gcc/ChangeLog

	PR target/93304
	* config/riscv/riscv-protos.h (riscv_hard_regno_rename_ok): New.
	* config/riscv/riscv.c (riscv_hard_regno_rename_ok): New.
	* config/riscv/riscv.h (HARD_REGNO_RENAME_OK): Defined.

gcc/testsuite/ChangeLog

	PR target/93304
	* gcc.target/riscv/pr93304.c: New test.
2020-01-30 15:33:07 +08:00
Jason Merrill 9d9679132e c++: Drop alignas restriction for stack variables.
Since expand_stack_vars and such know how to deal with variables aligned
beyond MAX_SUPPORTED_STACK_ALIGNMENT, we shouldn't reject alignas of large
alignments.  And if we don't do that, there's no point in having
check_cxx_fundamental_alignment_constraints at all, since
check_user_alignment already enforces MAX_OFILE_ALIGNMENT.

	PR c++/89357
	* c-attribs.c (check_cxx_fundamental_alignment_constraints): Remove.
2020-01-29 20:11:30 -05:00
GCC Administrator c6613dd33c Daily bump. 2020-01-30 00:18:31 +00:00
Szabolcs Nagy a1f8dca201 [AArch64] PR92424: Fix -fpatchable-function-entry=N,M with BTI
This is a workaround that emits a BTI after the function label if that
is followed by a patch area. We try to remove the BTI that follows the
patch area (this may fail e.g. if the first instruction is a PACIASP).

So before this commit -fpatchable-function-entry=3,1 with bti generates

    .section __patchable_function_entries
    .8byte .LPFE
    .text
  .LPFE:
    nop
  foo:
    nop
    nop
    bti c // or paciasp
    ...

and after this commit

    .section __patchable_function_entries
    .8byte .LPFE
    .text
  .LPFE:
    nop
  foo:
    bti c
    nop
    nop
    // may be paciasp
    ...

and with -fpatchable-function-entry=1 (M=0) the code now is

  foo:
    bti c
    .section __patchable_function_entries
    .8byte .LPFE
    .text
  .LPFE:
    nop
    // may be paciasp
    ...

There is a new bti insn in the middle of the patchable area users need
to be aware of unless M=0 (patch area is after the new bti) or M=N
(patch area is before the label, no new bti). Note: bti is not added to
all functions consistently (it can be turned off per function using a
target attribute or the compiler may detect that the function is never
called indirectly), so if bti is inserted in the middle of a patch area
then user code needs to deal with detecting it.

Tested on aarch64-none-linux-gnu.

gcc/ChangeLog:

	PR target/92424
	* config/aarch64/aarch64.c (aarch64_declare_function_name): Set
	cfun->machine->label_is_assembled.
	(aarch64_print_patchable_function_entry): New.
	(TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY): Define.
	* config/aarch64/aarch64.h (struct machine_function): New field,
	label_is_assembled.

gcc/testsuite/ChangeLog:

	PR target/92424
	* gcc.target/aarch64/pr92424-2.c: New test.
	* gcc.target/aarch64/pr92424-3.c: New test.
2020-01-29 14:31:50 +00:00
GCC Administrator 50a42922d3 Daily bump. 2020-01-29 00:18:34 +00:00
Jason Merrill 1c7061c7c3 c++: Allow template rvalue-ref conv to bind to lvalue ref.
When I implemented the [over.match.ref] rule that a reference conversion
function needs to match l/rvalue of the target reference type it changed our
handling of this testcase.  It seems to me that our current behavior is what
the standard says, but it doesn't seem desirable, and all the other
compilers have our old behavior.  So let's limit the change to non-templates
until there's some clarification from the committee.

	PR c++/90546
	* call.c (build_user_type_conversion_1): Allow a template conversion
	returning an rvalue reference to bind directly to an lvalue.
2020-01-28 14:56:01 -05:00
Jason Merrill 9d4d55a52d c++: Function declared with typedef with eh-specification.
We just need to handle the exception specification like other properties of
a function typedef.

	PR c++/90731
	* decl.c (grokdeclarator): Propagate eh spec from typedef.
2020-01-28 09:53:16 -05:00
Jason Merrill dcb23017b1 c++: Fix array of char typedef in template (PR90966).
Since Martin Sebor's patch for PR 71625 to change braced array initializers
to STRING_CST in some cases, we need to be ready for STRING_CST with types
that are changed by tsubst.  fold_convert doesn't know how to deal with
STRING_CST, which is reasonable; we really shouldn't expect it to here.  So
let's handle STRING_CST separately.

	PR c++/90966
	* pt.c (tsubst_copy) [STRING_CST]: Don't use fold_convert.
2020-01-28 09:53:07 -05:00
Jason Merrill 7db777843c c++: Fix ICE with lambda in member operator (PR93279)
Here the problem was that we were remembering the lookup in template scope,
and then trying to reuse that lookup in the instantiation without
substituting into it at all.  The simplest solution is to not try to
remember a lookup that finds a class-scope declaration, as in that case
doing the normal lookup again at instantiation time will always find the
right declarations.

	PR c++/93279 - ICE with lambda in member operator.
	* name-lookup.c (maybe_save_operator_binding): Don't remember
	class-scope bindings.
2020-01-28 09:52:57 -05:00
GCC Administrator 83f65674e7 Daily bump. 2020-01-28 00:18:29 +00:00
Nathan Sidwell 2ceb5aba64 c++: Bogus error using namespace alias [PR91826]
My changes to is_nested_namespace broke is_ancestor's use where a namespace
alias might be passed in.  This changes is_ancestor to look through the alias.

	PR c++/91826
	* name-lookup.c (is_ancestor): Allow CHILD to be a namespace alias.
2020-01-27 07:41:26 -08:00
Wilco Dijkstra a708cb25d9 [AArch64] Fix shrinkwrapping interactions with atomics (PR92692)
The separate shrinkwrapping pass may insert stores in the middle
of atomics loops which can cause issues on some implementations.
Avoid this by delaying splitting atomics patterns until after
prolog/epilog generation.

gcc/
	PR target/92692
	* config/aarch64/aarch64.c (aarch64_split_compare_and_swap)
	Add assert to ensure prolog has been emitted.
	(aarch64_split_atomic_op): Likewise.
	* config/aarch64/atomics.md (aarch64_compare_and_swap<mode>)
	Use epilogue_completed rather than reload_completed.
	(aarch64_atomic_exchange<mode>): Likewise.
	(aarch64_atomic_<atomic_optab><mode>): Likewise.
	(atomic_nand<mode>): Likewise.
	(aarch64_atomic_fetch_<atomic_optab><mode>): Likewise.
	(atomic_fetch_nand<mode>): Likewise.
	(aarch64_atomic_<atomic_optab>_fetch<mode>): Likewise.
	(atomic_nand_fetch<mode>): Likewise.

(cherry picked from commit e5e07b6818)
2020-01-27 12:58:02 +00:00
GCC Administrator 568968edb0 Daily bump. 2020-01-27 00:18:48 +00:00
Rainer Orth bf15829bf6 testsuite: xfail gcc.target/i386/pr91298-?.c on Solaris/x86 with as
The new gcc.target/i386/pr91298-?.c testcases FAIL on Solaris/x86 with the
native assembler:

FAIL: gcc.target/i386/pr91298-1.c (test for excess errors)

Excess errors:
Assembler: pr91298-1.c
        "/var/tmp//ccE6r3xb.s", line 5 : Syntax error
        Near line: "    .globl  $quux"
        "/var/tmp//ccE6r3xb.s", line 6 : Syntax error
        Near line: "    .type   $quux, @function"
        "/var/tmp//ccE6r3xb.s", line 7 : Syntax error
        Near line: "$quux:"
        "/var/tmp//ccE6r3xb.s", line 15 : Syntax error
        Near line: "    .size   $quux, .-$quux"
        "/var/tmp//ccE6r3xb.s", line 24 : Syntax error
        Near line: "    movl    $($a), %eax"
        "/var/tmp//ccE6r3xb.s", line 38 : Syntax error
        Near line: "    leal    ($a)(,%eax,4), %eax"
        "/var/tmp//ccE6r3xb.s", line 51 : Syntax error
        Near line: "    movl    ($a), %eax"
        "/var/tmp//ccE6r3xb.s", line 63 : Syntax error
        Near line: "    movl    ($a)+16, %eax"
        "/var/tmp//ccE6r3xb.s", line 97 : Syntax error
        Near line: "    movl    $($quux), %eax"
        "/var/tmp//ccE6r3xb.s", line 101 : Syntax error
        Near line: "    .globl  $a"
        "/var/tmp//ccE6r3xb.s", line 104 : Syntax error
        Near line: "    .type   $a, @object"
        "/var/tmp//ccE6r3xb.s", line 105 : Syntax error
        Near line: "    .size   $a, 72"
        "/var/tmp//ccE6r3xb.s", line 106 : Syntax error
        Near line: "$a:"
        "/var/tmp//ccE6r3xb.s", line 228 : Syntax error
        Near line: "    .long   ($a)"

FAIL: gcc.target/i386/pr91298-2.c (test for excess errors)

It only allows letters, digits, '_' and '.' in identifiers:
https://docs.oracle.com/cd/E37838_01/html/E61064/eqbsx.html#XALRMeoqjw

For lack of an effective-target keyword matching -fdollars-in-identifiers,
this patch fixes this by xfailing them on *-*-solaris2.* && !gas.

Tested on i386-pc-solaris2.11 with as and gas and x86_64-pc-linux-gnu.

	* gcc.target/i386/pr91298-1.c: xfail on Solaris/x86 with native
	assembler.
	* gcc.target/i386/pr91298-2.c: Likewise.
2020-01-26 21:39:07 +01:00
GCC Administrator 393df7be49 Daily bump. 2020-01-26 00:18:21 +00:00
GCC Administrator 7058d1744c Daily bump. 2020-01-25 00:18:24 +00:00
Jason Merrill a4b7cf5865 c++: Unshare expressions from constexpr cache.
Another place we need to unshare cached expressions.

	PR c++/92852 - ICE with generic lambda and reference var.
	* constexpr.c (maybe_constant_value): Likewise.
2020-01-24 14:08:32 -05:00
Jonathan Wakely e2bcf65fee libstdc++: Simplify makefile rule for largefile-config.h (PR91947)
The previous rule could leave an incomplete file if the build was
interrupted, which would then not be remade if make was run again.

This makes the rule more robust by writing to a temporary file and only
moving it into place as the final step. It also simplifies the rule so
that only the essential macro definitions are written to the file, not
the explanatory comments and commented out #undef lines.

Also, the macro for enabling LFS on Mac OS X 10.5 is now set
unconditionally, which is a bug fix from upstream autoconf.

Backport from mainline
2020-01-23  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/91947
	* include/Makefile.am (${host_builddir}/largefile-config.h): Simplify
	rule.
	* include/Makefile.in: Regenerate.
2020-01-24 11:18:43 +00:00
Jonathan Wakely 461c01b2d9 libstdc++: Fix recent documentation changes
Backport from mainline
2020-01-20  Jonathan Wakely  <jwakely@redhat.com>

	* doc/xml/faq.xml: Fix grammar.
	* doc/xml/manual/appendix_contributing.xml: Improve instructions.
	* doc/xml/manual/spine.xml: Update copyright years.
	* doc/html/*: Regenerate.
2020-01-24 11:18:29 +00:00
GCC Administrator 5fbc175234 Daily bump. 2020-01-24 00:18:13 +00:00
GCC Administrator 6dd69b7867 Daily bump. 2020-01-23 00:18:53 +00:00
Jakub Jelinek f4a36c5017 Cherry-pick 15 bugfixes from mainline
r10-6140-gd80f0a8dc9c2e5886bb79bddee2674e1d3f9d105
r10-6137-gc892d8f58f6fed46c343bdb6dd4d365f08f801b8
r10-6136-g44a9d801a7080d39658754ad603536da6cff2cd0
r10-6135-ga38979d9d7a4ab08336436052704028c56187618
r10-6118-gbd0a3e244d94ad4a5e41f01ebf285f0861cb4a03
r10-6104-g51e010b5f75c1fff06425a72702c1bf82a3ab053
r10-6041-gc60a18f8056facdcf370ce0e5f51550c9df5b539
r10-5954-gfbbc4c24fd7ba87e0c47cd965ae624afba6fa375
r10-5897-g91df4397a1404df65de6de23426294c50ab88bd2
r10-5829-ga0ab54de0ec3e0d48b2a681f7f78fe14bc4099eb
r10-5723-g5a6e28b5bae7a236b35994d0f64fd902a574872c
r10-5712-g4ea5d54b3c7175de045589f994fc94ed7e59d80d
r10-5697-g2c8297996a7ab3496c5d2f798cdbe4cab749468e
r10-5650-g7cd268ad6a6f71877744539d17ed53e752774bfa
r10-5618-g6c7b84305a5e686644ee64bfd2d415f3f43fa85b
2020-01-22 20:18:03 +01:00
Jakub Jelinek b6c7913402 aarch64: Fix aarch64_expand_subvti constant handling [PR93335]
The two patterns that call aarch64_expand_subvti ensure that {low,high}_in1
is a register, while {low,high}_in2 can be a register or immediate.
subdi3_compare1_imm uses the aarch64_plus_immediate predicate for its last
two operands (the value and negated value), but aarch64_expand_subvti calls
it whenever low_in2 is a CONST_INT, which leads to ICEs during vregs pass,
as the emitted insn is not recognized as valid subdi3_compare1_imm.
The following patch fixes that by only using subdi3_compare1_imm if it is ok
to do so, and otherwise force the constant into register and use the
non-immediate version - subdi3_compare1.
Furthermore, previously the code was calling force_reg on high_in2 only if
low_in2 is CONST_INT, on the (reasonable) assumption is that only if low_in2
is a CONST_INT, high_in2 can be non-REG, but with the above changes even in
the else we might have CONST_INT and force_reg doesn't do anything if the
operand is already a REG, so this patch calls it unconditionally.

2020-01-22  Jakub Jelinek  <jakub@redhat.com>

	PR target/93335
	* config/aarch64/aarch64.c (aarch64_expand_subvti): Only use
	gen_subdi3_compare1_imm if low_in2 satisfies aarch64_plus_immediate
	predicate, not whenever it is CONST_INT.  Otherwise, force_reg it.
	Call force_reg on high_in2 unconditionally.

	* gcc.c-torture/compile/pr93335.c: New test.
2020-01-22 20:12:58 +01:00
Jakub Jelinek d1c29dc8a3 i386: Fix up -fdollars-in-identifiers with identifiers starting with $ in -masm=att [PR91298]
In AT&T syntax leading $ is special, so if we have identifiers that start
with dollar, we usually fail to assemble it (or assemble incorrectly).
As mentioned in the PR, what works is wrapping the identifiers inside of
parens, like:
	movl	$($a), %eax
	leaq	($a)(,%rdi,4), %rax
	movl	($a)(%rip), %eax
	movl	($a)+16(%rip), %eax
	.globl	$a
	.type	$a, @object
	.size	$a, 72
$a:
	.string	"$a"
	.quad	($a)
(this is x86_64 -fno-pic -O2).  In some places ($a) is not accepted,
like as .globl operand, in .type, .size, so the patch overrides
ASM_OUTPUT_SYMBOL_REF rather than e.g. ASM_OUTPUT_LABELREF.
I didn't want to duplicate what assemble_name is doing (following
transparent aliases), so split assemble_name into two parts; just
mere looking at the first character of a name before calling assemble_name
wouldn't be good enough, a transparent alias could lead from a name
not starting with $ to one starting with it and vice versa.

2020-01-22  Jakub Jelinek  <jakub@redhat.com>

	PR target/91298
	* output.h (assemble_name_resolve): Declare.
	* varasm.c (assemble_name_resolve): New function.
	(assemble_name): Use it.
	* config/i386/i386.h (ASM_OUTPUT_SYMBOL_REF): Define.

	* gcc.target/i386/pr91298-1.c: New test.
	* gcc.target/i386/pr91298-2.c: New test.
2020-01-22 20:12:57 +01:00
Jakub Jelinek 18cfaa4217 openmp: Fix up !$omp target parallel handling
The PR93329 fix revealed we ICE on !$omp target parallel, this change fixes
that.

2020-01-22  Jakub Jelinek  <jakub@redhat.com>

	* parse.c (parse_omp_structured_block): Handle ST_OMP_TARGET_PARALLEL.
	* trans-openmp.c (gfc_trans_omp_target)
	<case EXEC_OMP_TARGET_PARALLEL>: Call pushlevel first.

	* gfortran.dg/gomp/target-parallel1.f90: New test.
	* gfortran.dg/goacc/pr93329.f90: Enable commented out target parallel
	test.
2020-01-22 20:12:57 +01:00
Jakub Jelinek 39d602ba46 openmp: Teach omp_code_to_statement about rest of OpenMP statements
The omp_code_to_statement function added with the initial OpenACC support
only handled small subset of the OpenMP statements, leading to ICE if
any other OpenMP directive appeared inside of OpenACC directive.

2020-01-22  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/93329
	* openmp.c (omp_code_to_statement): Handle remaining EXEC_OMP_*
	cases.

	* gfortran.dg/goacc/pr93329.f90: New test.
2020-01-22 20:12:57 +01:00
Jakub Jelinek 51faa475c9 riscv: Fix up riscv_rtx_costs for RTL checking (PR target/93333)
As mentioned in the PR, during combine rtx_costs can be called sometimes
even on RTL that has not been validated yet and so can contain even operands
that aren't valid in any instruction.

2020-01-21  Jakub Jelinek  <jakub@redhat.com>

	PR target/93333
	* config/riscv/riscv.c (riscv_rtx_costs) <case ZERO_EXTRACT>: Verify
	the last two operands are CONST_INT_P before using them as such.

	* gcc.c-torture/compile/pr93333.c: New test.
2020-01-22 20:12:57 +01:00
Jakub Jelinek 1abe8d45b7 powerpc: Fix ICE with fp conditional move (PR target/93073)
The following testcase ICEs, because for TFmode the particular subtraction
pattern (*subtf3) is not enabled with the given options.  Using
expand_simple_binop instead of emitting the subtraction by hand just moves
the ICE one insn later, NEG of ABS is not then recognized, etc., but
ultimately the problem is that when rs6000_emit_cmove is called for floating
point operand mode (and earlier condition ensures that in that case
compare_mode is also floating point), the expander makes sure the
operand mode is SFDF, but for the comparison mode nothing checks it, yet
there is just one *fsel* pattern with 2 separate SFDF iterators.

The following patch fixes it by giving up if compare_mode is not SFmode or
DFmode.

2020-01-21  Jakub Jelinek  <jakub@redhat.com>

	PR target/93073
	* config/rs6000/rs6000.c (rs6000_emit_cmove): If using fsel, punt for
	compare_mode other than SFmode or DFmode.

	* gcc.target/powerpc/pr93073.c: New test.
2020-01-22 20:12:57 +01:00
Jakub Jelinek 514314b731 c++: Fix deprecated attribute handling on templates (PR c++/93228)
As the following testcase shows, when deprecated attribute is on a template,
we'd never print the message if any, because the attribute is not
present on the TEMPLATE_DECL with which warn_deprecated_use is called,
but on its DECL_TEMPLATE_RESULT or its type.

2020-01-17  Jakub Jelinek  <jakub@redhat.com>

	PR c++/93228
	* parser.c (cp_parser_template_name): Look up deprecated attribute
	in DECL_TEMPLATE_RESULT or its type's attributes.

	* g++.dg/cpp1y/attr-deprecated-3.C: New test.
2020-01-22 20:12:56 +01:00
Jakub Jelinek a5ce64f7d5 i386: Fix wrong-code x86 issue with avx512{f,vl} fma PR93009
As mentioned in the PR, the following testcase is miscompiled with avx512vl.
The reason is that the fma *_bcst_1 define_insns have two alternatives:
"=v,v" "0,v" "v,0" "m,m" and use the same
vfmadd213* %3<avx512bcst>, %2, %0<sd_mask_op4>
pattern.  If the first alternative is chosen, everything is ok, but if the
second alternative is chosen, %2 and %0 are the same register, so instead
of doing dest=dest*another+membcst we do dest=dest*dest+membcst.
Now, to fix this, either we'd need separate:
  "vfmadd213<ssemodesuffix>\t{%3<avx512bcst>, %2, %0<sd_mask_op4>|%0<sd_mask_op4>, %2, %3<avx512bcst>}
   vfmadd213<ssemodesuffix>\t{%3<avx512bcst>, %1, %0<sd_mask_op4>|%0<sd_mask_op4>, %1, %3<avx512bcst>}"
where for the second alternative, we'd just use %1 instead of %2, but
what I think is actually cleaner is just use a single alternative and
make the two multiplication operands commutative, which they really are.

2020-01-15  Jakub Jelinek  <jakub@redhat.com>

	PR target/93009
	* config/i386/sse.md
	(*<sd_mask_codefor>fma_fmadd_<mode><sd_maskz_name>_bcst_1,
	*<sd_mask_codefor>fma_fmsub_<mode><sd_maskz_name>_bcst_1,
	*<sd_mask_codefor>fma_fnmadd_<mode><sd_maskz_name>_bcst_1,
	*<sd_mask_codefor>fma_fnmsub_<mode><sd_maskz_name>_bcst_1): Use
	just a single alternative instead of two, make operands 1 and 2
	commutative.

	* gcc.target/i386/avx512vl-pr93009.c: New test.
2020-01-22 20:12:56 +01:00
Jakub Jelinek 13e141515f re PR libgomp/93219 (unused return value in affinity-fmt.c)
PR libgomp/93219
	* libgomp.h (gomp_print_string): Change return type from void to int.
	* affinity-fmt.c (gomp_print_string): Likewise.  Return true if
	not all characters have been written.
2020-01-22 20:12:56 +01:00
Jakub Jelinek 5e94f77146 re PR inline-asm/93202 ([RISCV] ICE when using inline asm 'h' operand modifier)
PR inline-asm/93202
	* config/riscv/riscv.c (riscv_print_operand_reloc): Use
	output_operand_lossage instead of gcc_unreachable.
	* doc/md.texi (riscv f constraint): Fix typo.

	* gcc.target/riscv/pr93202.c: New test.
2020-01-22 20:12:55 +01:00
Jakub Jelinek 75cdf66907 re PR rtl-optimization/93088 (Compile time hog on gcc/testsuite/gcc.target/i386/pr56348.c w/ -O3 -funroll-loops -fno-tree-dominator-opts -fno-tree-vrp)
PR rtl-optimization/93088
	* loop-iv.c (find_single_def_src): Punt after looking through
	128 reg copies for regs with single definitions.  Move definitions
	to first uses.

	* gcc.target/i386/pr93088.c: New test.
2020-01-22 20:12:55 +01:00
Jakub Jelinek 7bf1518f84 re PR ipa/93087 (Bogus -Wsuggest-attribute=cold on function already marked as __attribute__((cold)))
PR ipa/93087
	* predict.c (compute_function_frequency): Don't call
	warn_function_cold on functions that already have cold attribute.

	* c-c++-common/cold-1.c: New test.
2020-01-22 20:12:55 +01:00
Jakub Jelinek 26e1a1c66f re PR libgomp/93065 (libgomp: destructor missing to delete goacc_cleanup_key)
PR libgomp/93065
	* oacc-init.c (goacc_runtime_deinitialize): New function.
2020-01-22 20:12:55 +01:00
Jakub Jelinek dbc84c8b7f re PR c++/92438 (Function declaration parsed incorrectly with -std=c++1z)
PR c++/92438
	* parser.c (cp_parser_constructor_declarator_p): If open paren
	is followed by RID_ATTRIBUTE, skip over the attribute tokens and
	try to parse type specifier.

	* g++.dg/ext/attrib61.C: New test.
2020-01-22 20:12:54 +01:00
Jakub Jelinek beee53d59e re PR c++/92992 (Side-effects dropped when decltype(nullptr) typed expression is passed to ellipsis)
PR c++/92992
	* call.c (convert_arg_to_ellipsis): For decltype(nullptr) arguments
	that have side-effects use cp_build_compound_expr.

	* g++.dg/cpp0x/nullptr45.C: New test.
2020-01-22 20:12:54 +01:00
Joseph Myers a11e92c4e7 Fix ICE with cast of division by zero (PR c/93348).
Bug 93348 reports an ICE on certain cases of casts of expressions that
may appear only in unevaluated parts of integer constant expressions,
arising from the generation of nested C_MAYBE_CONST_EXPRs.  This patch
fixes it by adding a call to remove_c_maybe_const_expr in the
integer-operands case, as is done in other similar cases.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

	PR c/93348
gcc/c:
	* c-typeck.c (build_c_cast): Call remove_c_maybe_const_expr on
	argument with integer operands.

gcc/testsuite:
	* gcc.c-torture/compile/pr93348-1.c: New test.

(cherry picked from commit ac68e287fc)
2020-01-22 17:26:10 +00:00
GCC Administrator 58735237fc Daily bump. 2020-01-22 00:18:31 +00:00
Jerry DeLisle ae403e0d4e Bug 93234 - INQUIRE on pre-assigned files of ROUND and SIGN properties fails
2020-01-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        Backport from mainline
	PR libfortran/93234
	* io/unit.c (set_internal_unit): Set round and sign flags
	correctly.

	* gfortran.dg/inquire_pre.f90: New test.
2020-01-21 15:35:42 -08:00
Jason Merrill 3384aa7af4 PR c++/91476 - anon-namespace reference temp clash between TUs.
* call.c (make_temporary_var_for_ref_to_temp): Clear TREE_PUBLIC
	if DECL is in the anonymous namespace.
2020-01-21 10:20:27 -05:00
GCC Administrator 00cae906a9 Daily bump. 2020-01-21 00:18:28 +00:00
Joseph Myers 9e9f9bf428 Update GCC zh_TW.po.
* zh_TW.po: Update.
2020-01-20 18:57:25 +00:00
Mark Eggleston 4206614946 [PATCH] PR Fortran/93263 Correct test case
Should've have checked for the existance of a non static integer
using scan-tree-dump instead of scan-tree-dump-not. A cut and paste
error.
2020-01-20 13:29:50 +00:00
Richard Biener 20e9d78543 PR middle-end/93246 - missing alias subsets
Starting with the introduction of TYPE_TYPELESS_STORAGE the situation
of having a alias-set zero aggregate field became more common which
prevents recording alias-sets of fields of said aggregate as subset
of the outer aggregate.  component_uses_parent_alias_set_from in the
past fended off some of the issues with that but the alias oracles
use of the alias set of the base of an access path never appropriately
handled it.

The following makes it so that alias-sets of fields of alias-set zero
aggregate fields are still recorded as subset of the container.

2020-01-14  Richard Biener  <rguenther@suse.de>

	PR middle-end/93246
	* alias.c (record_component_aliases): Take superset to record
	into, recurse for alias-set zero fields.
	(record_component_aliases): New oveerload wrapping around the above.

	* g++.dg/torture/pr93246.C: New testcase.
2020-01-20 12:57:04 +01:00
Martin Liska ce91f0f189 Backport f48c601413
Backport from mainline
	2020-01-16  Martin Liska  <mliska@suse.cz>

	* lto-partition.c (lto_balanced_map): Remember
	best_noreorder_pos and then restore to it
	when we revert.
2020-01-20 12:11:20 +01:00
Eric S. Raymond fd5b5c275d Clean up references to Subversion in documentation sources.
Clean up references to SVN in in the GCC docs, redirecting to Git
documentation as appropriate.

Where references to "the source code repository" rather than a
specific VCS make sense, I have used them. You might, after
all, change VCSes again someday.

I have not modified either generated HTML files nor maintainer scripts.
These changes should be complete with repect to the documentation tree.

2020-01-19  Eric S. Raymond <esr@thyrsus.com>
	    Sandra Loosemore  <sandra@codesourcery.com>

	Partial backport from mainline:

	2020-01-19  Eric S. Raymond <esr@thyrsus.com>

	gcc/
	* doc/contribute.texi: Update for SVN -> Git transition.
	* doc/install.texi: Likewise.

	libstdc++-v3
	* doc/xml/faq.xml: Update for SVN -> Git transition.
	* doc/xml/manual/appendix_contributing.xml: Likewise.
2020-01-19 18:10:52 -08:00
GCC Administrator cee5d51cef Daily bump. 2020-01-20 00:18:27 +00:00
GCC Administrator 99b6367092 Daily bump. 2020-01-19 00:18:27 +00:00
GCC Administrator 41fd95e6db Daily bump. 2020-01-18 00:18:36 +00:00
Jason Merrill 3815f21164 PR c++/92531 - ICE with noexcept(lambda).
This was failing because uses_template_parms didn't recognize LAMBDA_EXPR as
a kind of expression.  Instead of trying to enumerate all the different
varieties of expression and then aborting if what's left isn't
error_mark_node, let's handle error_mark_node and then assume anything else
is an expression.

	* pt.c (uses_template_parms): Don't try to enumerate all the
	expression cases.
2020-01-17 09:56:32 -05:00
Jason Merrill 5c7938eb3f PR c++/93286 - ICE with __is_constructible and variadic template.
Here we had been recursing in tsubst_copy_and_build if type2 was a TREE_LIST
because that function knew how to deal with pack expansions, and tsubst
didn't.  But tsubst_copy_and_build expects to be dealing with expressions,
so we crash when trying to convert_from_reference a type.

	* pt.c (tsubst) [TREE_LIST]: Handle pack expansion.
	(tsubst_copy_and_build) [TRAIT_EXPR]: Always use tsubst for type2.
2020-01-17 09:56:32 -05:00
Mark Eggleston f158d9197d Fortran: PR93263 -fno-automatic and RECURSIVE
The use of -fno-automatic should not affect the save attribute of a
recursive procedure. The first test case checks unsaved variables
and the second checks saved variables.
2020-01-17 09:44:49 +00:00
GCC Administrator 26b2838fc9 Daily bump. 2020-01-17 00:18:53 +00:00
GCC Administrator 0bb3f83fdc Daily bump. 2020-01-16 00:18:44 +00:00
Joseph Myers 7cc6b679a0 Fix setting of DECL_CONTEXT in pushdecl (PR c/93072).
Bug 93072 is a case where the C front end (a) wrongly interprets an
inline declaration at block scope as indicating that DECL_CONTEXT
should be set for an inline function and (b) this results in an ICE.
This is a regression resulting from a previous fix of mine for other
bugs involving such declarations being wrongly interpreted elsewhere
as nested function declarations.  The fix is similar to the previous
fix: use TREE_PUBLIC instead of DECL_EXTERNAL in another place as the
relevant test to determine whether to set DECL_CONTEXT.  (When a
variable reaches the code in question in pushdecl, the two are
equivalent.)

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

	PR c/93072
gcc/c:
	* c-decl.c (pushdecl): Use TREE_PUBLIC, not DECL_EXTERNAL, to
	determine whether to set DECL_CONTEXT.

gcc/testsuite:
	* gcc.dg/inline-42.c, gcc.dg/inline-43.c: New tests.

(cherry picked from commit e2346a33b0)
2020-01-15 20:53:15 +00:00
Uros Bizjak 49e76760a2 PR target/93254 - -msse generates sse2 instructions
PR target/93254
	* config/i386/i386.md (*movsf_internal): Require SSE2 ISA for
	alternatives 9 and 10.  Do not require SSE2 ISA for alternatives
	14 and 15.
2020-01-15 20:22:39 +01:00
GCC Administrator 14f4825e49 Daily bump. 2020-01-15 00:18:42 +00:00
Martin Jambor b849001991 IPA: Avoid segfault in devirtualization_time_bonus (PR 93223)
2020-01-14  Martin Jambor  <mjambor@suse.cz>

	PR ipa/93223
	* ipa-cp.c (devirtualization_time_bonus): Check whether isummary is
	NULL.

	testsuite/
	* g++.dg/ipa/pr93223.C: New test.
2020-01-14 19:05:56 +01:00
GCC Administrator 3401a3b7ba Daily bump. 2020-01-14 00:18:50 +00:00
Joseph Myers 2638a44bbe Fix handling of overflow in C casts in integer constant expressions (PR c/93241).
Bug 93241 reports a case where certain C expressions involving casts,
that would not be valid in an evaluated part of an integer constant
expression (because of e.g. involving integer overflow), are wrongly
rejected in an unevaluated part of an integer constant expression even
though all the operands and operations are ones that are valid in that
context.  This is a rejects-valid regression in GCC 4.5 and later
relative to 4.4 (for some testcases; the one in the bug uses
_Static_assert which isn't supported in those older releases).

The rule in the C front end is that an expression with those
properties (valid in an unevaluated part of an integer constant
expression but not an evaluated part) must be represented either as an
INTEGER_CST with TREE_OVERFLOW set or as a C_MAYBE_CONST_EXPR with
C_MAYBE_CONST_EXPR_INT_OPERANDS set.  This patch fixes build_c_cast to
check for that case and call note_integer_operands as needed.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

	PR c/93241
gcc/c:
	* c-typeck.c (build_c_cast): Check for expressions with integer
	operands that can occur in an unevaluated part of an integer
	constant expression and call note_integer_operands as needed.

gcc/testsuite:
	* gcc.dg/c11-static-assert-10.c, gcc.dg/c99-const-expr-15.c: New
	tests.

(cherry picked from commit 3d77686d2e)
2020-01-14 00:13:21 +00:00
Jonathan Wakely 6cb662745d Build filesystem library with large file support
Enable AC_SYS_LARGEFILE to set the macros needed for large file APIs to
be used by default. We do not want to define those macros in the
public headers that users include. The values of the macros are copied
to a separate file that is only included by the filesystem sources
during the build, and then the macros in <bits/c++config.h> are renamed
so that they don't have any effect in user code including our headers.

Also use larger type for result of filesystem::file_size to avoid
truncation of large values on 32-bit systems (PR 91947).

Backport from mainlne
2019-10-04  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/81091
	PR libstdc++/91947
	* configure.ac: Use AC_SYS_LARGEFILE to enable 64-bit file APIs.
	* config.h.in: Regenerate:
	* configure: Regenerate:
	* include/Makefile.am (${host_builddir}/largefile-config.h): New
	target to generate config header for filesystem library.
	(${host_builddir}/c++config.h): Rename macros for large file support.
	* include/Makefile.in: Regenerate.
	* src/c++17/fs_dir.cc: Include new config header.
	* src/c++17/fs_ops.cc: Likewise.
	(filesystem::file_size): Use uintmax_t for size.
	* src/filesystem/dir.cc: Include new config header.
	* src/filesystem/ops.cc: Likewise.
	(experimental::filesystem::file_size): Use uintmax_t for size.
2020-01-13 18:51:22 +00:00
Joseph Myers 5b6c608019 Fix libdecnumber handling of non-canonical BID significands (PR middle-end/91226).
As reported in bug 91226, the libdecnumber code used on the host to
interpret DFP values in the BID encoding fails, for _Decimal64 and
_Decimal128, to check for the case where a significand is too large
and so specified in IEEE 754 to be a non-canonical encoding of the
zero significand.  This patch adds the required handling of that case,
together with tests both using -O2 (testing this host code) and -O0
(testing libgcc code, which already worked before the patch); the
tests also cover _Decimal32, which already had the required check.

In the _Decimal128 case, where the code previously completely ignored
the case where the first four bits of the combination field are 1100,
1101 or 1110, the logic for determining the correct quantum exponent
in that case is also newly added by this patch, so tests are added for
that as well (again, libgcc already handled it correctly when the
conversion was done at runtime rather than at compile time).

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

	PR middle-end/91226
libdecnumber:
	* bid/bid2dpd_dpd2bid.c (_bid_to_dpd64): Handle non-canonical
	significands.
	(_bid_to_dpd128): Likewise.  Check for case where combination
	field starts 1100, 1101 or 1110.

gcc/testsuite:
	* gcc.dg/dfp/bid-non-canonical-d128-1.c,
	gcc.dg/dfp/bid-non-canonical-d128-2.c,
	gcc.dg/dfp/bid-non-canonical-d128-3.c,
	gcc.dg/dfp/bid-non-canonical-d128-4.c,
	gcc.dg/dfp/bid-non-canonical-d32-1.c,
	gcc.dg/dfp/bid-non-canonical-d32-2.c,
	gcc.dg/dfp/bid-non-canonical-d64-1.c,
	gcc.dg/dfp/bid-non-canonical-d64-2.c: New tests.

(cherry picked from commit 0fad54f0a8)
2020-01-13 18:45:04 +00:00
Jonathan Wakely c6f60a62b0 libstdc++: Fix documentation claiming to refer to mainline
* doc/xml/manual/status_cxx1998.xml: Replace incorrect statement
	about documenting mainline.
	* doc/xml/manual/status_cxx2011.xml: Likewise.
	* doc/xml/manual/status_cxx2014.xml: Likewise.
	* doc/xml/manual/status_cxx2017.xml: Likewise.
	* doc/xml/manual/status_cxx2020.xml: Likewise.
	* doc/xml/manual/status_cxxtr1.xml: Likewise.
	* doc/xml/manual/status_cxxtr24733.xml: Likewise.
	* doc/html/*: Regenerate.
2020-01-13 16:35:59 +00:00
Joseph Myers 6abd781f44 Update gcc_release to mainline version.
Will be needed for building subsequent releases on this branch from
git.

	Backport:

	2020-01-13  Joseph Myers  <joseph@codesourcery.com>

	* gcc_release: Use git instead of SVN.

	2019-11-20  Janne Blomqvist  <jb@gcc.gnu.org>

	* gcc_release: Use https for gcc.gnu.org.
2020-01-13 15:58:45 +00:00
GCC Administrator 45917f7d4d Daily bump. 2020-01-13 12:38:15 +00:00
GCC Administrator 4b9ea6845f Daily bump.
From-SVN: r280154
2020-01-11 00:16:10 +00:00
Martin Jambor b04e6eafd8 IPA-CP: Remove bogus static keyword (PR 92971)
2020-01-10  Martin Jambor  <mjambor@suse.cz>

	Backport from mainline
	2019-12-17  Martin Jambor  <mjambor@suse.cz>

        PR ipa/92971
        * Ipa-cp.c (cgraph_edge_brings_all_agg_vals_for_node): Fix
          definition of values, release memory on exit.

        testsuite/
        * gcc.dg/ipa/ipcp-agg-12.c: New test.

From-SVN: r280131
2020-01-10 20:30:56 +01:00
Przemyslaw Wirkus 2108fc2b90 backport: arm: Fix rmprofile multilibs when architecture includes +mp or +sec (PR target/93188)
When only the rmprofile multilibs are built, compiling for armv7-a
should select the generic v7 multilibs.  This used to work before +sec
and +mp were added to the architecture options but it was broken by
that update.  This patch fixes those variants and adds some tests to
ensure that they remain fixed 

gcc/ChangeLog:
2020-01-10  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	Backport from trunk
	PR target/93188
	* config/arm/t-multilib (MULTILIB_MATCHES): Add rules to match
	armv7-a{+mp,+sec,+mp+sec} to appropriate armv7 multilib variants
	when only building rm-profile multilibs.

gcc/testsuite/ChangeLog:
2020-01-10  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	Backport from trunk
	* gcc.target/arm/multilib.exp: Add new tests for rm-profile only.

From-SVN: r280123
2020-01-10 16:50:15 +00:00
Przemyslaw Wirkus 0e7ba3faa5 backport: arm: fix v[78]-r multilibs when configured with --with-multlib-list=aprofile
When gcc for Arm is configured with --with-multilib-list=aprofile a
misplaced endif directive in the makefile was causing the arm->thumb
mapping for multilibs to be omitted from the reuse rules.  This
resulted in the default multilib being picked rather than the thumb2
opimized version.

2020-01-10  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	Backport from trunk
	* config/arm/t-multilib: Use arm->thumb multilib reuse rules
	on a-profile.

From-SVN: r280122
2020-01-10 16:46:42 +00:00
Tobias Burnus 9a8610a5f0 Fortran] PR84135 fix merging dimension into codimension array spec
Backported from mainline
        2020-01-09  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/84135
        * array.c (gfc_set_array_spec): Fix shifting of codimensions
        when adding a dimension.
        * decl.c (merge_array_spec): Ditto. Fix using correct codimensions.


        Backported from mainline
        2020-01-09  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/84135
        * gfortran.dg/coarray/codimension_3.f90: New.

From-SVN: r280110
2020-01-10 15:37:29 +01:00
GCC Administrator be469640a1 Daily bump.
From-SVN: r280095
2020-01-10 00:16:10 +00:00
Jonathan Wakely 1ec66f8b7a libstdc++: Define memory resource key functions non-inline (PR93208)
This prevents the vtables and RTTI from being emitted in every object
file that uses memory_resource and monotonic_buffer_resource.

Objects compiled by GCC 9.1 or 9.2 will contain inline definitions of
the destructors, vtable and RTTI, but this is harmless. The inline
definitions have identical effects to the ones that are now defined in
libstdc++.so so it doesn't matter if the inline ones are used instead of
calling the symbols exported from the runtime library.

	PR libstdc++/93208
	* config/abi/pre/gnu.ver: Add new exports.
	* include/std/memory_resource (memory_resource::~memory_resource()):
	Do not define inline.
	(monotonic_buffer_resource::~monotonic_buffer_resource()): Likewise.
	* src/c++17/memory_resource.cc (memory_resource::~memory_resource()):
	Define.
	(monotonic_buffer_resource::~monotonic_buffer_resource()): Define.
	* testsuite/20_util/monotonic_buffer_resource/93208.cc: New test.

From-SVN: r280045
2020-01-09 13:18:37 +00:00
Martin Liska 7fa5c31cac Backport r279306
2020-01-09  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-12-12  Jan Hubicka  <hubicka@ucw.cz>

	* ipa-prop.c (read_ipcp_transformation_info): Fix undefined ordering
	of execution of function call parameters.

From-SVN: r280037
2020-01-09 10:33:28 +00:00
GCC Administrator 65d804ebcb Daily bump.
From-SVN: r280023
2020-01-09 00:16:12 +00:00
Jonathan Wakely 97173f7e2d libstdc++: Fix error handling in filesystem::remove_all (PR93201)
When recursing into a directory, any errors that occur while removing a
directory entry are ignored, because the subsequent increment of the
directory iterator clears the error_code object.

This fixes that bug by checking the result of each recursive operation
before incrementing. This is a change in observable behaviour, because
previously other directory entries would still be removed even if one
(or more) couldn't be removed due to errors. Now the operation stops on
the first error, which is what the code intended to do all along. The
standard doesn't specify what happens in this case (because the order
that the entries are processed is unspecified anyway).

	PR libstdc++/93201
	* src/c++17/fs_ops.cc (remove_all(const path&, error_code&)): Check
	result of recursive call before incrementing iterator.
	* src/filesystem/ops.cc (remove_all(const path&, error_code&)):
	Likewise.
	* testsuite/27_io/filesystem/operations/remove_all.cc: Check errors
	are reported correctly.
	* testsuite/experimental/filesystem/operations/remove_all.cc: Likewise.

From-SVN: r280020
2020-01-08 21:48:23 +00:00
Georg-Johann Lay e3da34115b backport: Add -nodevicespecs option for avr.
Backport from 2020-01-08 trunk r279995.

	Add -nodevicespecs option for avr.

	PR target/93182
	* config/avr/avr.opt (-nodevicespecs): New driver option.
	* config/avr/driver-avr.c (avr_devicespecs_file): Only issue
	"-specs=device-specs/..." if that option is not set.
	* doc/invoke.texi (AVR Options) <-nodevicespecs>: Document.

From-SVN: r279996
2020-01-08 09:46:07 +00:00
Ian Lance Taylor ae0b4a0a1c compiler: fix loopdepth tracking in array slicing expression in escape analysis
In the gc compiler, for slicing an array, its AST has an implicit
    address operation node. There isn't such node in the gofrontend
    AST. During the escape analysis, we create a fake node to mimic
    the gc compiler's behavior. For the fake node, the loopdepth was
    not tracked correctly, causing miscompilation. Since this is an
    address operation, do the same thing as we do for the address
    operator.
    
    Fixes golang/go#36404.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/213643

From-SVN: r279985
2020-01-08 00:38:34 +00:00
GCC Administrator ff95e3d4e8 Daily bump.
From-SVN: r279982
2020-01-08 00:16:15 +00:00
Iain Sandoe 2db255c38d [testsuite, Darwin] Fix failing darwin-version-1.c.
Recent platform linkers will no longer accept linking for a target
OS version less than 10.4. Recent SDKs no longer have the libgcc_s
shims used for 10.4 and 10.5. So we need to adjust tests that expect
these.

2020-01-07  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2020-01-05  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.dg/darwin-version-1.c: Adjust test to use different
	options for Darwin4-9 and Darwin10+.

From-SVN: r279975
2020-01-07 21:37:36 +00:00
GCC Administrator f082e6f5e1 Daily bump.
From-SVN: r279931
2020-01-07 00:16:09 +00:00
John David Anglin 163dbe3bd6 pa.md: Revert change to use ordered_comparison_operator instead of...
* config/pa/pa.md: Revert change to use ordered_comparison_operator
	instead of cmpib_comparison_operator in cmpib patterns.
	* config/pa/predicates.md (cmpib_comparison_operator): Revert removal
	of cmpib_comparison_operator.  Revise comment.

From-SVN: r279928
2020-01-06 23:52:55 +00:00
GCC Administrator 0509102277 Daily bump.
From-SVN: r279891
2020-01-06 00:16:11 +00:00
GCC Administrator 2f2fd9105e Daily bump.
From-SVN: r279882
2020-01-05 00:16:10 +00:00
GCC Administrator 21d48304f5 Daily bump.
From-SVN: r279875
2020-01-04 00:16:14 +00:00
GCC Administrator ca2ebbca46 Daily bump.
From-SVN: r279851
2020-01-03 00:16:28 +00:00
Jakub Jelinek 373a47c903 re PR c/90677 (gcc-9.1.0 fails to build __gcc_diag__ souce: error: 'cgraph_node' is not defined as a type)
PR c/90677
	* cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
	has not been found, rather than error_mark_node.

	* c-c++-common/pr90677-2.c: New test.

From-SVN: r279841
2020-01-02 18:36:50 +01:00
GCC Administrator 9717b8313d Daily bump.
From-SVN: r279826
2020-01-02 00:16:33 +00:00
John David Anglin 76787ebbff re PR target/67834 (Local references inside comdat groups)
PR target/67834
	* config/pa/pa.c (pa_elf_select_rtx_section): New.  Put references to
	COMDAT group function labels in .data.rel.ro.local section.
	* config/pa/pa32-linux.h (TARGET_ASM_SELECT_RTX_SECTION): Define.

From-SVN: r279824
2020-01-01 23:00:58 +00:00
John David Anglin 8caf619332 re PR target/93111 (FAIL: gfortran.fortran-torture/compile/pr32663.f, -O3 -g (internal compiler error))
PR target/93111
	* config/pa/pa.md (scc): Use ordered_comparison_operator instead of
	comparison_operator in B and S integer comparisons.  Likewise, use
	ordered_comparison_operator instead of cmpib_comparison_operator in
	cmpib patterns.
	* config/pa/predicates.md (cmpib_comparison_operator): Remove.

From-SVN: r279819
2020-01-01 20:57:04 +00:00
John David Anglin 220a86ec86 backport: re PR libgomp/93066 (libgomp/target.c:525:46: error: expected expression before ')' token)
Backport from mainline
	2019-12-30  John David Anglin  <danglin@gcc.gnu.org>

	PR libgomp/93066
	* inclhack.def (hpux_c99_inttypes3): Fix defines for INTPTR_MAX
	and UINTPTR_MAX, and missing define for SIZE_MAX.
	* fixincl.x: Regenerate.
	* tests/base/inttypes.h: Update for above fix.

From-SVN: r279814
2020-01-01 17:01:46 +00:00
GCC Administrator f7c28c368e Daily bump.
From-SVN: r279807
2020-01-01 00:16:13 +00:00
GCC Administrator a220243a40 Daily bump.
From-SVN: r279800
2019-12-31 00:16:32 +00:00
Joseph Myers ebdbb26ae5 * fi.po: Update.
From-SVN: r279789
2019-12-30 22:08:59 +00:00
Thomas Koenig 819855f2df backport: re PR fortran/92961 (ICE in gfc_zero_size_array, at fortran/arith.c:1680)
2019-12-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
    PR fortran/92961
    * fortran/ChangeLog: Added entry.
    * testsuite/ChangeLog: Added entry.

From-SVN: r279769
2019-12-30 15:27:08 +00:00
Thomas Koenig 2f25907603 Catch division by zero errors in array sizes.
2019-12-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/92961
	* gfortran.h (gfc_seen_div0): Add declaration.
	* arith.h (gfc_seen_div0): Add definition.
	(eval_intrinsic): For integer division by zero, set gfc_seen_div0.
	* decl.c (variable_decl):  If resolution resp. simplification
	fails for array spec and a division of zero error has been
	seen, return MATCH_ERROR.

2019-12-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/92961
	* gfortran.dg/arith_divide_2.f90: New test.

From-SVN: r279767
2019-12-30 13:10:37 +00:00
GCC Administrator 2885d75b32 Daily bump.
From-SVN: r279760
2019-12-30 00:16:09 +00:00
GCC Administrator 2d6a0f476e Daily bump.
From-SVN: r279750
2019-12-29 00:16:33 +00:00
GCC Administrator db409b7264 Daily bump.
From-SVN: r279745
2019-12-28 00:16:27 +00:00
GCC Administrator e774308387 Daily bump.
From-SVN: r279738
2019-12-27 00:16:29 +00:00
GCC Administrator 0de6397130 Daily bump.
From-SVN: r279734
2019-12-26 00:16:32 +00:00
Iain Sandoe 286b9428fe [Darwin, PPC] Use Darwin9 bundle header for Rosetta builds.
On Darwin10 it's possible to make a 32b PPC build using the
'Rosetta' emulator. However, these builds need to make use of
Darwin9 crts (for exes, dylibs and bundles). This adds the
change to cater for bundles.

gcc/ChangeLog:

	Backport from mainline.
	2019-12-14 Iain Sandoe <iain@sandoe.co.uk>

	* config/darwin.h (DARWIN_EXTRA_SPECS): Add new
	bundle spec. (DARWIN_BUNDLE1_SPEC): New.
	(STARTFILE_SPEC): Use darwin bundle spec.
	* config/rs6000/darwin.h (DARWIN_BUNDLE1_SPEC): New.
	(DARWIN_DYLIB1_SPEC): Delete duplicate.

From-SVN: r279732
2019-12-25 20:31:04 +00:00
GCC Administrator 47e35d17d3 Daily bump.
From-SVN: r279729
2019-12-25 00:16:11 +00:00
GCC Administrator 39c83f55a6 Daily bump.
From-SVN: r279722
2019-12-24 00:16:12 +00:00
GCC Administrator 3aa0d80870 Daily bump.
From-SVN: r279714
2019-12-23 00:16:10 +00:00
GCC Administrator 2cbeb96ebc Daily bump.
From-SVN: r279704
2019-12-22 00:16:11 +00:00
Paul Thomas 9c7b124504 re PR fortran/92753 (ICE in gfc_trans_call, at fortran/trans-stmt.c:392)
2019-12-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/92753
	* expr.c (find_inquiry_ref): Catch INQUIRY_LEN case, where the
	temporary expression has been converted to a constant and make
	the new expression accordingly. Correct the error in INQUIRY_RE
	and INQUIRY_IM cases. The original rather than the resolved
	expression was being used as the source in mpfr_set.

2019-12-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/92753
	* gfortran.dg/inquiry_type_ref_5.f90 : New test.

From-SVN: r279697
2019-12-21 18:21:21 +00:00
GCC Administrator 39f5d29e78 Daily bump.
From-SVN: r279689
2019-12-21 00:16:12 +00:00
Jakub Jelinek a0d677eac5 backport: re PR fortran/92977 (ICE in gfc_trans_omp_atomic, at fortran/trans-openmp.c:3526)
Backported from mainline
	2019-12-19  Jakub Jelinek  <jakub@redhat.com>

 	PR fortran/92977
	* frontend-passes.c (call_external_blas): Use || instead of |.

	PR fortran/92977
	* frontend-passes.c (in_omp_atomic): New variable.
	(cfe_expr_0, matmul_to_var_expr, matmul_temp_args,
	inline_matmul_assign, call_external_blas): Don't optimize in
	EXEC_OMP_ATOMIC.
	(optimize_namespace): Clear in_omp_atomic.
	(gfc_code_walker): Set in_omp_atomic for EXEC_OMP_ATOMIC, save/restore
	it around.

	* gfortran.dg/gomp/pr92977.f90: New test.

From-SVN: r279676
2019-12-20 18:45:56 +01:00
Jakub Jelinek 0d2440755c backport: re PR ipa/92357 (ICE in IPA pass fnsummary in openmp offload)
Backported from mainline
	2019-12-14  Jakub Jelinek  <jakub@redhat.com>

	PR ipa/92357
	* ipa-fnsummary.c (ipa_fn_summary_write): Use
	lto_symtab_encoder_iterator with lsei_start_function_in_partition and
	lsei_next_function_in_partition instead of walking all cgraph nodes
	in encoder.

From-SVN: r279675
2019-12-20 18:44:50 +01:00
Jakub Jelinek 6a6bf672cd backport: re PR tree-optimization/92930 (GCC incorrectly optimizes away __builtin_apply() calls)
Backported from mainline
	2019-12-14  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/92930
	* ipa-pure-const.c (special_builtin_state): Don't handle
	BUILT_IN_APPLY.

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

From-SVN: r279674
2019-12-20 18:44:16 +01:00
Jakub Jelinek 0cd9466156 backport: re PR target/92904 (varargs for __int128 is placed at an unaligned location and uses movdqa for the load)
Backported from mainline
	2019-12-12  Jakub Jelinek  <jakub@redhat.com>

	PR target/92904
	* config/i386/i386.c (ix86_gimplify_va_arg): If need_intregs and
	not need_temp, decrease alignment of the read because the GPR save
	area only guarantees 8-byte alignment.

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

From-SVN: r279673
2019-12-20 18:43:23 +01:00
Jakub Jelinek a4606f7f03 backport: re PR fortran/92899 ([OpenMP] ICE in gfc_trans_omp_atomic, at fortran/trans-openmp.c:3769)
Backported from mainline
	2019-12-11  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/92899
	* trans-openmp.c (gfc_trans_omp_atomic): For GFC_OMP_ATOMIC_SWAP,
	do look through conversion on expr2 if any.

	* testsuite/libgomp.fortran/atomic1.f90: New test.

From-SVN: r279672
2019-12-20 18:42:22 +01:00
Jakub Jelinek 86a5b74ed4 backport: re PR target/92723 (ICE in expand_shift_1, at expmed.c:2635)
Backported from mainline
	2019-12-11  Jakub Jelinek  <jakub@redhat.com>

	PR target/92723
	* tree-vect-patterns.c (vect_recog_rotate_pattern): If dt is not
	vect_internal_def, use oprnd1 as is, without trying to cast it.
	Formatting fix.

	* gcc.dg/vect/pr92723.c: New test.

From-SVN: r279671
2019-12-20 18:41:17 +01:00
Jakub Jelinek e8b31b2389 backport: PR c++/92831 - CWG 1299, not extending temporary lifetime for ?:
Backported from mainline
	2019-12-06  Jakub Jelinek  <jakub@redhat.com>

	PR c++/92831 - CWG 1299, not extending temporary lifetime for ?:
	* cp-tree.h (extend_ref_init_temps): Add a new argument with NULL
	default arg.
	* call.c (set_up_extended_ref_temp): Add COND_GUARD argument, pass it
	down to extend_ref_init_temps.  Before pushing cleanup, if COND_GUARD
	is non-NULL, create a bool temporary if needed, initialize to false
	and guard the cleanup with the temporary being true.
	(extend_ref_init_temps_1): Add COND_GUARD argument, pass it down
	to recursive calls and set_up_extended_ref_temp.  Handle COND_EXPR.
	(extend_ref_init_temps): Add COND_GUARD argument, pass it down to
	recursive calls and to extend_ref_init_temps_1.

	* g++.dg/cpp0x/temp-extend2.C: New test.

From-SVN: r279669
2019-12-20 18:37:45 +01:00
Jakub Jelinek bbd83540e0 backport: re PR fortran/92775 (Incorrect expression in DW_AT_byte_stride on an array)
Backported from mainline
	2019-12-06  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/92775
	* trans.h (struct lang_type, struct lang_decl): Remove span member.
	(GFC_DECL_SPAN, GFC_TYPE_ARRAY_SPAN): Remove macros.
	* trans-array.h (gfc_get_descriptor_offsets_for_info): Add another
	argument.
	* trans-array.c (gfc_get_descriptor_offsets_for_info): Add SPAN_OFF
	argument and initialize *SPAN_OFF to the offset of span field.
	* trans-types.c (gfc_get_array_descr_info): Adjust
	gfc_get_descriptor_offsets_for_info caller.  Compute elem_size
	as base->span instead of TYPE_SIZE_UNIT (etype) constant.

From-SVN: r279668
2019-12-20 18:36:48 +01:00
Jakub Jelinek ec2894778c backport: re PR fortran/92781 (ICE in convert_nonlocal_reference_op, at tree-nested.c:1065)
Backported from mainline
	2019-12-05  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/92781
	* trans-decl.c (gfc_get_symbol_decl): If sym->backend_decl is
	current_function_decl, add length to current rather than parent
	function and expect DECL_CONTEXT (length) to be current_function_decl.

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

From-SVN: r279667
2019-12-20 18:36:08 +01:00
Jakub Jelinek 4833bc1522 re PR fortran/92756 (ICE in lower_omp, at omp-low.c:12988)
PR fortran/92756
	* omp-low.c (check_omp_nesting_restrictions): If lang_GNU_Fortran,
	diagnose teams not closely nested inside of target.

	Backported from mainline
	2019-12-04  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/92756
	* gfortran.dg/gomp/teams1.f90: New test.

From-SVN: r279666
2019-12-20 18:35:18 +01:00
Jakub Jelinek d4a646993d backport: re PR c++/92732 (Bit-field of scoped enumeration type cannot be initialized)
Backported from mainline
	2019-12-03  Jakub Jelinek  <jakub@redhat.com>

	PR c++/92732
	* typeck2.c (digest_nsdmi_init): For bitfields, use
	DECL_BIT_FIELD_TYPE instead of TREE_TYPE.

	* g++.dg/cpp2a/bitfield3.C: Don't expect narrowing conversion
	warnings.
	* g++.dg/cpp2a/bitfield4.C: New test.

From-SVN: r279665
2019-12-20 18:34:14 +01:00
Jakub Jelinek ae1b211b58 backport: re PR c++/92695 (P1064R0 - virtual constexpr fails if object taken from array)
Backported from mainline
	2019-12-03  Jakub Jelinek  <jakub@redhat.com>

	PR c++/92695
	* constexpr.c (cxx_bind_parameters_in_call): For virtual calls,
	adjust the first argument to point to the derived object rather
	than its base.

	* g++.dg/cpp2a/constexpr-virtual14.C: New test.

From-SVN: r279664
2019-12-20 18:33:13 +01:00
Jakub Jelinek d9c7be4ce3 backport: re PR c++/92695 (P1064R0 - virtual constexpr fails if object taken from array)
Backported from mainline
	2019-12-02  Jakub Jelinek  <jakub@redhat.com>

	PR c++/92695
	* constexpr.c (cxx_eval_constant_expression) <case OBJ_TYPE_REF>: Use
	STRIP_NOPS before checking for ADDR_EXPR.

	* g++.dg/cpp2a/constexpr-virtual15.C: New test.

From-SVN: r279663
2019-12-20 18:32:23 +01:00
Jakub Jelinek 87b153d0c6 backport: re PR c++/60228 (ICE using lambda in #pragma omp declare reduction)
Backported from mainline
	2019-11-29  Jakub Jelinek  <jakub@redhat.com>

	PR c++/60228
	* parser.c (cp_parser_omp_declare_reduction_exprs): If
	processing_template_decl, wrap the combiner or initializer
	into EXPR_STMT.
	* decl.c (start_preparsed_function): Don't start a lambda scope
	for DECL_OMP_DECLARE_REDUCTION_P functions.
	(finish_function): Don't finish a lambda scope for
	DECL_OMP_DECLARE_REDUCTION_P functions, nor cp_fold_function
	them nor cp_genericize them.
	* mangle.c (decl_mangling_context): Look through
	DECL_OMP_DECLARE_REDUCTION_P functions.
	* semantics.c (expand_or_defer_fn_1): For DECL_OMP_DECLARE_REDUCTION_P
	functions, use tentative linkage, don't keep their bodies with
	-fkeep-inline-functions and return false at the end.

	* g++.dg/gomp/openmp-simd-2.C: Don't expect bodies for
	DECL_OMP_DECLARE_REDUCTION_P functions.

	* testsuite/libgomp.c++/udr-20.C: New test.
	* testsuite/libgomp.c++/udr-21.C: New test.

From-SVN: r279662
2019-12-20 18:30:38 +01:00
Jakub Jelinek e3edafbca9 backport: re PR c++/92695 (P1064R0 - virtual constexpr fails if object taken from array)
Backported from mainline
	2019-11-28  Jakub Jelinek  <jakub@redhat.com>

	PR c++/92695
	* decl2.c (mark_used): Don't call note_vague_linkage_fn for pure
	virtual functions, even if they are declared inline.

	* g++.dg/warn/inline3.C: New test.

From-SVN: r279661
2019-12-20 18:26:28 +01:00
Jakub Jelinek 70d8957fdc backport: re PR fortran/91944 (ICE in gfc_conv_array_initializer, at fortran/trans-array.c:6156)
Backported from mainline
	2019-11-27  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/91944
	* simplify.c (gfc_simplify_spread): Check gfc_init_expr_flag instead
	of gfc_current_ns->sym_root->n.sym->attr.flavor == FL_PARAMETER.

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

From-SVN: r279660
2019-12-20 18:25:39 +01:00
Jakub Jelinek f62d72ac70 backport: re PR c++/92524 (ICE in short program with constexpr and std::array)
Backported from mainline
	2019-11-27  Jakub Jelinek  <jakub@redhat.com>

	PR c++/92524
	* tree.c (replace_placeholders_r): Don't walk constructor elts with
	RANGE_EXPR indexes.

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

From-SVN: r279659
2019-12-20 18:24:30 +01:00
Jakub Jelinek 92059b60e6 backport: re PR debug/92664 (Wrong .debug_line section information when compiling stdin input with -g3)
Backported from mainline
	2019-11-27  Jakub Jelinek  <jakub@redhat.com>

	PR debug/92664
	* dwarf2out.c (lookup_filename): Use "<stdin>" instead of "".

From-SVN: r279658
2019-12-20 18:23:34 +01:00
Jakub Jelinek 04b2ff5f75 backport: re PR c++/92648 (Handling of unknown attributes)
Backported from mainline
	2019-11-26  Jakub Jelinek  <jakub@redhat.com>

	PR c++/92648
	* parser.c (cp_parser_std_attribute): For unknown attributes,
	skip balanced token seq instead of trying to parse
	attribute-argument-clause as expression list.

	* g++.dg/cpp0x/gen-attrs-71.C: New test.

From-SVN: r279655
2019-12-20 18:01:08 +01:00
Jakub Jelinek cfd17534ab backport: re PR c++/61414 (enum class bitfield size-checking needs a separate warning flag controlling it)
Backported from mainline
	2019-11-26  Jakub Jelinek  <jakub@redhat.com>

	PR c++/61414
	* c-attribs.c (handle_mode_attribute): Add mode attribute to
	ENUMERAL_TYPEs.

	* class.c (enum_to_min_precision): New hash_map.
	(enum_min_precision): New function.
	(check_bitfield_decl): Use it.

	* g++.dg/cpp0x/enum23.C: Remove xfail.
	* g++.dg/cpp0x/enum28.C: New test.

From-SVN: r279654
2019-12-20 18:00:02 +01:00
Jakub Jelinek 75003cdd23 backport: re PR sanitizer/92154 (new glibc breaks arm bootstrap due to libsanitizer)
Backported from mainline
	2019-11-26  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/92154
	* sanitizer_common/sanitizer_platform_limits_posix.h: Cherry-pick
	llvm-project revision 947f9692440836dcb8d88b74b69dd379d85974ce.
	* sanitizer_common/sanitizer_platform_limits_posix.cc: Likewise.

From-SVN: r279653
2019-12-20 17:58:35 +01:00
Jakub Jelinek 3981df84e9 backport: re PR tree-optimization/92644 (ICE in wide_int_to_tree_1, at tree.c:1530)
Backported from mainline
	2019-11-26  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/92644
	* tree-ssa-phiopt.c (minmax_replacement): Add INTEGRAL_TYPE_P check
	next to INTEGER_CST checks.

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

From-SVN: r279652
2019-12-20 17:58:07 +01:00
Jakub Jelinek 03830a6fbd backport: re PR inline-asm/92615 (ICE in extract_insn)
Backported from mainline
	2019-11-23  Jakub Jelinek  <jakub@redhat.com>

	PR target/92615
	* config/i386/i386.c (ix86_md_asm_adjust): If dest_mode is
	GET_MODE (dest), is not QImode, using ZERO_EXTEND and dest is not
	register_operand, force x into register before storing it into dest.
	Formatting fix.

	* gcc.target/i386/pr92615.c: New test.

From-SVN: r279651
2019-12-20 17:57:21 +01:00
Jakub Jelinek 275bc23e71 backport: re PR c/90677 (gcc-9.1.0 fails to build __gcc_diag__ souce: error: 'cgraph_node' is not defined as a type)
Backported from mainline
	2019-11-22  Jakub Jelinek  <jakub@redhat.com>

	PR c/90677
	* c-common.h (identifier_global_tag): Declare.
	* c-format.c (get_pointer_to_named_type): Renamed to ...
	(get_named_type): ... this.  Use identifier_global_tag instead of
	identifier_global_value, handle the return value being a TYPE_P.
	(init_dynamic_diag_info): Adjust get_pointer_to_named_type callers
	to call get_named_type instead.  Formatting fixes.

	* c-decl.c (identifier_global_tag): Define.

	* cp-objcp-common.c (identifier_global_tag): Define.

	* c-c++-common/pr90677.c: New test.

From-SVN: r279650
2019-12-20 17:56:30 +01:00
Jakub Jelinek 26f920e0d3 backport: re PR c++/90842 (ICE in poplevel, at cp/decl.c:585)
Backported from mainline
	2019-11-21  Jakub Jelinek  <jakub@redhat.com>
		    Jason Merrill  <jason@redhat.com>

	PR c++/90842
	* parser.c (cp_parser_decl_specifier_seq): For concept or typedef
	break early if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.
	For type specifiers, set CP_PARSER_FLAGS_NO_TYPE_DEFINITIONS
	if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR is set.

	* g++.dg/cpp1y/lambda-generic-90842.C: New test.

From-SVN: r279649
2019-12-20 17:55:06 +01:00
Roman Zhuykov 79fd3ecf19 Backport: rename tests to reference the correct PR
2019-12-20  Roman Zhuykov  <zhroma@ispras.ru>

	* gcc.dg/pr92951-1.c: Rename to ...
	* gcc.dg/pr92591-1.c: ... this.
	* gcc.dg/pr92951-2.c: Rename to ...
	* gcc.dg/pr92591-2.c: ... this.

From-SVN: r279646
2019-12-20 15:50:44 +00:00
Roman Zhuykov 944838ac15 modulo-sched: backport PR92591 fix from mainline
2019-12-20  Roman Zhuykov  <zhroma@ispras.ru>

modulo-sched: fix branch rescheduling issue (PR92591)

	PR rtl-optimization/92591
	* modulo-sched.c (ps_add_node_check_conflicts): Improve checking
	for history > 0 case.
	* params.def (sms-dfa-history): Limit to 16.

gcc/testsuite:

	PR rtl-optimization/92591
	* gcc.dg/pr92951-1.c: New test.
	* gcc.dg/pr92951-2.c: New test.

From-SVN: r279642
2019-12-20 15:05:12 +00:00
GCC Administrator d4ba80d153 Daily bump.
From-SVN: r279618
2019-12-20 00:16:23 +00:00
Georg-Johann Lay 30e2de8922 backport: re PR target/92545 (avr: support ATmega devices from the 0-series)
Backport support for some AVR devices from avrxmega3 family
	from SVN trunk r279309, r278387, r278389, r278478.
	PR target/92545
	* config/avr/avr-arch.h (avr_mcu_t) <flash_pm_offset>: New field.
	* config/avr/avr-devices.c (avr_mcu_types): Adjust initializers.
	* config/avr/avr-mcus.def (AVR_MCU): Add respective field.
	* config/avr/gen-avr-mmcu-specs.c (print_mcu)
	<*cpp, *cpp_mcu, *cpp_avrlibc, *link_pm_base_address>: Emit code
	for spec definitions.
	* config/avr/gen-avr-mmcu-texi.c: Rewrite.
	* doc/avr-mmcu.texi: Regenerate.

From-SVN: r279564
2019-12-19 08:59:28 +00:00
GCC Administrator 97027f6148 Daily bump.
From-SVN: r279559
2019-12-19 00:16:10 +00:00
GCC Administrator bcac6a5306 Daily bump.
From-SVN: r279482
2019-12-18 00:16:24 +00:00
Andreas Krebbel 37950cdce0 Fix PR92950: Wrong code emitted for movv1qi
The backend emits 16 bit memory loads for single element character
vector.  As a result the character will not be right justified in the
GPR.

gcc/ChangeLog:

2019-12-17  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2019-12-16  Andreas Krebbel  <krebbel@linux.ibm.com>

	PR target/92950
	* config/s390/vector.md ("mov<mode>" for V_8): Replace lh, lhy,
	and lhrl with llc.

gcc/testsuite/ChangeLog:

2019-12-17  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2019-12-16  Andreas Krebbel  <krebbel@linux.ibm.com>

	PR target/92950
	* gcc.target/s390/vector/pr92950.c: New test.

From-SVN: r279453
2019-12-17 08:37:26 +00:00
GCC Administrator fb22722dc3 Daily bump.
From-SVN: r279449
2019-12-17 00:16:08 +00:00
GCC Administrator 5368e50a4c Daily bump.
From-SVN: r279407
2019-12-16 00:16:16 +00:00
GCC Administrator 378c73e9ea Daily bump.
From-SVN: r279401
2019-12-15 00:16:08 +00:00
GCC Administrator 71e6ff2c90 Daily bump.
From-SVN: r279390
2019-12-14 00:16:34 +00:00
Jason Merrill 0852213266 PR c++/57082 - new X{} and private destructor.
build_new_1 already passes tf_no_cleanup to build_value_init, but in this
testcase we end up calling build_value_init by way of
build_special_member_call, so we need to pass it to that function as well.

	* init.c (build_new_1): Also pass tf_no_cleanup to
	build_special_member_call.

From-SVN: r279335
2019-12-13 00:10:11 -05:00
Jason Merrill 20de63acca PR c++/92859 - ADL and bit-field.
We also need unlowered_expr_type when considering associated types for ADL.

	* name-lookup.c: Use unlowered_expr_type.

From-SVN: r279334
2019-12-13 00:10:06 -05:00
Jason Merrill d69f32911e PR c++/92446 - deduction of class NTTP.
Another place we need to look through the VIEW_CONVERT_EXPR we add to make a
use of a class NTTP have const type.

	* pt.c (deducible_expression): Look through VIEW_CONVERT_EXPR.

From-SVN: r279333
2019-12-13 00:10:02 -05:00
Jason Merrill 549ab4bd54 PR c++/92150 - partial specialization with class NTTP.
Here unify was getting confused by the VIEW_CONVERT_EXPR we add in
finish_id_expression_1 to make class NTTP const when they're used in an
expression.

Tested x86_64-pc-linux-gnu, applying to trunk.

	* pt.c (unify): Handle VIEW_CONVERT_EXPR.

From-SVN: r279332
2019-12-13 00:09:57 -05:00
GCC Administrator 2d61a97d28 Daily bump.
From-SVN: r279329
2019-12-13 00:16:09 +00:00
Harald Anlauf 70e28f6c4a backport: re PR fortran/92898 (ICE in gfc_check_is_contiguous, at fortran/check.c:7157)
2019-12-12  Harald Anlauf  <anlauf@gmx.de>

	Backport from mainline
	PR fortran/92898
	* check.c (gfc_check_is_contiguous): Simplify check to handle
	arbitrary NULL() argument.

	PR fortran/92898
	* gfortran.dg/pr92898.f90: New test.

From-SVN: r279315
2019-12-12 20:46:03 +00:00
Claudiu Zissulescu 555e4a0539 [ARC] Enable using DCMPF for hard float comparisons (backports)
From-SVN: r279275
2019-12-12 10:31:56 +01:00
GCC Administrator a747ba6c36 Daily bump.
From-SVN: r279269
2019-12-12 00:16:17 +00:00
Steven G. Kargl 4ee5bc8d52 re PR fortran/92897 ([Coarray] ICE in gfc_set_array_spec, at fortran/array.c:864)
2019-12-11 Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/92897
	* array.c (gfc_set_array_spec):  Remove invalid assert() triggered
	by invalid Fortran code.
 
2019-12-11 Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/92897
	* gfortran.dg/pr92897.f90: New test.

From-SVN: r279249
2019-12-11 20:18:17 +00:00
Thomas SchwingeandJulian Brown d2174a8554 [OpenACC, libgomp] Initialize 'dynamic_refcount' whenever we initialize 'refcount'
Cases missed in r261813 "Update OpenACC data clause semantics to the 2.5
behavior".

	libgomp/
	* target.c (gomp_load_image_to_device, omp_target_associate_ptr):
	Initialize 'dynamic_refcount' whenever we initialize 'refcount'.

Backport trunk r279230.

Co-Authored-By: Julian Brown <julian@codesourcery.com>

From-SVN: r279238
2019-12-11 17:51:31 +01:00
Jonathan Wakely 0a0a04b446 libstdc++: Fix whitepace in changelog
From-SVN: r279224
2019-12-11 13:46:02 +00:00
Jonathan Wakely 5765ed7aaa PR libstdc++/91786 fix compilation error with Clang
Backport from mainline
2019-11-25  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/91786
	* include/bits/fs_path.h (filesystem_error): Move definition before
	the use in u8path.

From-SVN: r279223
2019-12-11 13:45:56 +00:00
Tobias Burnus a317399178 libgomp – spelling fixes, incl. omp_lib.h.in
Backported from mainline
        2019-12-11  Tobias Burnus  <tobias@codesourcery.com>

        * omp_lib.h.in: Fix spelling of function declaration
        omp_get_cancell(l)ation.

From-SVN: r279221
2019-12-11 14:36:02 +01:00
Thomas Rodgers 2f2585ed25 Restore enable_if lost during original import of pstl
* include/pstl/glue_numeric_defs.h: Restore enable_if lost during original
	import of pstl.
	* include/pstl/glue_numeric_impl.h: Likewise.

From-SVN: r279213
2019-12-11 03:38:53 +00:00
GCC Administrator 8a0fd542b7 Daily bump.
From-SVN: r279209
2019-12-11 00:16:15 +00:00
Kewen Lin fdfcc35d8a [PATCH] Fix PR91790 by considering different first_stmt_info for realign
As PR91790 exposed, when we have one slp node whose first_stmt_info_for_drptr
is different from first_stmt_info, it's possible that the first_stmt DR isn't
initialized yet before stmt SLP_TREE_SCALAR_STMTS[0] of slp node. So we
shouldn't use first_stmt_info for vect_setup_realignment, instead we can use
the one based on first_stmt_info_for_drptr DR with additional adjustment by
bumping the distance from first_stmt DR.

2019-12-10  Kewen Lin  <linkw@gcc.gnu.org>

  Backport from mainline
  2019-11-27  Kewen Lin  <linkw@gcc.gnu.org>

  PR tree-optimization/91790
  * gcc/tree-vect-stmts.c (vectorizable_load): Use the adjusted DR for
  vect_setup_realignment when first_stmt_info is different from
  first_stmt_info_for_drptr.

From-SVN: r279166
2019-12-10 12:54:21 +00:00
GCC Administrator 92df45de27 Daily bump.
From-SVN: r279149
2019-12-10 00:16:08 +00:00
Eric Botcazou 5348038186 tree.c (build_array_type_1): Add SET_CANONICAL parameter and compute TYPE_CANONICAL from the element type...
* tree.c (build_array_type_1): Add SET_CANONICAL parameter and compute
	TYPE_CANONICAL from the element type only if it is true.  Remove a few
	obsolete lines and adjust recursive call.
	(fld_process_array_type): Adjust call to build_array_type_1.
	(build_array_type): Likewise.
	(build_nonshared_array_type): Likewise.

From-SVN: r279134
2019-12-09 16:43:52 +00:00
Jonathan Wakely 591185df09 libstdc++: fix buffer overflow in path::operator+= (PR92853)
When concatenating a path ending in a root-directory onto another path,
we added an empty filename to the end of the path twice, but only
reserved space for one. That meant the second write went past the end of
the allocated buffer.

	PR libstdc++/92853
	* src/c++17/fs_path.cc (filesystem::path::operator+=(const path&)):
	Do not process a trailing directory separator twice.
	* testsuite/27_io/filesystem/path/concat/92853.cc: New test.
	* testsuite/27_io/filesystem/path/concat/path.cc: Test more cases.
	* testsuite/27_io/filesystem/path/concat/strings.cc: Test more cases.

From-SVN: r279115
2019-12-09 11:16:29 +00:00
GCC Administrator 56588b1de5 Daily bump.
From-SVN: r279103
2019-12-09 00:16:09 +00:00
GCC Administrator 282d6eaca4 Daily bump.
From-SVN: r279083
2019-12-08 00:16:17 +00:00
GCC Administrator 76740e6586 Daily bump.
From-SVN: r279071
2019-12-07 00:16:15 +00:00
GCC Administrator 2ffdbc52b6 Daily bump.
From-SVN: r279027
2019-12-06 00:16:39 +00:00
GCC Administrator e0d96e9bdb Daily bump.
From-SVN: r278979
2019-12-05 00:16:33 +00:00
GCC Administrator 10ab67a6bb Daily bump.
From-SVN: r278953
2019-12-04 00:16:36 +00:00
Sandra Loosemore 0684d63788 Fix bugs relating to flexibly-sized objects in nios2 backend.
2019-12-02  Sandra Loosemore  <sandra@codesourcery.com>

	Fix bugs relating to flexibly-sized objects in nios2 backend.
	
	PR target/92499

	gcc/c/
	* c-decl.c (flexible_array_type_p): Move to common code.

	gcc/
	* config/nios2/nios2.c (nios2_in_small_data_p): Do not consider
	objects of flexible types to be small if they have internal linkage
	or are declared extern.
	* config/nios2/nios2.h (ASM_OUTPUT_ALIGNED_LOCAL): Replace with...
	(ASM_OUTPUT_ALIGNED_DECL_LOCAL): ...this.  Use targetm.in_small_data_p
	instead of the size of the object initializer.
	* tree.c (flexible_array_type_p): Move from C front end, and
	generalize to handle fields in non-C structures.
	* tree.h (flexible_array_type_p): Declare.

	gcc/testsuite/
	* gcc.target/nios2/pr92499-1.c: New.
	* gcc.target/nios2/pr92499-2.c: New.
	* gcc.target/nios2/pr92499-3.c: New.

From-SVN: r278919
2019-12-02 21:44:41 -05:00
GCC Administrator 518db23288 Daily bump.
From-SVN: r278914
2019-12-03 00:16:08 +00:00
Li Jia He 417111c754 [rs6000]Fix PR92098 by backporting vec_cmp and vcond_mask supports to gcc-9-branch
As PR92132 added vec_cmp_* and vcond_mask_* supports on trunk.  This is a
partial backport of vec_{cmp,cmpu}<mode><mode> interface and related expand
to gcc-9-branch to fix PR92098.

gcc/ChangeLog

2019-12-02  Li Jia He  <helijia@linux.ibm.com>

	Partial backport from mainline
	PR target/92098
	2019-11-08  Kewen Lin  <linkw@gcc.gnu.org>

	PR target/92132
	* config/rs6000/predicates.md
	(signed_or_equality_comparison_operator): New predicate.
	(unsigned_or_equality_comparison_operator): Likewise.
	* config/rs6000/rs6000.md (one_cmpl<mode>2): Remove expand.
	(one_cmpl<mode>3_internal): Rename to one_cmpl<mode>2.
	* config/rs6000/vector.md
	(vcond_mask_<mode><mode> for VEC_I and VEC_I): New expand.
	(vec_cmp<mode><mode> for VEC_I and VEC_I): Likewise.
	(vec_cmpu<mode><mode> for VEC_I and VEC_I): Likewise.

gcc/testsuite/ChangeLog

2019-12-02  Li Jia He  <helijia@linux.ibm.com>

	Partial backport from trunk
	PR target/92098
	2019-11-08  Kewen Lin  <linkw@gcc.gnu.org>

	PR target/92132
	* gcc.target/powerpc/pr92132-fp-1.c: New test.
	* gcc.target/powerpc/pr92132-fp-2.c: New test.

From-SVN: r278892
2019-12-02 06:23:56 +00:00
GCC Administrator 036ffad65d Daily bump.
From-SVN: r278888
2019-12-02 00:16:09 +00:00
GCC Administrator 49947e9ee5 Daily bump.
From-SVN: r278882
2019-12-01 00:16:21 +00:00
Thomas Koenig a78fb9e714 backport: re PR fortran/91783 (ICE in gfc_dep_resolver, at fortran/dependency.c:2111)
Backport from trunk as an insurance policy.

2019-11-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/91783
    * gfortran.dg/dependency_56.f90: New test. Backport from trunk on
    the off-chance that somebody backports something that will break
    this test case.

From-SVN: r278874
2019-11-30 15:08:32 +00:00
GCC Administrator 9f2cd8b16f Daily bump.
From-SVN: r278867
2019-11-30 00:16:16 +00:00
Harald Anlauf a9e150ae95 backport: re PR fortran/92629 (internal compiler error: in convert_mpz_to_unsigned, at fortran/simplify.c:173)
2019-11-29  Harald Anlauf  <anlauf@gmx.de>

	Backport from mainline
	PR fortran/92629
	* simplify.c (convert_mpz_to_unsigned): Skip assert for argument
	range when -fno-range-check is specified.

	PR fortran/92629
	* gfortran.dg/pr92629.f90: New testcase.

From-SVN: r278862
2019-11-29 20:56:11 +00:00
Tobias Burnus 8ec615ce21 Fix testcase - was missing -fopenacc
Backport from mainline
        2019-11-29 Tobias Burnus  <tobias@codesourcery.com>
        
        PR ipa/84963
        * gfortran.dg/goacc/pr84963.f90: Use dg-additional-options not
        dg-options as otherwise -fopenacc is not used.

From-SVN: r278838
2019-11-29 13:27:34 +01:00
Eric Botcazou d6ffddab11 re PR ada/92489 (internal error on Invalid_Value Attribute attribute)
PR ada/92489
	Backport from mainline
	2019-07-01  Ed Schonberg  <schonberg@adacore.com>

	* exp_attr.adb (Expand_Attribute_Reference, case Invalid_Value):
	Resolve result of call to Get_Simple_Init_Val, which may be a
	conversion of a literal.

From-SVN: r278830
2019-11-29 09:07:53 +00:00
GCC Administrator 3da8ae40a0 Daily bump.
From-SVN: r278824
2019-11-29 00:16:08 +00:00
GCC Administrator cef5d743cd Daily bump.
From-SVN: r278792
2019-11-28 00:16:09 +00:00
Richard Biener de819c7eb2 backport: re PR tree-optimization/92222 (ice in useless_type_conversion_p, at gimple-expr.c:86)
2019-11-27  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-10-25  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92222
	* tree-vect-slp.c (_slp_oprnd_info::first_pattern): Remove.
	(_slp_oprnd_info::second_pattern): Likewise.
	(_slp_oprnd_info::any_pattern): New.
	(vect_create_oprnd_info): Adjust.
	(vect_get_and_check_slp_defs): Compute whether any stmt is
	in a pattern.
	(vect_build_slp_tree_2): Avoid building up a node from scalars
	if any of the operand defs, not just the first, is in a pattern.

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

From-SVN: r278763
2019-11-27 12:09:36 +00:00
GCC Administrator d91c3fdb69 Daily bump.
From-SVN: r278750
2019-11-27 00:16:15 +00:00
Jerry DeLisle 5b1a33584c backport: re PR libfortran/92100 (Formatted stream IO irreproducible read with binary data in file)
2019-11-26  Jerry DeLisle  <jvdelisle@gcc.ngu.org>

        Backport from mainline
        PR fortran/92100
        io/transfer.c (data_transfer_init_worker): Use fbuf_reset
        instead of fbuf_flush before the seek. Note that fbuf_reset
        calls fbuf_flush and adjusts fbuf pointers.

        gfortran.dg/streamio_18.f90: New test.

From-SVN: r278740
2019-11-26 22:56:24 +00:00
GCC Administrator 1d6045e177 Daily bump.
From-SVN: r278715
2019-11-26 00:16:11 +00:00
Thomas KoenigandHarald Anlauf f61f7b6949 Fix EOF handling for arrays.
2019-11-25  Thomas Koenig  <tkoenig@gcc.gnu.org>
	Harald Anlauf <anlauf@gmx.de>

	Backport from trunk
	PR fortran/92569
	* io/transfer.c (transfer_array_inner):  If position is
	at AFTER_ENDFILE in current unit, return from data loop.

2019-11-25  Thomas Koenig  <tkoenig@gcc.gnu.org>
	Harald Anlauf <anlauf@gmx.de>

	Backport from trunk
	PR fortran/92569
	* gfortran.dg/eof_6.f90: New test.


Co-Authored-By: Harald Anlauf <anlauf@gmx.de>

From-SVN: r278702
2019-11-25 20:04:28 +00:00
Tobias Burnus f87738fca6 Fortran] PR 92050 - fix ICE with -fcheck=all
Backport from mainline
        2019-10-11  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92050
        * trans-expr.c (gfc_conv_procedure_call): Handle code generated
        by -fcheck=all.

        PR fortran/92050
        * gfortran.dg/pr92050.f90: New.

From-SVN: r278689
2019-11-25 15:33:32 +01:00
Eric Botcazou 353ba0cdea re PR ada/92362 (double elaboration of expression in Address aspect)
PR ada/92362
	* gcc-interface/trans.c (gnat_to_gnu) <N_Attribute_Definition_Clause>:
	Use a temporary instead of clobbering the result with a freeze node.

From-SVN: r278676
2019-11-25 10:52:33 +00:00
Eric Botcazou 09020f7a38 re PR ada/92575 (couple of suspicious assignments in expect.c)
PR ada/92575
	* expect.c (__gnat_expect_poll [VMS, HPUX]): Fix typo.

From-SVN: r278672
2019-11-25 10:30:41 +00:00
GCC Administrator acb917ea84 Daily bump.
From-SVN: r278662
2019-11-25 00:16:15 +00:00
GCC Administrator f5b57bbf7f Daily bump.
From-SVN: r278652
2019-11-24 00:16:09 +00:00
GCC Administrator 6b082a863d Daily bump.
From-SVN: r278637
2019-11-23 00:16:16 +00:00
Jonathan Wakely a84ffd9675 PR libstdc++/92267 fix ABI change in deque iterators
Defaulting the copy constructor on its first declaration made it change
from user-provided (and non-trivial) to implicitly-defined (and
trivial). This caused an ABI incompatibility between GCC 8 and GCC 9,
where functions taking a deque iterator disagree on the argument passing
convention.

Backport from mainline
2019-10-29  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/92267
	* include/bits/stl_deque.h (_Deque_iterator(const _Deque_iterator&)):
	Do not define as defaulted.
	* testsuite/23_containers/deque/types/92267.cc: New test.

From-SVN: r278614
2019-11-22 12:36:18 +00:00
GCC Administrator efe923e672 Daily bump.
From-SVN: r278606
2019-11-22 00:16:34 +00:00
Jakub Jelinek ca124a1dee re PR tree-optimization/91355 (optimized code does not call destructor while unwinding after exception)
PR tree-optimization/91355
	* tree-ssa-sink.c (select_best_block): Use >= rather than >
	for early_bb scaled count with best_bb count comparison.

	* g++.dg/torture/pr91355.C: New test.

From-SVN: r278551
2019-11-21 14:53:57 +01:00
Richard Biener 0351a08f17 revert: re PR tree-optimization/91790 (ICE: verify_ssa failed (error: definition in block 2 follows the use))
2019-11-21  Richard Biener  <rguenther@suse.de>

	Revert
	2019-09-17  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91790
	* tree-vect-stmts.c (vectorizable_load): For BB vectorization
	use the correct DR for setting up realignment.

From-SVN: r278545
2019-11-21 09:18:06 +00:00
GCC Administrator 17192e31d0 Daily bump.
From-SVN: r278536
2019-11-21 00:16:27 +00:00
Peter Bergner 8ea83ef1ef Backport fix for PR92090.
gcc/
	Backport from mainline
	2019-11-07  Peter Bergner <bergner@linux.ibm.com>

	PR other/92090
	* config/rs6000/predicates.md (input_operand): Allow MODE_PARTIAL_INT
	modes for integer constants.

gcc/testsuite/
	Backport from mainline
	2019-11-13  David Edelsohn  <dje.gcc@gmail.com>

	* gcc.target/powerpc/pr92090.c: Limit -mbig to powerpc64le-*-*.
	* gcc.target/powerpc/pr92090-2.c: Likewise.

	2019-11-07  Peter Bergner <bergner@linux.ibm.com>

	PR other/92090
	* gcc.target/powerpc/pr92090-2.c: New test.

	2019-11-07  Peter Bergner <bergner@linux.ibm.com>

	PR other/92090
	* gcc.target/powerpc/pr92090.c: New test.

From-SVN: r278527
2019-11-20 14:42:41 -06:00
Michael Matz 40f600848f re PR middle-end/90796 (GCC: O2 vs O3 output differs on simple test)
Fix PR90796

       PR middle-end/90796
       * gimple-loop-jam.c (any_access_function_variant_p): New function.
       (adjust_unroll_factor): Use it to constrain safety, new parameter.
       (tree_loop_unroll_and_jam): Adjust call and profitable unroll factor.

testsuite/
       Backport from mainline
       PR middle-end/90796
       * gcc.dg/unroll-and-jam.c: Disable loop-invariant motion and adjust.

       PR middle-end/90796
       * gcc.dg/unroll-and-jam.c: Add three invalid and one valid case.

From-SVN: r278512
2019-11-20 16:51:10 +00:00
Joseph Myers 999904b2b2 Document -Wc11-c2x-compat.
My patch that added initial C2X support and associated command-line
options missed documenting -Wc11-c2x-compat although the other options
were properly documented.  This patch adds the missing documentation.

Tested with "make info" and "make pdf".

	* doc/invoke.texi (-Wc11-c2x-compat): Document.

From-SVN: r278511
2019-11-20 16:43:14 +00:00
Jakub Jelinek 38527cf595 re PR c++/90767 (jumbled error message with this and const)
PR c++/90767
	* call.c (complain_about_no_candidates_for_method_call): If
	conv->from is not a type, pass to complain_about_bad_argument
	lvalue_type of conv->from.

	* g++.dg/diagnostic/pr90767-1.C: New test.
	* g++.dg/diagnostic/pr90767-2.C: New test.

From-SVN: r278492
2019-11-20 10:55:56 +01:00
Jakub Jelinek 369a103aa9 re PR middle-end/90840 (ICE in simplify_subreg, at simplify-rtx.c:6441)
PR middle-end/90840
	* expmed.c (store_bit_field_1): Handle the case where op0 is not a MEM
	and has a mode that doesn't have corresponding integral type.

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

From-SVN: r278491
2019-11-20 10:55:01 +01:00
Jakub Jelinek a52713cbf0 re PR target/90867 (Multiplication or typecast of integer and double always zero when...)
PR target/90867
	* config/i386/i386.c (ix86_valid_target_attribute_tree): Don't
	clear opts->x_ix86_isa_flags{,2} here...
	(ix86_valid_target_attribute_inner_p): ... but here when seeing
	arch=.  Also clear opts->x_ix86_isa_flags{,2}_explicit.

	* gcc.target/i386/pr90867.c: New test.

From-SVN: r278490
2019-11-20 10:54:02 +01:00
Jakub Jelinek 4251fa113d re PR c/90898 (ICE in insert_clobber_before_stack_restore, at tree-ssa-ccp.c:2112)
PR c/90898
	* tree-ssa-ccp.c (insert_clobber_before_stack_restore): Remove
	assertion.
	(insert_clobbers_for_var): Fix a typo in function comment.

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

From-SVN: r278489
2019-11-20 10:53:15 +01:00
Jakub Jelinek 9269f9603a backport: re PR c++/92504 (ICE on gcc-9 -fopenmp: internal compiler error: tree check: expected tree that contains 'decl common' structure, have 'baselink' in get_inner_reference, at expr.c:7238)
Backported from mainline
	2019-11-19  Jakub Jelinek  <jakub@redhat.com>

	PR c++/92504
	* semantics.c (handle_omp_for_class_iterator): Don't call
	cp_fully_fold on cond.

	* g++.dg/gomp/pr92504.C: New test.

From-SVN: r278488
2019-11-20 10:52:27 +01:00
GCC Administrator e962b8f364 Daily bump.
From-SVN: r278473
2019-11-20 00:16:14 +00:00
Jakub Jelinek a7b2d1b348 re PR middle-end/91450 (__builtin_mul_overflow(A,B,R) wrong code if product < 0, *R is unsigned, and !(A&B))
PR middle-end/91450
	* internal-fn.c (expand_mul_overflow): For s1 * s2 -> ur, if one
	operand is negative and one non-negative, compare the non-negative
	one against 0 rather than comparing s1 & s2 against 0.  Otherwise,
	don't compare (s1 & s2) == 0, but compare separately both s1 == 0
	and s2 == 0, unless one of them is known to be negative.  Remove
	tem2 variable, use tem where tem2 has been used before.

	* gcc.c-torture/execute/pr91450-1.c: New test.
	* gcc.c-torture/execute/pr91450-2.c: New test.

From-SVN: r278438
2019-11-19 10:26:23 +01:00
Eric Botcazou 6c7d93c58a * doc/invoke.texi (-gno-internal-reset-location-views): Fix typo.
From-SVN: r278435
2019-11-19 09:12:36 +00:00
GCC Administrator 07151e4af3 Daily bump.
From-SVN: r278426
2019-11-19 00:16:20 +00:00
Segher Boessenkool 02955765b7 backport: rs6000.md (rs6000_set_fpscr_drn): Use ULL on big hexadecimal literal.
Backport from trunk
	2019-11-12  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.md (rs6000_set_fpscr_drn): Use ULL on big
	hexadecimal literal.

From-SVN: r278420
2019-11-18 20:29:03 +01:00
Tamar Christina f79b23b557 AArch64: Correct HWCAP for fp16fml
Backport from mainline
	2019-09-24  Stamatis Markianos-Wright  <stam.markianos-wright@arm.com>

	* config/aarch64/aarch64-option-extensions.def (fp16fml):
	Update hwcap string for fp16fml.

From-SVN: r278412
2019-11-18 15:29:40 +00:00
GCC Administrator 3beea0c0cb Daily bump.
From-SVN: r278381
2019-11-18 00:16:09 +00:00
John David Anglin dbbbe55ecd linux-atomic.c (__kernel_cmpxchg): Change argument 1 to volatile void *.
* config/pa/linux-atomic.c (__kernel_cmpxchg): Change argument 1 to
	volatile void *.  Remove trap check.
	(__kernel_cmpxchg2): Likewise.
	(FETCH_AND_OP_2): Adjust operand types.
	(OP_AND_FETCH_2): Likewise.
	(FETCH_AND_OP_WORD): Likewise.
	(OP_AND_FETCH_WORD): Likewise.
	(COMPARE_AND_SWAP_2): Likewise.
	(__sync_val_compare_and_swap_4): Likewise.
	(__sync_bool_compare_and_swap_4): Likewise.
	(SYNC_LOCK_TEST_AND_SET_2): Likewise.
	(__sync_lock_test_and_set_4): Likewise.
	(SYNC_LOCK_RELEASE_1): Likewise.  Use __kernel_cmpxchg2 for release.
	(__sync_lock_release_4): Adjust operand types.  Use __kernel_cmpxchg
	for release.
	(__sync_lock_release_8): Remove.

From-SVN: r278378
2019-11-17 23:15:29 +00:00
GCC Administrator 8d6905de01 Daily bump.
From-SVN: r278368
2019-11-17 00:16:09 +00:00
GCC Administrator 74c27c3c33 Daily bump.
From-SVN: r278327
2019-11-16 00:16:10 +00:00
Ilya Leoshkevich 50a969f171 Free dominance info at the beginning of pass_jump_after_combine
try_forward_edges does not update dominance info, and merge_blocks
relies on it being up-to-date.  In PR92430 stale dominance info makes
merge_blocks produce a loop in the dominator tree, which in turn makes
delete_basic_block loop forever.

Fix by freeing dominance info at the beginning of cleanup_cfg.

Also, since the whole point of this pass is to perform jump threading
(other cleanups are not valuable at this point), skip it completely when
flag_thread_jumps is not set.

gcc/ChangeLog:

2019-11-15  Ilya Leoshkevich  <iii@linux.ibm.com>

	Backport from mainline
	PR rtl-optimization/92430
	* cfgcleanup.c (pass_jump_after_combine::gate): New function.
	(pass_jump_after_combine::execute): Free
	dominance info at the beginning.

gcc/testsuite/ChangeLog:

2019-11-15  Ilya Leoshkevich  <iii@linux.ibm.com>

	Backport from mainline
	PR rtl-optimization/92430
	* gcc.dg/pr92430.c: New test (from Arseny Solokha).

From-SVN: r278291
2019-11-15 12:55:05 +00:00
GCC Administrator bb2d60189c Daily bump.
From-SVN: r278271
2019-11-15 00:16:08 +00:00
Claudiu Zissulescu fc2d906f47 [ARC] Backport from mainline r278056,r278057
From-SVN: r278215
2019-11-14 10:58:19 +01:00
Martin Liska 48cb09679f Backport r278210
2019-11-14  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-11-14  Martin Liska  <mliska@suse.cz>

	PR target/92389
	* config/i386/i386.h: Add PTA_AVX512VPOPCNTDQ to
	PTA_ICELAKE_CLIENT which is later interited by
	PTA_ICELAKE_SERVER and PTA_TIGERLAKE.

From-SVN: r278214
2019-11-14 09:45:37 +00:00
Tobias Burnus 8afd44a899 Fix gfortran.dg/ISO_Fortran_binding_17.c using rel. #include
PR fortran/92470
        PR fortran/92500
        * gfortran.dg/ISO_Fortran_binding_17.c: Include
        ISO_Fortran_binding.h with relative path.

From-SVN: r278201
2019-11-14 09:02:42 +01:00
GCC Administrator 39ef2bb26b Daily bump.
From-SVN: r278188
2019-11-14 00:16:22 +00:00
Dragan Mladjenovic b8449384f3 Sanitize the constant argument for rotr<mode>3
This was dormant for quite some time, but it started happening for me
on gcc.c-torture/compile/pr65153.c sometime after r276645 for -mabi=32 linux runs.

The pattern accepts any SMALL_OPERAND constant value while it asserts during the final
that the value is in the mode size range. I this case it happens that combine_and_move_insns
during ira makes a pattern with negative "shift count" which fails at final stage.

This simple fix just truncates the constant operand to mode size the same as shift patterns.

gcc/ChangeLog:

2019-11-13  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

	Backport from mainline
	* config/mips/mips.md (rotr<mode>3): Sanitize the constant argument
	instead of asserting its value.

From-SVN: r278154
2019-11-13 19:20:15 +00:00
Tobias Burnus c078a83217 PR fortran/92470 Fixes for CFI_address
Backport from mainline

        libgfortran/
        2019-11-13  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92470
        * runtime/ISO_Fortran_binding.c (CFI_establish): Set lower_bound to 0
        also for CFI_attribute_other.

        2019-11-12  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92470
        * runtime/ISO_Fortran_binding.c (CFI_address): Handle non-zero
        lower_bound; update error message.
        (CFI_allocate): Fix comment typo.
        (CFI_establish): Fix identation, fix typos, don't check values of 'dv'
        argument.

        gcc/testsuite/
        2019-11-13  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92470
        * gfortran.dg/ISO_Fortran_binding_1.c (establish_c): Add assert for
        lower_bound == 0.

        2019-11-12  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92470
        * gfortran.dg/ISO_Fortran_binding_17.c: New.
        * gfortran.dg/ISO_Fortran_binding_17.f90: New.
        * gfortran.dg/ISO_Fortran_binding_1.c (elemental_mult_c, allocate_c,
        section_c, select_part_c): Update for CFI_{address} changes;
        add asserts.

From-SVN: r278143
2019-11-13 16:06:47 +01:00
Eric Botcazou 46a6d3cad7 c-ada-spec.c (get_underlying_decl): Do not look through typedefs.
* c-ada-spec.c (get_underlying_decl): Do not look through typedefs.
	(dump_forward_type): Do not generate a declaration for function types.
	(dump_nested_type) <ARRAY_TYPE>: Do not generate a nested declaration
	of the component type if it is declared in another file.

From-SVN: r278130
2019-11-13 11:59:20 +00:00
GCC Administrator fb3bf22d2c Daily bump.
From-SVN: r278110
2019-11-13 00:16:21 +00:00
GCC Administrator 93265a71b6 Daily bump.
From-SVN: r278073
2019-11-12 00:16:50 +00:00
Richard Biener 949b1f43b4 backport: re PR tree-optimization/90930 (Excessive memory consumption)
2019-11-11  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-06-25  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90930
	* tree-ssa-reassoc.c (reassociate_bb): Only rewrite expression
	into parallel form in the last pass instance.

	* gcc.dg/tree-ssa/reassoc-24.c: Adjust.
	* gcc.dg/tree-ssa/reassoc-25.c: Likewise.

From-SVN: r278059
2019-11-11 16:07:54 +00:00
H.J. Lu d10e434168 [PR87833] x86: Put -fPIC and -shared the last to create offload image
On x86, since -fPIC and -shared should be used to create offload image,
we put them the last to properly create offload image.

2019-11-11  H.J. Lu  <hjl.tools@gmail.com>

	PR target/87833
	* config/i386/intelmic-mkoffload.c (prepare_target_image): Put
	-fPIC and -shared the last to create offload image.

Backport from trunk r278041.

From-SVN: r278042
2019-11-11 09:39:10 +01:00
Thomas Schwinge c14d05e62f Assert 'offset2' instead of 'offset' in 'gcc/gimplify.c:gimplify_scan_omp_clauses'
... to fix a long-time typo/copy'n'past-o.

	gcc/
	* gimplify.c (gimplify_scan_omp_clauses): Assert 'offset2' instead
	of 'offset'.

Backport from trunk r278038.

From-SVN: r278039
2019-11-11 09:19:23 +01:00
Thomas Schwinge 548fe28fbe [build] Properly track GCC language configure fragments
The 'gcc/configure' script sources all 'gcc/*/config-lang.in' files, but fails
to emit such dependency information into the build machinery.  That means,
currently, when something gets changed in a 'gcc/*/config-lang.in' file, this
is not noticed, and doesn't propagate through the build machinery.

Handling of configure fragments is modelled in the same way as it already
exists for Makefile fragments.

	gcc/
	* Makefile.in (LANG_CONFIGUREFRAGS): Define.
	(config.status): Use/depend on it.
	* configure.ac (all_lang_configurefrags): Track, 'AC_SUBST'.
	* configure: Regenerate.

Backport from trunk r278035.

From-SVN: r278036
2019-11-11 09:06:25 +01:00
GCC Administrator 758914048d Daily bump.
From-SVN: r278031
2019-11-11 00:16:13 +00:00
Thomas Koenig df6a2bb457 Put vtab into RO section, same for __def_init if it contains an initializer.
2019-11-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/92113
	* trans-decl.c (gfc_get_symbol_decl): If __def_init actually
	contains a value, put it into  the read-only section.

From-SVN: r278015
2019-11-10 11:19:13 +00:00
Thomas Koenig 8f2283291e Commit symbol for external BLAS routine when translating MATMUL to *GEMM.
2019-11-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/92321
	* frontend-passes.c (call_external_blas): Commit symbol for
	external BLAS routine.

2019-11-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/92321
	* gfortran.dg/matmul_blas_2.f90: New test.

From-SVN: r278014
2019-11-10 09:34:42 +00:00
GCC Administrator 49d1c20b3c Daily bump.
From-SVN: r278012
2019-11-10 00:16:18 +00:00
John David Anglin 83c8f96b32 backport: pa.md (memory_barrier): Revise to use ldcw barriers.
Backport from mainline
	2019-11-07  John David Anglin  <danglin@gcc.gnu.org>

	* config/pa/pa.md (memory_barrier): Revise to use ldcw barriers.
	Enhance comment.
	(memory_barrier_coherent, memory_barrier_64, memory_barrier_32): New
	insn patterns using ldcw instruction.
	(memory_barrier): Remove insn pattern using sync instruction.
	* config/pa/pa.opt (coherent-ldcw): New option.
	(ordered): New option.

From-SVN: r278001
2019-11-09 14:19:36 +00:00
GCC Administrator 46b26ef82a Daily bump.
From-SVN: r277998
2019-11-09 00:16:15 +00:00
Marek Polacek 4d304b7d1b PR c++/90998 - ICE with copy elision in init by ctor and -Wconversion.
* call.c (joust): Don't attempt to warn if ->second_conv is null.

	* g++.dg/cpp0x/overload-conv-4.C: New test.

From-SVN: r277992
2019-11-08 21:52:39 +00:00
Jakub Jelinek 05b77d39e2 re PR middle-end/92384 (Empty class instances have different equal testing result among GCC versions)
PR c++/92384
	* function.c (assign_parm_setup_block, assign_parm_setup_stack): Don't
	copy TYPE_EMPTY_P arguments from data->entry_parm to data->stack_parm
	slot.
	(assign_parms): For TREE_ADDRESSABLE parms with TYPE_EMPTY_P type
	force creation of a unique data.stack_parm slot.

	* g++.dg/torture/pr92384.C: New test.

From-SVN: r277989
2019-11-08 20:02:24 +01:00
Jakub Jelinek 1f3b59d4c6 backport: re PR c++/92343 ([[likely]]/[[unlikely]] prevent method from being a constant expression)
Backported from mainline
	2019-11-05  Jakub Jelinek  <jakub@redhat.com>

	PR c++/92343
	* constexpr.c (potential_constant_expression_1): Return true rather
	than false for PREDICT_EXPR.

	* g++.dg/cpp2a/attr-likely6.C: New test.

From-SVN: r277988
2019-11-08 20:00:02 +01:00
Jakub Jelinek 299a554aa4 backport: re PR preprocessor/92296 (internal compiler error: Segmentation fault #pragma push_macro("__LINE__"))
Backported from mainline
	2019-10-31  Jakub Jelinek  <jakub@redhat.com>

	PR preprocessor/92296
	* internal.h (struct def_pragma_macro): Add is_builtin bitfield.
	(_cpp_restore_special_builtin): Declare.
	* init.c (_cpp_restore_special_builtin): New function.
	* directives.c (do_pragma_push_macro): For NT_BUILTIN_MACRO
	set is_builtin and don't try to grab definition.
	(cpp_pop_definition): Use _cpp_restore_special_builtin to restore
	builtin macros.

	* c-c++-common/cpp/pr92296-1.c: New test.
	* c-c++-common/cpp/pr92296-2.c: New test.

From-SVN: r277987
2019-11-08 19:59:14 +01:00
Jakub Jelinek 66339b2971 backport: re PR middle-end/92231 (ICE in gimple_fold_stmt_to_constant_1)
Backported from mainline
	2019-10-31  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/92231
	* tree.h (fndecl_built_in_p): Use fndecl_built_in_p instead of
	DECL_BUILT_IN in comment.  Remove redundant ()s around return
	argument.
	* tree.c (free_lang_data_in_decl): Check if var is FUNCTION_DECL
	before calling fndecl_built_in_p.
	* gimple-fold.c (gimple_fold_stmt_to_constant_1): Check if
	TREE_OPERAND (fn, 0) is a FUNCTION_DECL before calling
	fndecl_built_in_p on it.

	* lto-lang.c (handle_const_attribute): Don't call fndecl_built_in_p
	on *node that is not FUNCTION_DECL.

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

From-SVN: r277986
2019-11-08 19:58:14 +01:00
Jakub Jelinek 8af68eba76 backport: re PR c++/90947 (Simple lookup table of array of strings is miscompiled)
Backported from mainline
	2019-10-31  Jakub Jelinek  <jakub@redhat.com>

	PR c++/90947
	* tree.h (type_initializer_zero_p): Remove.
	* tree.c (type_initializer_zero_p): Remove.

	* cp-tree.h (type_initializer_zero_p): Declare.
	* decl.c (reshape_init_array_1): Formatting fix.
	* tree.c (type_initializer_zero_p): New function.  Moved from
	../tree.c, use next_initializable_field, formatting fix.  Return
	false for TYPE_NON_AGGREGATE_CLASS types.

From-SVN: r277985
2019-11-08 19:56:42 +01:00
Jakub Jelinek 357a65e1ce backport: install.texi (--enable-offload-targets): Fix up a typo in the example, use actual names of supported offload targets.
Backported from mainline
	2019-10-29  Jakub Jelinek  <jakub@redhat.com>

	* doc/install.texi (--enable-offload-targets): Fix up a typo in the
	example, use actual names of supported offload targets.

From-SVN: r277984
2019-11-08 19:54:39 +01:00
Jakub Jelinek 3030fe1ca8 backport: locales.c (iso_3166): Add missing comma after "United-States".
Backported from mainline
	2019-10-27  Jakub Jelinek  <jakub@redhat.com>

	* locales.c (iso_3166): Add missing comma after "United-States".

From-SVN: r277983
2019-11-08 19:54:15 +01:00
Jakub Jelinek 6bf274fc77 backport: re PR tree-optimization/85887 (Missing DW_TAG_lexical_block PC range)
Backported from mainline
	2019-10-22  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/85887
	* decl.c (expand_static_init): Drop ECF_LEAF from __cxa_guard_acquire
	and __cxa_guard_release.

From-SVN: r277982
2019-11-08 19:53:46 +01:00
Jakub Jelinek ce9568e9e9 backport: re PR sanitizer/92154 (new glibc breaks arm bootstrap due to libsanitizer)
Backported from mainline
	2019-10-22  Tamar Christina  <tamar.christina@arm.com>

	PR sanitizer/92154
	* sanitizer_common/sanitizer_platform_limits_posix.cc:
	Cherry-pick compiler-rt revision r375220.

From-SVN: r277981
2019-11-08 19:53:18 +01:00
Jakub Jelinek 9d4f74f3c3 backport: re PR c++/92015 (internal compiler error: in cxx_eval_array_reference, at cp/constexpr.c:2568)
Backported from mainline
	2019-10-21  Jakub Jelinek  <jakub@redhat.com>

	PR c++/92015
	* constexpr.c (cxx_eval_component_reference, cxx_eval_bit_field_ref):
	Use STRIP_ANY_LOCATION_WRAPPER on CONSTRUCTOR elts.

	* g++.dg/cpp0x/constexpr-92015.C: New test.

From-SVN: r277980
2019-11-08 19:52:44 +01:00
Eric Botcazou 92b5b83849 overflow-1.c: Add -fno-pie to the options.
* gcc.target/sparc/overflow-1.c: Add -fno-pie to the options.
	* gcc.target/sparc/overflow-2.c: Likewise.

From-SVN: r277970
2019-11-08 12:45:45 +00:00
Eric Botcazou 6bf2990842 re PR target/92095 (internal error with -O1 -mcpu=niagara2 -fPIE)
PR target/92095
	* config/sparc/sparc-protos.h (output_load_pcrel_sym): Declare.
	* config/sparc/sparc.c (sparc_cannot_force_const_mem): Revert latest
 	change.
	(got_helper_needed): New static variable.
	(output_load_pcrel_sym): New function.
	(get_pc_thunk_name): Remove after inlining...
	(load_got_register): ...here.  Rework the initialization of the GOT
	register and of the GOT helper.
	(save_local_or_in_reg_p): Test the REGNO of the GOT register.
	(sparc_file_end): Test got_helper_needed to decide whether the GOT
	helper must be emitted.  Use output_asm_insn instead of fprintf.
	(sparc_init_pic_reg): In PIC mode, always initialize the PIC register
	if optimization is enabled.
	* config/sparc/sparc.md (load_pcrel_sym<P:mode>): Emit the assembly
	by calling output_load_pcrel_sym.

From-SVN: r277967
2019-11-08 12:33:48 +00:00
Tobias Burnus 19bb3f77ac Fortran] PR91253 fix continuation-line handling with -pre_include
Backport from mainline
        2019-11-08  Tobias Burnus  <tobias@codesourcery.com

        PR fortran/91253
        * scanner.c (skip_fixed_comments): Move comment
        lines to next if block.
        (gfc_next_char_literal): Fix continue_line setting.
        (get_file): Remove bogus ATTRIBUTE_UNUSED.

From-SVN: r277957
2019-11-08 10:25:40 +01:00
GCC Administrator f2b3f32196 Daily bump.
From-SVN: r277939
2019-11-08 00:16:13 +00:00
GCC Administrator 1d464cadc9 Daily bump.
From-SVN: r277898
2019-11-07 00:16:16 +00:00
Ilya Leoshkevich f06b51b0e2 S/390: Fix failing RTL check in s390_canonicalize_comparison
The new sigfpe-eh.c fails with

    internal compiler error: RTL check: expected elt 0 type 'e' or 'u', have 'w' (rtx const_int)

This is most likely due to a typo: XEXP (*op1, 0) was used, when
XEXP (*op0, 1) was intended.  This did not cause any user-visible
problems, because reversed_comparison_code_parts ignores the
respective argument, and the release compiler is built without RTL
checks.

gcc/ChangeLog:

2019-11-06  Ilya Leoshkevich  <iii@linux.ibm.com>

	* config/s390/s390.c (s390_canonicalize_comparison): Use XEXP
	(*op0, 1) instead of XEXP (*op1, 0).

gcc/testsuite/ChangeLog:

2019-11-06  Ilya Leoshkevich  <iii@linux.ibm.com>

	* gcc.target/s390/sigfpe-eh.c: New test.

From-SVN: r277874
2019-11-06 10:10:04 +00:00
GCC Administrator 814e123e96 Daily bump.
From-SVN: r277869
2019-11-06 00:16:14 +00:00
Segher Boessenkool 12baeae36d backport "rs6000: Implement [u]avg<mode>3_ceil"
* config/rs6000/altivec.md (altivec_vavgu<VI_char>): Rename to...
	(uavg<mode>3_ceil): ... This.
	(altivec_vavgs<VI_char>): Rename to...
	(avg<mode>3_ceil): ... This.
	* config/rs6000/rs6000-builtin.def (VAVGUB, VAVGSB, VAVGUH, VAVGSH,
	VAVGUW, VAVGSW): Adjust.

From-SVN: r277857
2019-11-05 18:34:23 +01:00
Segher Boessenkool 738aa869a1 backport for PR91289
Backport from trunk
	2019-10-26  Segher Boessenkool  <segher@kernel.crashing.org>

	PR target/91289
	* config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Don't add an
	immediate to r0; use r11 instead.  Save and restore r11 to r0 around
	this.

From-SVN: r277855
2019-11-05 18:17:03 +01:00
Andreas Krebbel 53fe1c6da3 IBM Z: gen-vect-26/28: Vectorizing without peeling is ok for Z
These tests check if loop peeling has been applied to avoid
having to vectorize unaligned loops.  On Z we do not have any
alignment requirements for vectorization so we also don't need want
the loop peeling here.

2019-11-05  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2019-11-05  Andreas Krebbel  <krebbel@linux.ibm.com>

	* gcc.dg/tree-ssa/gen-vect-26.c: Disable loop peeling check for
	IBM Z.
	* gcc.dg/tree-ssa/gen-vect-28.c: Likewise.

From-SVN: r277844
2019-11-05 15:27:59 +00:00
Andreas Krebbel 7c18249925 IBM Z: gen-vect-11/32: Set min-vect-loop-bound param back to default
In the Z backend we still set min-vect-loop-bound to 2 to work around
corner cases where awkward epilogue code gets generated in the
vectorizer.  This has a particular bad impact when vectorizing loops
with a low iteration count.  Due to this we do not vectorize the loop
in gen-vect-11/32 - what actually is a pity.

The patch sets min-vect-loop-bound back to the default value of 0 in
order to enable vectorization.

2019-11-05  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2019-11-05  Andreas Krebbel  <krebbel@linux.ibm.com>

	* gcc.dg/tree-ssa/gen-vect-11.c: Add --param min-vect-loop-bound=0
	for IBM Z.
	* gcc.dg/tree-ssa/gen-vect-11.c: Likewise.

From-SVN: r277843
2019-11-05 15:26:19 +00:00
Andreas Krebbel 21deaf2944 IBM Z: Fix testsuite useable_hw check
This fixes various issues with the useable_hw check in s390.exp.  The
check is supposed to verify whether a testcase can be run on the
current hardware.

- the test never returned true for -m31 because vzero is not available
  in ESA mode and -m31 defaults to -mesa
- the missing v0 clobber on the vzero instruction made the check fail
  if the stack pointer got saved in f0
- the lcbb instruction used for checking whether we are on a z13
  also requires vx.  Replace it with an instruction from the generic
  instruction set extensions.
- no support for z14 and z15 so far

gcc/testsuite/ChangeLog:

2019-11-05  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2019-11-05  Andreas Krebbel  <krebbel@linux.ibm.com>

	* gcc.target/s390/s390.exp
	(check_effective_target_s390_useable_hw): Add inline asm for z14
	and z15. Replace instruction for z13 with lochiz. Add register
	clobbers. Check also for __zarch__ when doing the __VX__ test.

From-SVN: r277842
2019-11-05 15:25:26 +00:00
Andreas Krebbel 05a649bbef IBM Z: Use tree_fits_uhwi_p in vector_alignment hook
This fixes an ICE in gcc.dg/attr-vector_size.c testcase.

gcc/ChangeLog:

2019-11-05  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2019-11-05  Andreas Krebbel  <krebbel@linux.ibm.com>

	* config/s390/s390.c (s390_vector_alignment): Check if the value
	fits into uhwi before using it.

From-SVN: r277841
2019-11-05 15:24:43 +00:00
Tobias Burnus 42b414a54b PR 92208 + PR 92277 – GCC 9 follow-up fix
PR fortran/92208
        Backport from mainline
        2019-10-31  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92277
        * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Fix DECL_ARTIFICIAL
        checking.

From-SVN: r277840
2019-11-05 15:28:07 +01:00
GCC Administrator 67bad4507f Daily bump.
From-SVN: r277809
2019-11-05 00:16:25 +00:00
Iain Sandoe 8f97367f1b [objective-c/c++, testsuite] Fix stubify tests for -fnext-runtime.
Fixed to work for x86 as well as powerpc (use the final assembler output
instead of the jump rtl which varies between X86 and PPC).  Amended the
options to reflect this change.

gcc/testsuite/

	Backport from mainline.
	2019-06-20  Iain Sandoe  <iain@sandoe.co.uk>

	* obj-c++.dg/stubify-1.mm: Adjust options and scan-asm checks.
	* obj-c++.dg/stubify-2.mm: Likewise.
	* objc.dg/stubify-1.m: Likewise.
	* objc.dg/stubify-2.m: Likewise.

From-SVN: r277800
2019-11-04 23:06:21 +00:00
Tobias Burnus f52b17ba5d Fortran] PR 92208 don't use function-result dummy variable as actual argument
gcc/fortran/
        Backported from mainline
        2019-10-30  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92208
        * trans-array.c (gfc_conv_array_parameter): Only copy
        string-length backend_decl if expression is not a function.

        gcc/testsuite/
        Backported from mainline
        2019-10-30  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92208
        * gfortran.dg/pr92208.f90: New.

From-SVN: r277783
2019-11-04 16:07:19 +01:00
Tobias Burnus 525c4e8d3a Backport Fortran BIND(C) fixes
gcc/fortran/
        Backport from mainline
        2019-10-31  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92284.
        * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Free CFI descriptor
        at the end; partial revised revert of Rev. 277502.


        gcc/testsuite/
        Backport from mainline
        2019-10-31  Jakub Jelinek  <jakub@redhat.com>

        PR fortran/92284
        * gfortran.dg/bind_c_array_params_3_aux.c: Include
        ../../../libgfortran/ISO_Fortran_binding.h rather than
        ISO_Fortran_binding.h.

        2019-10-31  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92284
        * gfortran.dg/bind-c-intent-out.f90: Update expected dump;
        extend comment.
        * gfortran.dg/bind_c_array_params_3.f90: New.
        * gfortran.dg/bind_c_array_params_3_aux.c: New.

        2019-10-31  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/92277
        * fortran.dg/pr92277.f90: New.

From-SVN: r277781
2019-11-04 15:14:43 +01:00
GCC Administrator 3e40a2cfaa Daily bump.
From-SVN: r277763
2019-11-04 00:16:13 +00:00
GCC Administrator 259019616f Daily bump.
From-SVN: r277748
2019-11-03 00:16:12 +00:00
GCC Administrator 8f6a67a361 Daily bump.
From-SVN: r277739
2019-11-02 00:16:19 +00:00
John David Anglin 4ce50f89f3 backport: pa.c (pa_output_call): Remove 64-bit sibcall sequence.
Backport from mainline
	2019-10-03  John David Anglin  <danglin@gcc.gnu.org>

	* config/pa/pa.c (pa_output_call): Remove 64-bit sibcall sequence.
	(pa_attr_length_call): Adjust length for 64-bit plabel sequence.

From-SVN: r277736
2019-11-01 23:35:06 +00:00
John David Anglin e16cf25262 backport: pa.h (MAX_PCREL17F_OFFSET): Adjust.
Backport from mainline
	2019-10-03  John David Anglin  <danglin@gcc.gnu.org>

	* config/pa/pa.h (MAX_PCREL17F_OFFSET): Adjust.

From-SVN: r277731
2019-11-01 23:24:54 +00:00
GCC Administrator 1afcbbe102 Daily bump.
From-SVN: r277702
2019-11-01 00:16:12 +00:00
GCC Administrator 9e21e650da Daily bump.
From-SVN: r277652
2019-10-31 00:16:20 +00:00
Iain Sandoe 155de58689 [testsuite] Make the Wnonnull test independent of system headers.
This backports two patches that fix failure of Wnonnull test on some targets.

277280 To avoid the result of this test depending on the implementation of
the system 'string.h', provide prototypes for the two functions used
in the test.  This generalises the fix from 277202.

277202 was the initial fix for Wnonnull on Darwin.

gcc/testsuite/

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-10-22  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.dg/Wnonnull.c: Provide prototypes for strlen and memcpy.
	Use __SIZE_TYPE__ instead of size_t.

	Backport from mainline.
	2019-10-19  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.dg/Wnonnull.c: Add attributed function declarations for
	memcpy and strlen for Darwin.

From-SVN: r277647
2019-10-30 20:54:16 +00:00
Iain Sandoe 2aebeccbeb [Darwin, machopic] Back out part of PR71767 fix.
This is part of making our codegen match what the system tools produce.

We applied a conservative, but fairly large, hammer to fix 71767.
However, ideally, we want minimise the number of symbols visible to
ld64 and to match the cases emitted by clang (since that's what ld64
is expecting). Now we've improved the handling of indirections, we
can make the indirection symbols local when they are in the regular
non-lazy symbol pointers section. We will continue to make any
indirections in the data section visible (since right now we have no
way to track if a given symbol follows a weak global).
This change makes no difference to handling of labels for constants
(to be revised in a future patch).

There's a mechanical change to a number of tests (allowing 'l' or 'L'
as the indirection symbol prefix).

gcc/

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-10-13  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (machopic_indirection_name): Rework the
	function to emit linker-visible symbols only for indirections
	in the data section.  Clean up the code and update comments.

gcc/testsuite/

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-10-13  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/i386/indirect-thunk-1.c: Allow 'l' or 'L' in
	indirection label prefix, for Darwin.
	* gcc.target/i386/indirect-thunk-2.c: Likewise.
	* gcc.target/i386/indirect-thunk-3.c: Likewise.
	* gcc.target/i386/indirect-thunk-4.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-1.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-2.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-3.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-4.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-5.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-6.c: Likewise.
	* gcc.target/i386/indirect-thunk-extern-1.c: Likewise.
	* gcc.target/i386/indirect-thunk-extern-2.c: Likewise.
	* gcc.target/i386/indirect-thunk-extern-3.c: Likewise.
	* gcc.target/i386/indirect-thunk-extern-4.c: Likewise.
	* gcc.target/i386/indirect-thunk-inline-1.c: Likewise.
	* gcc.target/i386/indirect-thunk-inline-2.c: Likewise.
	* gcc.target/i386/indirect-thunk-inline-3.c: Likewise.
	* gcc.target/i386/indirect-thunk-inline-4.c: Likewise.
	* gcc.target/i386/pr32219-2.c: Likewise.
	* gcc.target/i386/pr32219-3.c: Likewise.
	* gcc.target/i386/pr32219-4.c: Likewise.
	* gcc.target/i386/pr32219-7.c: Likewise.
	* gcc.target/i386/pr32219-8.c: Likewise.
	* gcc.target/i386/ret-thunk-14.c: Likewise.
	* gcc.target/i386/ret-thunk-15.c: Likewise.
	* gcc.target/i386/ret-thunk-9.c: Likewise.

From-SVN: r277646
2019-10-30 20:48:44 +00:00
Iain Sandoe 0811bd2255 [Darwin] Fix Objective-C NeXT ABI version check diagnostics.
This fixes build errors when used with newer GCC and corrects a mistake
in the checking of ABI versions.

276768 We were missing a check for the case that user's ABI was > 2 and the
codegen was for 64 bit.

276635 Fix some format-related build warnings.

This fixes two error messages to avoid punctuation and contracted
negations.

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-10-09  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (darwin_override_options): Make the check for
	Objective-C ABI version more specific for 64bit code.

	Backport from mainline
	2019-10-06  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (darwin_override_options): Adjust objective-c
	ABI version error messages to avoid punctuation and contracted
	negations.

From-SVN: r277645
2019-10-30 20:42:56 +00:00
Iain Sandoe bad5112682 [Darwin] Some TLC for older Darwin versions.
This is part 3 of build fixes for older Darwin versions (and will also
fix testsuite complaints about linkage with objects that are built for
an newer OS version than is being built, when used with a modern linker).

The library handling and some of the options for creating the crts for
the older PPC Darwin versions had bit-rotted somewhat. This adjusts the
build criteria for the crts to avoid newer ld64 versions warnings about
mismatches in build and object versions.

Added to some of the comments that it is documented why the specs are as
they are.

gcc/

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-07-03  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.h (REAL_LIBGCC_SPEC): Adjust for earlier Darwin.
	(STARTFILE_SPEC): Split crt3 into a separate spec.
	(DARWIN_EXTRA_SPECS): Add crt2 and crt3 spec.
	(DARWIN_CRT2_SPEC): New.
	(DARWIN_CRT3_SPEC): New.
	(MIN_LD64_OMIT_STUBS): Revise to 62.1.
	* config/rs6000/darwin.h (DARWIN_CRT2_SPEC): Revise conditions.
	(DARWIN_CRT3_SPEC): New.

libgcc/

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-07-03  Iain Sandoe  <iain@sandoe.co.uk>

	* config.host (powerpc-*-darwin*,powerpc64-*-darwin*): Revise crt
	list.
	* config/rs6000/t-darwin: Build crt3_2 for older systems.  Revise
	mmacosx-version-min for crts to run across all system versions.
	* config/rs6000/t-darwin64 (LIB2ADD): Remove.
	* config/t-darwin: Revise mmacosx-version-min for crts to run across
	system versions >= 10.4.

From-SVN: r277644
2019-10-30 20:38:47 +00:00
Iain Sandoe 77908128e4 [Darwin, PPC] Move the out of line register save/restore to an endfile.
Part 2 of fixes to build and link conditions for older Darwin versions.

We have been including these endfiles in libgcc, which means that we have to
append -lgcc even when using shared libgcc.  In preparation for revision of
libgcc split this into an endfile.  Build the new version.

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-25  Iain Sandoe  <iain@sandoe.co.uk>

	* config.host: Add libef_ppc.a to the extra files for powerpc-darwin.
	* config/rs6000/t-darwin: (PPC_ENDFILE_SRC, PPC_ENDFILE_OBJS): New.
	Build objects for the out of line save/restore register functions
	so that they can be used for any supported Darwin version.
	* config/t-darwin: Default the build Darwin version to Darwin8
	(MacOS 10.4).

From-SVN: r277642
2019-10-30 20:25:33 +00:00
Iain Sandoe df5e162b4b [Darwin, PPC] Move the out of line register save/restore to an endfile.
Part 1 of fixes to build and link conditions for older Darwin versions.

We have been including these endfiles in libgcc, which means that we have to
append -lgcc even when using shared libgcc.  In preparation for revision of
libgcc split this into an endfile.

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-06-27  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/darwin.h (ENDFILE_SPEC): Correct whitespace in the
	spec.

	Backport from mainline
	2019-06-25  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/darwin.h (ENDFILE_SPEC): New.

From-SVN: r277641
2019-10-30 20:12:17 +00:00
Iain Sandoe 3e57fa74b1 [Darwin] The need for FDE symbols is dependent on linker used, not OS rev.
For very old toolchains, the compiler generated extra symbols that mark the
start of each FDE.  We no longer need this (since xcode 3 era) - so, for
compatibility with newer linkers, omit this when it is not required.

Since we have detection of the linker version, we can use that directly to
determine if support is needed.

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-06-18  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (darwin_emit_unwind_label): New default to false.
	(darwin_override_options): Set darwin_emit_unwind_label as needed.

From-SVN: r277640
2019-10-30 20:05:32 +00:00
Iain Sandoe 728b08c0fc [Darwin] Use of symbol stubs should depend on the linker in use.
This is a combination of two patches that prevents a bootstrap fail when
a modern assembler/linker pair are used that don't support the JBSR reloc
(but don't require it for long calls).

272356 The need for picsym stubs is dependent on linker used, not OS rev.

For very old toolchains, the compiler generated pic symbol stubs that
provide the necessary indirections. We no longer need this (since xcode
3 era) and it's more efficient for the linker to make one stub when it
knows a symbol is needed that for us to emit them speculatively in every
object.

Our current codegen is making the assumption that a specific OS version
uses a specific linker version - and therefore the presence of support
could be based on the target OS rev. Of course, that's way too simplistic
(most likely bogus for cross-toolchains) and we want to make things explict.

Since we have detection of the linker version, we can use that directly
(A config test for support for stub-less linking might also be feasible
but much more involved).

Finally, should the user wish to generate code that caters for export to
use in an environment with an older toolchain, the generation of stubs
can be forced from the command line.

In addition to the points above, branch islanding and a long branch opt
for PowerPC Darwin has become conflated with the emission of these stubs
(which is confusing, and will be rectified in a following patch).

274397 There is no need to distinguish PIC/non-PIC symbol stubs.

So we can use a single flag for both.

2019-10-30  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-08-13 Iain Sandoe <iain@sandoe.co.uk>

	* config/darwin.c (machopic_indirect_call_target): Rename symbol stub
	flag.
	(darwin_override_options): Likewise.
	* config/darwin.h: Likewise.
	* config/darwin.opt: Likewise.
	* config/i386/i386.c (output_pic_addr_const): Likewise.
	* config/rs6000/darwin.h: Likewise.
	* config/rs6000/rs6000.c (rs6000_call_darwin_1): Likewise.
	* config/i386/darwin.h (TARGET_MACHO_PICSYM_STUBS): Rename to ...
	... this TARGET_MACHO_SYMBOL_STUBS.
	(FUNCTION_PROFILER):Likewise.
	* config/i386/i386.h: Likewise.

	Backport from mainline
	2019-06-16  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (machopic_indirect_call_target): Use renamed
	darwin_picsymbol_stubs to decide on output.
	(darwin_override_options): Handle darwin_picsymbol_stubs.
	* config/darwin.h (MIN_LD64_OMIT_STUBS): New.
	(LD64_VERSION): Revise default.
	* config/darwin.opt: (mpic-symbol-stubs): New option.
	(darwin_picsymbol_stubs): New variable.
	* config/i386/darwin.h (TARGET_MACHO_BRANCH_ISLANDS):
	rename to TARGET_MACHO_PICSYM_STUBS.
	* config/i386/i386.c (output_pic_addr_const): Likewise.
	* config/i386/i386.h Likewise.
	* config/rs6000/darwin.h: Likewise.
	* config/rs6000/rs6000.c (rs6000_call_darwin_1): Use renamed
	darwin_picsymbol_stubs.

From-SVN: r277638
2019-10-30 19:56:41 +00:00
Dragan Mladjenovic 77b90e2fec Backport fix for PR89245
gcc/ChangeLog:

2019-10-30  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

	Backport from mainline
	2019-07-09  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

	* cfgcleanup.c (old_insns_match_p): Check if used hard regs set is equal
	for both call instructions.

gcc/testsuite/ChangeLog:

2019-10-30  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

	Backport from mainline
	2019-07-09  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

	* gcc.target/mips/cfgcleanup-jalr1.c: New test.
	* gcc.target/mips/cfgcleanup-jalr2.c: New test.
	* gcc.target/mips/cfgcleanup-jalr3.c: New test.

From-SVN: r277625
2019-10-30 15:12:05 +00:00
Thomas Schwinge 9ac60f77d2 [LIBPHOBOS] Fix multi-lib RUNTESTFLAGS handling
Testing libphobos fails for multi-lib configs:

$ make check-target-libphobos RUNTESTFLAGS="--target_board=unix\{-m32,\}"

fails for every 32bit execution, because the host libgcc_s.so is used which
is not the correct version:

spawn [open ...]
./test_aa.exe: /lib/i386-linux-gnu/libgcc_s.so.1: version `GCC_7.0.0' not found (required by ./test_aa.exe)
FAIL: libphobos.aa/test_aa.d execution test

This can be fixed by adding a few lines from libstdc++/testsuite/lib/libstdc++.exp
to libphobos/testsuite/lib/libphobos.exp

Backport trunk r275332:

	libphobos/
	2019-09-03  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* testsuite/lib/libphobos.exp (libphobos_init): Add multi-lib libgcc
	dirs to the ld_library_path var.

From-SVN: r277611
2019-10-30 12:51:15 +01:00
Thomas Schwinge e445df93ae Avoid '-Wmaybe-uninitialized' diagnostic in 'gcc/dwarf2out.c'
With '--enable-checking=yes,extra,rtl':

    In file included from [...]/source-gcc/gcc/coretypes.h:433,
                     from [...]/source-gcc/gcc/dwarf2out.c:60:
    [...]/source-gcc/gcc/machmode.h: In function 'dw_loc_descr_node* mem_loc_descriptor(rtx, machine_mode, machine_mode, var_init_status)':
    [...]/source-gcc/gcc/machmode.h:520:42: error: 'int_mode' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      520 |    ? mode_size_inline (mode) : mode_size[mode]);
          |                                          ^~~~
    [...]/source-gcc/gcc/dwarf2out.c:15464:19: note: 'int_mode' was declared here
    15464 |   scalar_int_mode int_mode, inner_mode, op1_mode;
          |                   ^~~~~~~~
    cc1plus: all warnings being treated as errors
    make[3]: *** [dwarf2out.o] Error 1

Backport trunk r270903.

2019-05-06  Richard Biener  <rguenther@suse.de>

	* dwarf2out.c (mem_loc_descriptor): Initialize int_mode.

From-SVN: r277608
2019-10-30 11:50:58 +01:00
GCC Administrator f26b1e14a6 Daily bump.
From-SVN: r277598
2019-10-30 00:16:56 +00:00
Jakub Jelinek 9149decc3e re PR c++/92201 (ICE: ‘verify_gimple’ failed with -std=c++2a)
PR c++/92201
	* cp-gimplify.c (cp_gimplify_expr): If gimplify_to_rvalue changes the
	function pointer type, re-add cast to the original one.

	* g++.dg/other/pr92201.C: New test.

From-SVN: r277594
2019-10-29 22:09:21 +01:00
GCC Administrator 9c872d3313 Daily bump.
From-SVN: r277549
2019-10-29 00:16:47 +00:00
Paul Thomas 160f1001bb re PR fortran/91926 (assumed rank optional)
2019-10-28  Paul Thomas  <pault@gcc.gnu.org>

	Backport from trunk
	PR fortran/91926
	* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Correct the
	assignment of the attribute field to account correctly for an
	assumed shape dummy. Assign separately to the gfc and cfi
	descriptors since the atribute can be different. Add branch to
	correctly handle missing optional dummies.

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

	Backport from trunk
	PR fortran/91926
	* gfortran.dg/ISO_Fortran_binding_13.f90 : New test.
	* gfortran.dg/ISO_Fortran_binding_13.c : Additional source.
	* gfortran.dg/ISO_Fortran_binding_14.f90 : New test.

From-SVN: r277531
2019-10-28 18:28:48 +00:00
Jiufu Guo 0dee971833 backport: re PR target/70010 (powerpc: -flto forgets 'no-vsx' function attributes)
Backport from mainline
	
	PR target/70010
	* gcc.target/powerpc/pr70010.c: Add -Wno-psabi.
	* gcc.target/powerpc/pr70010-1.c: Require LTO.
	* gcc.target/powerpc/pr70010-2.c: Require LTO.

From-SVN: r277521
2019-10-28 14:23:26 +00:00
Uros Bizjak 37b50a8a36 re PR target/92225 (ice in gen_smaxv2di3, at config/i386/sse.md:12225)
PR target/92225
	* config/i386/sse.md (REDUC_SSE_SMINMAX_MODE): Use TARGET_SSE4_2
	condition for V2DImode.

testsuite/ChangeLog:

	PR target/92225
	* gcc.target/i386/pr92225.c: New test.

From-SVN: r277520
2019-10-28 15:16:50 +01:00
Ilya Leoshkevich 5a71e1eb81 Move jump threading before reload
r266734 has introduced a new instance of jump threading pass in order to
take advantage of opportunities that combine opens up.  It was perceived
back then that it was beneficial to delay it after reload, since that
might produce even more such opportunities.

Unfortunately jump threading interferes with hot/cold partitioning.  In
the code from PR92007, it converts the following

  +-------------------------- 2/HOT ------------------------+
  |                                                         |
  v                                                         v
3/HOT --> 5/HOT --> 8/HOT --> 11/COLD --> 6/HOT --EH--> 16/HOT
            |                               ^
            |                               |
            +-------------------------------+

into the following:

  +---------------------- 2/HOT ------------------+
  |                                               |
  v                                               v
3/HOT --> 8/HOT --> 11/COLD --> 6/COLD --EH--> 16/HOT

This makes hot bb 6 dominated by cold bb 11, and because of this
fixup_partitions makes bb 6 cold as well, which in turn makes EH edge
6->16 a crossing one.  Not only can't we have crossing EH edges, we are
also not allowed to introduce new crossing edges after reload in
general, since it might require extra registers on some targets.

Therefore, move the jump threading pass between combine and hot/cold
partitioning.  Building SPEC 2006 and SPEC 2017 with the old and the new
code indicates that:

* When doing jump threading right after reload, 3889 edges are threaded.
* When doing jump threading right after combine, 3918 edges are
  threaded.

This means this change will not introduce performance regressions.

gcc/ChangeLog:

2019-10-28  Ilya Leoshkevich  <iii@linux.ibm.com>

	Backport from mainline
	PR rtl-optimization/92007
	* cfgcleanup.c (thread_jump): Add an assertion that we don't
	call it after reload if hot/cold partitioning has been done.
	(class pass_postreload_jump): Rename to
	pass_jump_after_combine.
	(make_pass_postreload_jump): Rename to
	make_pass_jump_after_combine.
	* passes.def(pass_postreload_jump): Move before reload, rename
	to pass_jump_after_combine.
	* tree-pass.h (make_pass_postreload_jump): Rename to
	make_pass_jump_after_combine.

gcc/testsuite/ChangeLog:

2019-10-28  Ilya Leoshkevich  <iii@linux.ibm.com>

	Backport from mainline
	PR rtl-optimization/92007
	* g++.dg/opt/pr92007.C: New test (from Arseny Solokha).

From-SVN: r277515
2019-10-28 13:09:54 +00:00
John David Anglin 5366337461 baseline_symbols.txt: Update.
* config/abi/post/hppa-linux-gnu/baseline_symbols.txt: Update.

From-SVN: r277511
2019-10-28 11:40:08 +00:00
Peter BergnerandJiufu Guo f72e4f06ed [rs6000] PR70010, avoid no-vsx function to be inlined to vsx function
In PR70010, a function is marked with target(no-vsx) to disable VSX code
generation.  To avoid VSX code generation, this function should not be
inlined into VSX function.  To fix the bug, in the current logic when
checking whether the caller's ISA flags supports the callee's ISA flags, we
just need to add a test that enforces that the caller's ISA flags match
exactly the callee's flags, for those flags that were explicitly set in the
callee.  If caller without target attribute then using options from command
line.

Jiufu
BR


gcc/
2019-10-16  Peter Bergner <bergner@linux.ibm.com>
	    Jiufu Guo  <guojiufu@linux.ibm.com>

	PR target/70010
	* config/rs6000/rs6000.c (rs6000_can_inline_p): Prohibit inlining if
	the callee explicitly disables some isa_flags the caller is using.

gcc.testsuite/
2019-10-16  Peter Bergner <bergner@linux.ibm.com>
	    Jiufu Guo  <guojiufu@linux.ibm.com>

	PR target/70010
	* gcc.target/powerpc/pr70010.c: New test.
	* gcc.target/powerpc/pr70010-1.c: New test.
	* gcc.target/powerpc/pr70010-2.c: New test.
	* gcc.target/powerpc/pr70010-3.c: New test.
	* gcc.target/powerpc/pr70010-4.c: New test.



Co-Authored-By: Jiufu Guo <guojiufu@linux.ibm.com>

From-SVN: r277506
2019-10-28 09:46:15 +00:00
Tobias Burnus 25eaaa6181 Fortran] PR91863 - fix call to bind(C) with array descriptor
Backport from mainline
        2019-10-28  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/91863
        * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Don't free data
        memory as that's done on the Fortran side.
        (gfc_conv_procedure_call): Handle void* pointers from
        gfc_conv_gfc_desc_to_cfi_desc.

        Backport from mainline
        2019-10-28  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/91863
        * gfortran.dg/bind-c-intent-out.f90: New.

From-SVN: r277505
2019-10-28 10:36:27 +01:00
GCC Administrator 3c99746820 Daily bump.
From-SVN: r277498
2019-10-28 00:16:57 +00:00
Iain Sandoe 44d4b91643 [Darwin, PPC] Fix PR 65342.
The current Darwin load/store lo_sum patterns have neither predicate nor
constraint. This means that most parts of the backend, which rely on
recog() to validate the rtx, can produce invalid combinations/selections.

For 32bit cases this isn't a problem since we can load/store to unaligned
addresses using D-mode insns.

Conversely, for 64bit instructions that use DS mode, this can manifest as
assemble errors (for an assembler that checks the LO14 relocations), or as
crashes caused by wrong offsets (or worse, wrong content for the two LSBs).

What we want to check for Y on Darwin is:
- that the alignment of the Symbols' target is sufficient for DS mode
- that the offset is suitable for DS mode.
(while looking through the Mach-O PIC unspecs).

So, the patch removes the Darwin-specific lo_sum patterns (we begin using
the movdi_internal64 patterns). We also we need to extend the handling of the
mem_operand_gpr constraint to allow looking through Mach-O PIC UNSPECs in
the lo_sum cases.

2019-10-27  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-10-17  Iain Sandoe  <iain@sandoe.co.uk>

	PR target/65342
	* config/rs6000/darwin.md (movdi_low, movsi_low_st): Delete.
	(movdi_low_st): Delete.
	* config/rs6000/rs6000.c
	(darwin_rs6000_legitimate_lo_sum_const_p): New.
	(mem_operand_gpr): Validate Mach-O LO_SUM cases separately.
	* config/rs6000/rs6000.md (movsi_low): Delete.

From-SVN: r277495
2019-10-27 21:25:57 +00:00
Iain Sandoe 87b32c6f40 [Darwin, machopic] Fix for 67183
When we're using the LLVM-based assembler (the default on modern Darwin)
the ordering of stubs and non-lazy symbol pointers is important.

Interleaving the output (current GCC behaviour) leads to crashes which
prevents us from building code with symbol stubs.

To resolve this, we order the output of stubs and symbol indirections:

1. Any indirections in the data section
2. Symbol stubs.
3. Non-lazy symbol pointers.

At present, we still emit LTO sections after these.

2019-10-27  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-10-12  Iain Sandoe  <iain@sandoe.co.uk>

	PR target/67183
	* config/darwin.c (machopic_indirection): New field to flag
	non-lazy-symbol-pointers in the data section.
	(machopic_indirection_name): Compute if an indirection should
	appear in the data section.
	(machopic_output_data_section_indirection): New callback split
	from machopic_output_indirection.
	(machopic_output_stub_indirection): Likewise.
	(machopic_output_indirection): Retain the code for non-lazy
	symbol pointers in their regular section.
	(machopic_finish): Use the new callbacks to order the indirection
	output.

From-SVN: r277494
2019-10-27 21:21:49 +00:00
Iain Sandoe 5f3b4ef9d5 [Darwin, machopic] Preparatory patches.
This is a combined set of 5 patches that allows us to fix
PR 65342 and 67183.

276924 Make machopic_finish() static.

276767 Set a SYMBOL flag for indirections.

We are able to treat these specially where needed in legitimate address
tests (specifically, they are guaranteed to be pointer-aligned).

276708 Compute and cache indirection rules.

This caches a check for the requirement to indirect a symbol in the Darwin
ABI, and uses it where needed.  We also ensure that we place the indirection
pointers into the non-lazy symbol pointers section.  Other placements have
occurred with various platform toolchains - but these seem to have been
unintentional so we match current platform toolchains.

276675 Consider visibility in indirections.

For weak, hidden vars the indirection should just be as normal, that
is that the indirections for such symbols should appear in the non-lazy
symbol pointers table, not in the .data section.

276674 Initial tidy of Mach-O symbol handling.

We want to improve the detection and caching of symbol-properties
so that (a) we can make the compiler's output match the platform
norms (b) we can improve efficiency by checking flags instead of
inspecting strings. (c) The fix for PR71767 was a largish hammer
and we want to reduce the number of symbols that are made linker-
visible.

This first patch is largely typographical changes with no functional
difference intended:

- Tries to ensure that there's no overlap between the symbols used in
the Mach-O case and those declared in the i386 or rs6000 port trees.

 - Some improvement to comments.

- Makes the naming of the symbol flags consistent with other uses.

 - Provides a predicate macro for each use.

2019-10-27  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-10-12  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin-protos.h (machopic_finish): Delete.
	* config/darwin.c (machopic_finish): Make static.

	Backport from mainline
	2019-10-09  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (machopic_indirect_data_reference): Set flag to
	indicate that the new symbol is an indirection.
	(machopic_indirect_call_target): Likewise.
	* config/darwin.h (MACHO_SYMBOL_FLAG_INDIRECTION): New.
	(MACHO_SYMBOL_INDIRECTION_P): New.
	(MACHO_SYMBOL_FLAG_STATIC): Adjust bit number.

	Backport from mainline
	2019-10-08  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (machopic_indirect_data_reference): Check for
	required indirections before making direct access to defined
	values.
	(machopic_output_indirection): Place the indirected pointes for
	required indirections into the non-lazy symbol pointers section.
	(darwin_encode_section_info):
	* config/darwin.h (MACHO_SYMBOL_FLAG_MUST_INDIRECT): New.
	(MACHO_SYMBOL_MUST_INDIRECT_P): New.

	Backport from mainline
	2019-10-07  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (machopic_output_indirection): Don't put
	hidden symbol indirections into the .data section, use the
	non-lazy symbol pointers section as normal.
	(darwin_encode_section_info): Record if a symbol is hidden.
	* config/darwin.h (MACHO_SYMBOL_FLAG_HIDDEN_VIS): New.
	(MACHO_SYMBOL_HIDDEN_VIS_P): New.

	Backport from mainline
	2019-10-07  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (machopic_symbol_defined_p): Use symbol flag
	predicates instead of accessing bits directly.
	(machopic_indirect_call_target): Likewise.
	(machopic_output_indirection): Likewise.
	(darwin_encode_section_info): Improve description.  Use renamed
	symbol flags.  Use predicate macros for variables and functions.
	* config/darwin.h:
	Rename MACHO_SYMBOL_VARIABLE to MACHO_SYMBOL_FLAG_VARIABLE.
	Rename MACHO_SYMBOL_DEFINED to MACHO_SYMBOL_FLAG_DEFINED.
	Rename MACHO_SYMBOL_STATIC to MACHO_SYMBOL_FLAG_STATIC.
	(MACHO_SYMBOL_VARIABLE_P): New.
	(MACHO_SYMBOL_DEFINED_P):New.
	(MACHO_SYMBOL_STATIC_P): New.
	* config/i386/darwin.h (MACHO_SYMBOL_FLAG_VARIABLE): Delete.
	(SYMBOL_FLAG_SUBT_DEP): New.
	* config/rs6000/darwin.h (SYMBOL_FLAG_SUBT_DEP): New.

From-SVN: r277493
2019-10-27 21:17:33 +00:00
Paul Thomas 8e17092569 backport: re PR fortran/86248 (LEN_TRIM in specification expression causes link failure)
2019-10-27  Paul Thomas  <pault@gcc.gnu.org>

	Backport from mainline
	PR fortran/86248
	* resolve.c (flag_fn_result_spec): Correct a typo before the
	function declaration.
	* trans-decl.c (gfc_sym_identifier): Boost the length of 'name'
	to allow for all variants. Simplify the code by using a pointer
	to the symbol's proc_name and taking the return out of each of
	the conditional branches. Allow symbols with fn_result_spec set
	that do not come from a procedure namespace and have a module
	name to go through the non-fn_result_spec branch.

2019-10-27  Paul Thomas  <pault@gcc.gnu.org>

	Backport from mainline
	PR fortran/86248
	* gfortran.dg/char_result_19.f90 : New test.
	* gfortran.dg/char_result_mod_19.f90 : Module for the new test.

From-SVN: r277490
2019-10-27 18:28:52 +00:00
GCC Administrator e29929cc5a Daily bump.
From-SVN: r277479
2019-10-27 00:16:42 +00:00
Ville Voutilainen a90af601e7 re PR c++/85254 (boost::is_final does not work for template types)
PR c++/85254

Backport from mainline
2019-06-01  Ville Voutilainen  <ville.voutilainen@gmail.com>

	PR c++/85254
	* class.c (fixup_type_variants): Handle CLASSTYPE_FINAL.

From-SVN: r277474
2019-10-26 20:32:24 +03:00
Jan Hubicka a6c9210f76 Avoid gimple body modifications while streaming.
Backport from mainline
	2019-10-11  Jan Hubicka  <hubicka@ucw.cz>
	* gimple-streamer-out.c (output_gimple_stmt): Add explicit function
	parameter.
	* lto-streamer-out.c: Include tree-dfa.h.
	(output_cfg): Do not use cfun.
	(lto_prepare_function_for_streaming): New.
	(output_function): Do not push cfun; do not initialize loop optimizer.
	* lto-streamer.h (lto_prepare_function_for_streaming): Declare.
	* passes.c (ipa_write_summaries): Use it.
	(ipa_write_optimization_summaries): Do not modify bodies.
	* tree-dfa.c (renumber_gimple_stmt_uids): Add function parameter.
	* tree.dfa.h (renumber_gimple_stmt_uids): Update prototype.
	* tree-ssa-dse.c (pass_dse::execute): Update use of
	renumber_gimple_stmt_uids.
	* tree-ssa-math-opts.c (pass_optimize_widening_mul::execute): Likewise.

	2019-10-12  Jan Hubicka  <hubicka@ucw.cz>
	* lto-streamer-out.c (collect_block_tree_leafs): Renumber statements
	so non-virutal are before virutals.
	(output_function): Avoid body modifications.

From-SVN: r277473
2019-10-26 16:57:16 +00:00
GCC Administrator 4f8ee9b60e Daily bump.
From-SVN: r277467
2019-10-26 00:16:59 +00:00
Ian Lance Taylor f36defc3f3 compiler: don't inline integer expressions with named types
This works around the problem on GCC 9 branch.  The problem is fixed
in a better way on trunk; see https://golang.org/issue/34577.

Fixes https://golang.org/issue/35154

From-SVN: r277461
2019-10-25 19:10:34 +00:00
Richard Earnshaw 9dace56f5f [arm][PR88167] Fix __builtin_return_address returns invalid address
This patch fixes a problem with the thumb1 prologue code where the link
register could be unconditionally used as a scratch register even if the
return value was still live at the end of the prologue.

Additionally, the patch improves the code generated when we are not
using many low call-saved registers to make use of any unused call
clobbered registers to help with the saving of high registers that
cannot be pushed directly (quite rare in normal code as the register
allocator correctly prefers low registers).

2019-05-08  Mihail Ionescu  <mihail.ionescu@arm.com>
	    Richard Earnshaw  <rearnsha@arm.com>

gcc:

	PR target/88167
	* config/arm/arm.c (thumb1_prologue_unused_call_clobbered_lo_regs): New
	function.
	(thumb1_epilogue_unused_call_clobbered_lo_regs): New function.
	(thumb1_compute_save_core_reg_mask): Don't force a spare work
	register if both the epilogue and prologue can use call-clobbered
	regs.
	(thumb1_unexpanded_epilogue): Use
	thumb1_epilogue_unused_call_clobbered_lo_regs.  Reverse the logic for
	picking temporaries for restoring high regs to match that of the
	prologue where possible.
	(thumb1_expand_prologue): Add any usable call-clobbered low registers to
	the list of work registers.  Detect if the return address is still live
	at the end of the prologue and avoid using it for a work register if so.
	If the return address is not live, add LR to the list of pushable regs
	after the first pass.

gcc/testsuite:

	PR target/88167
	* gcc.target/arm/pr88167-1.c: New test.
	* gcc.target/arm/pr88167-2.c: New test.

From-SVN: r277452
2019-10-25 14:34:44 +00:00
Jan Hubicka 3a3087860f free summary vectors.
Backport from mainline
	2019-10-24  Jan Hubicka  <hubicka@ucw.cz>
	* symbols-summary.h (fast_function_summary<T *, V>::release,
	fast_call_summary<T *, V>::release): Free m_vector.

From-SVN: r277445
2019-10-25 12:02:39 +00:00
Jan Hubicka e8c432208c Backport ggc_trim
Backport from mainline

	2019-10-18  Jakub Jelinek  <jakub@redhat.com>
	PR middle-end/92153
	* ggc-page.c (release_pages): Read g->alloc_size before free rather
	than after it.

	2019-10-11  Jan Hubicka  <hubicka@ucw.cz>

	* ggc-page.c (release_pages): Output statistics when !quiet_flag.
	(ggc_collect): Dump later to not interfere with release_page dump.
	(ggc_trim): New function.
	* ggc-none.c (ggc_trim): New.
	* ggc.h (ggc_trim): Declare.

	* lto-partition.c (add_symbol_to_partition_1): Update.
	(undo_parittion): Update.

From-SVN: r277443
2019-10-25 11:17:38 +00:00
GCC Administrator 6ae933c761 Daily bump.
From-SVN: r277432
2019-10-25 00:16:58 +00:00
Marek Polacek 6fd00cdf1c * decl.c (reshape_init_r): Add missing space.
From-SVN: r277420
2019-10-24 17:23:27 +00:00
Mihail Ionescu 08cdccdb1c [arm] Backport -- Fix multilibs for Armv7-R
gcc/ChangeLog:
2019-10-24  Mihail Ionescu  <mihail.ionescu@arm.com>

	Backport from mainline
	2019-10-18  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* config/arm/t-multilib: Add new multilib variants and new
	mappings.

gcc/testsuite/ChangeLog:
2019-10-24  Mihail Ionescu  <mihail.ionescu@arm.com>

	Backport from mainline
	2019-10-18  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* gcc.target/arm/multilib.exp: Add extra tests.

From-SVN: r277417
2019-10-24 16:55:18 +00:00
Iain Sandoe dac3f1132b [Darwin, PPC] Check for out of range asm values.
There are some cases in which the value for the max skip to a p2align
directive can be negative. The older assembler (and GAS) just ignores
these cases but newer tools produce an error. To preserve behaviour,
we avoid emitting out of range values.

gcc/ChangeLog:

2019-10-24  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-10-23  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/darwin.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Guard
	against out of range max skip or log values.

From-SVN: r277405
2019-10-24 14:53:28 +00:00
Jonathan Wakely 14fe05d883 PR libstdc++/90682 allow set_terminate(0) and set_unexpected(0)
Make these functions restore the default handlers when passed a null
pointer. This is consistent with std::pmr::set_default_resource(0), and
also matches the current behaviour of libc++.

In order to avoid duplicating the preprocessor condition from
eh_term_handler.cc more that into a new eh_term_handler.h header and
define a macro that can be used in both eh_term_handler.cc and
eh_terminate.cc.

Backport from mainline
2019-05-31  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90682
	* libsupc++/eh_term_handler.cc: Include eh_term_handler.h to get
	definition of _GLIBCXX_DEFAULT_TERM_HANDLER.
	* libsupc++/eh_term_handler.h: New header defining
	_GLIBCXX_DEFAULT_TERM_HANDLER.
	* libsupc++/eh_terminate.cc: Include eh_term_handler.h.
	(set_terminate): Restore default handler when argument is null.
	(set_unexpected): Likewise.
	* testsuite/18_support/set_terminate.cc: New test.
	* testsuite/18_support/set_unexpected.cc: New test.

From-SVN: r277393
2019-10-24 13:55:27 +01:00
Jonathan Wakely e970705b48 PR libstdc++/61761 fix std::proj for targets without C99 cproj
The current generic implementation of __complex_proj used when cproj is
not available calculates the wrong projection, giving a different result
than given by C99's cproj.

When C99 cproj is not available but isinf and copysign are, use those to
give correct results for float, double and long double. Otherwise, and
for other specializations of std::complex, just use a generic version
that returns its argument, and so doesn't support infinities.

We might want to consider adding additional overloads of __complex_proj
to support extended types such as _Float64x, _Float128 etc.

Backport from mainline
2019-05-01  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/61761
	* include/std/complex (__complex_proj): Return parameter unchanged.
	[_GLIBCXX_USE_C99_COMPLEX] (__complex_proj): Change overloads for
	floating-point types to take std::complex arguments.
	[_GLIBCXX_USE_C99_MATH_TR1] (__complex_proj): Add overloads for
	floating-point types.
	* testsuite/26_numerics/complex/proj.cc: New test.

From-SVN: r277392
2019-10-24 13:55:21 +01:00
Jonathan Wakely 1b120c61b6 Fix more failing tests for C++98 mode
Backport from mainline
2019-06-06  Jonathan Wakely  <jwakely@redhat.com>

	* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Add
	dg-prune-output for different C++98 diagnostic.
	* testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc:
	Likewise.
	* testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc:
	Likewise.
	* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/vector/requirements/dr438/
	constructor_2_neg.cc: Likewise.
	* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/libstdc++-prettyprinters/compat.cc: Do not run for C++98.

From-SVN: r277391
2019-10-24 13:55:14 +01:00
Jonathan Wakely 4f03a8f011 Fix tests that fail with -std=gnu++98 or -std=gnu++11
Backport from mainline
2019-06-06  Jonathan Wakely  <jwakely@redhat.com>

	* testsuite/20_util/is_nothrow_invocable/value.cc: Test converting to
	void.
	* testsuite/experimental/names.cc: Do not run for C++98 mode. Do not
	include Library Fundamentals or Networking headers in C++11 mode.
	* testsuite/ext/char8_t/atomic-1.cc: Do not run for C++98 mode.

From-SVN: r277390
2019-10-24 13:55:08 +01:00
Jonathan Wakely 7e6c09c180 Fix indentation in testsuite utility header
Backport from mainline
2019-05-14  Jonathan Wakely  <jwakely@redhat.com>

	* testsuite/util/testsuite_allocator.h (memory_resource)
	(default_resource_mgr): Fix indentation.

From-SVN: r277389
2019-10-24 13:55:03 +01:00
Jonathan Wakely f061d690d8 PR libstdc++/89164 enforce constraints for uninitialized algos
The memmove optimizations for std::uninitialized_copy/fill/_n will
compile even if the type is not copy constructible, because std::copy
doesn't require copy construction to work. But the uninitialized
algorithms do require it.

This adds explicit static assertions to ensure we don't allow ill-formed
initializations.

Backport from mainline
2019-08-30  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/89164
	* include/bits/stl_algobase.h (__copy_move): Give descriptive names
	to template parameters.
	* include/bits/stl_uninitialized.h (uninitialized_copy)
	(uninitialized_fill, uninitialized_fill_n): Add static assertions to
	diagnose invalid uses.
	* testsuite/20_util/specialized_algorithms/uninitialized_copy/1.cc:
	Adjust expected error.
	* testsuite/20_util/specialized_algorithms/uninitialized_copy/89164.cc:
	New test.
	* testsuite/20_util/specialized_algorithms/uninitialized_copy_n/
	89164.cc: New test.
	* testsuite/20_util/specialized_algorithms/uninitialized_fill/89164.cc:
	New test.
	* testsuite/20_util/specialized_algorithms/uninitialized_fill_n/
	89164.cc: New test.
	* testsuite/23_containers/vector/cons/89164.cc: New test.
	* testsuite/23_containers/vector/cons/89164_c++17.cc: New test.

From-SVN: r277388
2019-10-24 13:54:58 +01:00
Jonathan Wakely 8fa40f2cc3 Do not declare std::uses_allocator before C++11
Backport from mainline
2019-10-22  Jonathan Wakely  <jwakely@redhat.com>

	* include/bits/memoryfwd.h (uses_allocator): Do not declare for C++98.
	* testsuite/17_intro/names.cc: Check uses_allocator in C++98.

From-SVN: r277387
2019-10-24 13:54:50 +01:00
Jonathan Wakely f37b9e32f7 PR libstdc++/92143 adjust for OS X aligned_alloc behaviour
OS X 10.15 adds aligned_alloc but it has the same restriction as the AIX
version, namely that alignments smaller than sizeof(void*) are not
supported.

Backport from mainline
2019-10-18  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/92143
	* libsupc++/new_opa.cc (operator new) [__APPLE__]: Increase alignment
	to at least sizeof(void*).

From-SVN: r277386
2019-10-24 13:54:44 +01:00
Jonathan Wakely 20bce52d36 Fix more tests that fail in C++2a mode
Backport from mainline
2019-06-06  Jonathan Wakely  <jwakely@redhat.com>

	* testsuite/23_containers/unordered_map/requirements/debug_container.cc:
	Do not test allocator rebinding extension for C++2a.
	* testsuite/23_containers/unordered_set/allocator/ext_ptr.cc: Change
	dg-do directive for C++17 and C++2a.

From-SVN: r277385
2019-10-24 13:54:40 +01:00
Jonathan Wakely b2f56dd541 Fix testsuite bugs
One of the static assertions in 20_util/function_objects/invoke/1.cc was
wrong, but didn't fail because by default it was compiled with
-std=gnu++14 which didn't use that static assertion. Split out the C++17
parts to a new file that always runs with -std=gnu++17, so those checks
are always done. Also backport some extra tests from an earlier commit
on trunk (r271173).

The 23_containers/unordered_set/allocator/ext_ptr.cc test is supposed to
be a run-time test but was unintentionally compile-only.

Backport from mainline
2019-05-23  Jonathan Wakely  <jwakely@redhat.com>

	* testsuite/20_util/function_objects/invoke/1.cc: Add more tests.
	Move C++17-specific tests to ...
	* testsuite/20_util/function_objects/invoke/3.cc: New test.
	* testsuite/23_containers/unordered_set/allocator/ext_ptr.cc: Change
	"compile" test to "run".

From-SVN: r277384
2019-10-24 13:54:35 +01:00
Jonathan Wakely 5634905ded Add makefile target to update HTML files in source tree
Also remove the creation of the html/ext sub-directory, which has been
unused since revision r245258.

Backport from mainline
2019-10-08  Jonathan Wakely  <jwakely@redhat.com>

	* doc/Makefile.am (doc-html-docbook-regenerate): New target.
	(${docbook_outdir}/html): Do not create unused 'html/ext' directory.
	* doc/Makefile.in: Regenerate.
	* doc/xml/manual/documentation_hacking.xml: Document new target.
	* doc/html/*: Regenerate.

From-SVN: r277383
2019-10-24 13:54:30 +01:00
Jonathan Wakely f54588f620 Update URL for CUJ article in libstdc++ docs
* doc/xml/manual/allocator.xml: Use archived copy of CUJ article.

From-SVN: r277382
2019-10-24 13:54:23 +01:00
Jonathan Wakely 05c4872b3b Update URL for Hoard in libstdc++ docs
Backport from mainline
2019-05-31  Gerald Pfeifer  <gerald@pfeifer.com>

	* doc/xml/manual/allocator.xml: Move hoard.org back to http.

From-SVN: r277381
2019-10-24 13:54:18 +01:00
Jonathan Wakely b53e76509f PR libstdc++/91456 make INVOKE<R> work with uncopyable prvalues
In C++17 a function can return a prvalue of a type that cannot be moved
or copied. The current implementation of std::is_invocable_r uses
std::is_convertible to test the conversion to R required by INVOKE<R>.
That fails for non-copyable prvalues, because std::is_convertible is
defined in terms of std::declval which uses std::add_rvalue_reference.
In C++17 conversion from R to R involves no copies and so is not the
same as conversion from R&& to R.

This commit changes std::is_invocable_r to check the conversion without
using std::is_convertible.

std::function also contains a similar check using std::is_convertible,
which can be fixed by simply reusing std::is_invocable_r (but because
std::is_invocable_r is not defined for C++11 it uses the underlying
std::__is_invocable_impl trait directly).

Backport from mainline
2019-08-15  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/91456
	* include/bits/std_function.h (__check_func_return_type): Remove.
	(function::_Callable): Use std::__is_invocable_impl instead of
	__check_func_return_type.
	* include/std/type_traits (__is_invocable_impl): Add another defaulted
	template parameter. Define a separate partial specialization for
	INVOKE and INVOKE<void>. For INVOKE<R> replace is_convertible check
	with a check that models delayed temporary materialization.
	* testsuite/20_util/function/91456.cc: New test.
	* testsuite/20_util/is_invocable/91456.cc: New test.

From-SVN: r277380
2019-10-24 13:54:13 +01:00
Jonathan Wakely a8b705aa43 Include netinet/in.h in include/experimental/internet
Backport from mainline
2019-09-30  Andreas Tobler  <andreast@gcc.gnu.org>

	* include/experimental/internet: Include netinet/in.h if we have
	_GLIBCXX_HAVE_NETINET_IN_H defined.

From-SVN: r277379
2019-10-24 13:54:09 +01:00
Jonathan Wakely 38cb5876a2 Fix array index error in address_v6 comparisons
Backport from mainline
2019-09-26  Jonathan Wakely  <jwakely@redhat.com>

	* include/experimental/internet (operator==, operator<): Fix loop
	condition to avoid reading past the end of the array.

From-SVN: r277378
2019-10-24 13:54:05 +01:00
Jonathan Wakely 2cd084d864 P1651R0 bind_front should not unwrap reference_wrapper
Backport from mainline
2019-08-06  Jonathan Wakely  <jwakely@redhat.com>

	P1651R0 bind_front should not unwrap reference_wrapper
	* include/std/functional (bind_front): Don't unwrap reference_wrapper.
	* include/std/version (__cpp_lib_bind_front): Update value.
	* testsuite/20_util/function_objects/bind_front/1.cc: Fix test for
	feature test macro.
	* testsuite/20_util/function_objects/bind_front/2.cc: New test.

From-SVN: r277377
2019-10-24 13:54:00 +01:00
Jonathan Wakely de5a2a1923 PR libstdc++/92059 fix several bugs in tr2::dynamic_bitset
Backport from mainline
2019-10-11  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/92059
	* include/tr2/dynamic_bitset (__dynamic_bitset_base): Define all
	special member functions as defaulted. Add noexcept to most members.
	(__dynamic_bitset_base(size_t, unsigned long long, const _Alloc&)):
	Mask off unwanted bits in the __val parameter. Avoid undefined left
	shifts.
	(__dynamic_bitset_base::_M_assign): Remove.
	(__dynamic_bitset_base::_M_do_reset): Use std::fill.
	(__dynamic_bitset_base::_M_are_all_aux): Avoid integer promotion when
	block_type has lower rank than int.
	(dynamic_bitset): Add noexcept to most members. Use injected-class-name
	in return types and parameter types.
	(dynamic_bitset::_M_Nb): Add default member initializer.
	(dynamic_bitset(), dynamic_bitset(const dynamic_bitset&)): Define as
	defaulted.
	(dynamic_bitset(dynamic_bitset&&)): Clear source object after move.
	(dynamic_bitset::operator=(const dynamic_bitset&)): Define as
	defaulted.
	(dynamic_bitset::operator=(dynamic_bitset&&)): Add noexcept-specifier.
	Define without using swap, to propagate allocator correctly.
	(dynamic_bitset(const char*, const _Alloc&)): Use strlen.
	(dynamic_bitset::_M_do_sanitize, dynamic_bitset::_M_do_fill): Use
	casts to avoid unwanted integer promotions.
	(dynamic_bitset::_M_copy_from_ptr): Rearrange template parameters and
	add default template arguments and default argument to simplify usage.
	(dynamic_bitset::_M_copy_from_string): Adjust call to _M_copy_from_ptr.
	(operator==(const dynamic_bitset&, const dynamic_bitset&))
	(operator<(const dynamic_bitset&, const dynamic_bitset&)): Use _M_Nb.
	* include/tr2/dynamic_bitset.tcc (dynamic_bitset::_M_copy_from_ptr):
	Adjust template parameters to match declaration.
	* testsuite/tr2/dynamic_bitset/cmp.cc: New test.
	* testsuite/tr2/dynamic_bitset/cons.cc: New test.
	* testsuite/tr2/dynamic_bitset/copy.cc: New test.
	* testsuite/tr2/dynamic_bitset/move.cc: New test.
	* testsuite/tr2/dynamic_bitset/pr92059.cc: New test.

From-SVN: r277376
2019-10-24 13:53:55 +01:00
GCC Administrator cb59b91d34 Daily bump.
From-SVN: r277361
2019-10-24 00:16:13 +00:00
Peter Bergner f81de8afe7 backport: config.gcc: Move -L usage from LINK_OS_EXTRA_SPEC32 and LINK_OS_EXTRA_SPEC64 to...
Backport from mainline
	2019-10-08  Tulio Magno Quites Machado Filho  <tuliom@linux.ibm.com>

	* config.gcc: Move -L usage from LINK_OS_EXTRA_SPEC32 and
	LINK_OS_EXTRA_SPEC64 to MD_STARTFILE_PREFIX and
	MD_STARTFILE_PREFIX_1 when using --with-advance-toolchain.

From-SVN: r277353
2019-10-23 16:34:42 -05:00
Martin Liska 5bd08e79df Backport r276178
2019-10-23  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-09-27  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/91885
	* gcc.dg/pr91885.c (__int64_t): Change from long to long long.
	(__uint64_t): Change from unsigned long to unsigned long long.

From-SVN: r277318
2019-10-23 12:16:28 +00:00
Martin Liska aee63014ab Backport r276141
2019-10-23  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-09-26  Martin Liska  <mliska@suse.cz>

	PR tree-optimization/91885
	* tree-vectorizer.c (try_vectorize_loop_1):
	Add TODO_update_ssa_only_virtuals similarly to what slp
	pass does.
2019-10-23  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-09-26  Martin Liska  <mliska@suse.cz>

	PR tree-optimization/91885
	* gcc.dg/pr91885.c: New test.

From-SVN: r277317
2019-10-23 12:12:57 +00:00
Eric Botcazou dd54e57306 re PR tree-optimization/92131 (incorrect assumption that (ao >= 0) is always false)
PR tree-optimization/92131
	* tree-vrp.c (extract_range_from_plus_minus_expr): If the resulting
	range would be symbolic, drop to varying for any explicit overflow
	in the constant part or if neither range is a singleton.

From-SVN: r277315
2019-10-23 11:37:28 +00:00
Richard Biener 0ce10ed63c backport: re PR debug/91887 (-fdebug-types-section ICE building chromium)
2019-10-23  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-10-17  Richard Biener  <rguenther@suse.de>

	PR debug/91887
	* dwarf2out.c (gen_formal_parameter_die): Also try to match
	context_die against a DW_TAG_GNU_formal_parameter_pack parent.

	* g++.dg/debug/dwarf2/pr91887.C: New testcase.

From-SVN: r277312
2019-10-23 10:32:06 +00:00
GCC Administrator 3cc49cb587 Daily bump.
From-SVN: r277305
2019-10-23 00:16:20 +00:00
Steven G. Kargl d5cfbd6e82 re PR fortran/92174 (runtime error: index 15 out of bounds for type 'gfc_expr *[15])
2019-10-22  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/92174
	* decl.c (attr_decl1): Move check for F2018:C822 from here ...
	* array.c (gfc_set_array_spec): ... to here.

From-SVN: r277298
2019-10-22 18:38:30 +00:00
Marek Polacek 7aec4a8d7d PR c++/92062 - ODR-use ignored for static member of class template.
* pt.c (has_value_dependent_address): Strip location wrappers.

	* g++.dg/cpp0x/constexpr-odr1.C: New test.
	* g++.dg/cpp0x/constexpr-odr2.C: New test.

From-SVN: r277295
2019-10-22 15:46:47 +00:00
Marek Polacek d986a59558 PR c++/92106 - ICE with structured bindings and -Wreturn-local-addr.
* typeck.c (maybe_warn_about_returning_address_of_local): Avoid
	recursing on null initializer and return false instead.

From-SVN: r277294
2019-10-22 15:21:34 +00:00
GCC Administrator 2d39687a29 Daily bump.
From-SVN: r277275
2019-10-22 00:16:14 +00:00
Jakub Jelinek 71ff84826d backport: re PR tree-optimization/92056 (ice in expr_object_size, at tree-object-si ze.c:675 with -O3)
Backported from mainline
	2019-10-17  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/92056
	* tree-object-size.c (cond_expr_object_size): Return early if then_
	processing resulted in unknown size.

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

From-SVN: r277259
2019-10-21 13:49:18 +02:00
Jakub Jelinek b86880388b backport: re PR fortran/87752 (ICE in omp_add_variable, at gimplify.c:6776)
Backported from mainline
	2019-10-17  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/87752
	* gfortran.dg/gomp/pr87752.f90: New test.

From-SVN: r277258
2019-10-21 13:48:34 +02:00
Jakub Jelinek 12f707007c backport: re PR tree-optimization/91734 (gcc skip an if statement with "-O1 -ffast-math")
Backported from mainline
	2019-10-05  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/91734
	* generic-match-head.c: Include fold-const-call.h.
	* match.pd (sqrt(x) cmp c): Check the boundary value and
	in case inexact computation of c*c affects comparison of the boundary,
	turn LT_EXPR into LE_EXPR, GE_EXPR into GT_EXPR, LE_EXPR into LT_EXPR
	or GT_EXPR into GE_EXPR.  Punt for sqrt comparisons against NaN and
	for -frounding-math.  For c2, try the next smaller or larger floating
	point constant depending on comparison code and if it has the same
	sqrt as c2, use it instead of c2.

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

From-SVN: r277257
2019-10-21 13:48:00 +02:00
Jakub Jelinek ff470de3ce backport: re PR c++/91974 (function not sequenced before function argument)
Backported from mainline
	2019-10-04  Jakub Jelinek  <jakub@redhat.com>

	PR c++/91974
	* cp-gimplify.c (cp_gimplify_expr) <case CALL_EXPR>: For
	-fstrong-eval-order ensure CALL_EXPR_FN side-effects are evaluated
	before any arguments.  Additionally, ensure CALL_EXPR_FN that isn't
	invariant nor OBJ_TYPE_REF nor SSA_NAME is forced into a temporary.

	* g++.dg/cpp1z/eval-order5.C: New test.

From-SVN: r277256
2019-10-21 13:47:09 +02:00
Jakub Jelinek 2990eccb24 backport: re PR c++/91925 (-fpack-struct causes a decltype with template to ICE)
Backported from mainline
	2019-10-01  Jakub Jelinek  <jakub@redhat.com>

	PR c++/91925
	* c-warn.c (check_alignment_of_packed_member): Ignore FIELD_DECLs
	with NULL DECL_FIELD_OFFSET.

	* g++.dg/conversion/packed2.C: New test.

From-SVN: r277255
2019-10-21 13:46:21 +02:00
Jakub Jelinek b4476ac6cc backport: re PR bootstrap/90543 (Build failure on MINGW for gcc-9.1.0)
Backported from mainline
	2019-09-29  Jakub Jelinek  <jakub@redhat.com>

	PR bootstrap/90543
	* optc-save-gen.awk: Fix up printing string option differences.

From-SVN: r277254
2019-10-21 13:45:27 +02:00
Jakub Jelinek 2ef0748daa backport: re PR c++/88203 (assert does not compile with OpenMP's pragma omp parallel for default(none))
Backported from mainline
	2019-09-27  Jakub Jelinek  <jakub@redhat.com>

	PR c++/88203
	* c-common.h (c_omp_predefined_variable): Declare.
	* c-omp.c (c_omp_predefined_variable): New function.
	(c_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED
	for predefined variables.

	* c-parser.c (c_parser_predefined_identifier): New function.
	(c_parser_postfix_expression): Use it.
	(c_parser_omp_variable_list): Parse predefined identifiers.
	* c-typeck.c (c_finish_omp_clauses): Allow predefined variables
	in shared and firstprivate clauses, even when they are predetermined
	shared.

	* parser.c (cp_parser_omp_var_list_no_open): Parse predefined
	variables.
	* semantics.c (finish_omp_clauses): Allow predefined variables in
	shared and firstprivate clauses, even when they are predetermined
	shared.
	* cp-gimplify.c (cxx_omp_predetermined_sharing_1): Return
	OMP_CLAUSE_DEFAULT_SHARED for predefined variables.

	* c-c++-common/gomp/pr88203-1.c: New test.
	* c-c++-common/gomp/pr88203-2.c: New test.
	* c-c++-common/gomp/pr88203-3.c: New test.

From-SVN: r277253
2019-10-21 13:44:53 +02:00
Jakub Jelinek 5737654316 backport: re PR middle-end/91920 (ggc 9.2.0 failing openmp compile on ppc64le)
Backported from mainline
	2019-09-27  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/91920
	* gimplify.c (omp_default_clause): Predetermine DECL_IN_CONSTANT_POOL
	variables as shared.

	* c-c++-common/gomp/pr91920.c: New test.

From-SVN: r277252
2019-10-21 13:43:16 +02:00
Jakub Jelinek 3f1c4be2b6 backport: re PR rtl-optimization/89435 (wrong code with -O1 -march=armv4 -fno-forward-propagate with __builtin_sub_overflow())
Backported from mainline
	2019-09-11  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/89435
	PR rtl-optimization/89795
	PR rtl-optimization/91720
	* gcc.dg/pr89435.c: New test.
	* gcc.dg/pr89795.c: New test.
	* gcc.dg/pr91720.c: New test.

From-SVN: r277251
2019-10-21 13:42:37 +02:00
Jakub Jelinek 75a07394b1 backport: re PR tree-optimization/91723 (builtin fma is not optimized or vectorized as *+)
Backported from mainline
	2019-09-11  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/91723
	* tree-vect-stmts.c (vectorizable_call): Use types_compatible_p check
	instead of pointer equality when checking if argument vectypes are
	the same.

	* gcc.dg/vect/vect-fma-3.c: New test.

From-SVN: r277250
2019-10-21 13:41:40 +02:00
Jakub Jelinek 31759d6e52 backport: re PR tree-optimization/91665 (ICE in build_vector_from_val, at tree.c:1904)
Backported from mainline
	2019-09-07  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/91665
	* tree-vect-loop.c (vectorizable_reduction): Punt if base has type
	incompatible with the type of PHI result.

	* gcc.dg/vect/pr91665.c: New test.

From-SVN: r277249
2019-10-21 13:40:48 +02:00
Jakub Jelinek 3ddfd778d5 backport: re PR middle-end/91001 (internal compiler error: in extract_insn, at recog.c:2310)
Backported from mainline
	2019-09-06  Jakub Jelinek  <jakub@redhat.com>

	* function.c (assign_parm_find_data_types): Use RECORD_OR_UNION_TYPE_P
	before testing TYPE_TRANSPARENT_AGGR.
	* calls.c (initialize_argument_information, load_register_parameters):
	Likewise.

	2019-09-05  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/91001
	PR middle-end/91105
	PR middle-end/91106
	* calls.c (load_register_parameters): For TYPE_TRANSPARENT_AGGR
	types, use type of their first field instead of type of
	args[i].tree_value.

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

From-SVN: r277248
2019-10-21 13:39:53 +02:00
Jakub Jelinek 93405bb7d4 backport: re PR tree-optimization/91632 (Probably wrong code since r275026)
Backported from mainline
	2019-09-02  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/91632
	* gcc.c-torture/execute/pr91632.c: New test.

From-SVN: r277247
2019-10-21 13:39:04 +02:00
Jakub Jelinek 4ae11c8ecb backport: re PR middle-end/91623 (-msse4.1 -O3 segfault in /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/smmintrin.h:270:10)
Backported from mainline
	2019-09-01  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/91623
	* optabs.c (expand_vec_cond_expr): If op0 is a VECTOR_CST and only
	EQ_EXPR/NE_EXPR is supported, verify that op0 only contains
	zeros or negative elements and use NE_EXPR instead of LT_EXPR against
	zero vector.

	* gcc.target/i386/pr91623.c: New test.

From-SVN: r277246
2019-10-21 13:38:37 +02:00
Jakub Jelinek d8681a0f44 backport: re PR lto/91572 (lto1: error: type variant has different ‘TREE_TYPE’ since r269862)
Backported from mainline
	2019-09-01  Jakub Jelinek  <jakub@redhat.com>

	PR lto/91572
	* tree.c (find_decls_types_in_node): Also walk TREE_PURPOSE of
	GIMPLE_ASM TREE_LIST operands.

	* g++.dg/lto/pr91572_0.C: New test.

From-SVN: r277245
2019-10-21 13:37:41 +02:00
Jakub Jelinek 56131f53b9 backport: re PR go/91617 (Many go test case failures after r275026)
Backported from mainline
	2019-09-02  Jakub Jelinek  <jakub@redhat.com>

	PR go/91617
	* fold-const.c (range_check_type): For enumeral and boolean
	type, pass 1 to type_for_size langhook instead of
	TYPE_UNSIGNED (etype).  Return unsigned_type_for result whenever
	etype isn't TYPE_UNSIGNED INTEGER_TYPE.
	(build_range_check): Don't call unsigned_type_for for pointer types.
	* match.pd (X / C1 op C2): Don't call unsigned_type_for on
	range_check_type result.

	2019-08-29  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/91351
	* tree-cfg.c (generate_range_test): Use range_check_type instead of
	unsigned_type_for.
	* tree-cfgcleanup.c (convert_single_case_switch): Punt if
	range_check_type returns NULL.
	* tree-switch-conversion.c (switch_conversion::build_one_array):
	Use range_check_type instead of unsigned_type_for, don't perform
	linear opt if it returns NULL.
	(bit_test_cluster::find_bit_tests): Formatting fix.
	(bit_test_cluster::emit): Use range_check_type instead of
	unsigned_type_for.
	(switch_decision_tree::try_switch_expansion): Punt if range_check_type
	returns NULL.

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

From-SVN: r277244
2019-10-21 13:36:36 +02:00
Jakub Jelinek e79fcceb96 backport: re PR c/91401 (schedule + dist_schedule clauses rejected on distribute parallel for)
Backported from mainline
	2019-08-09  Jakub Jelinek  <jakub@redhat.com>

	PR c/91401
	* c-parser.c (c_parser_omp_clause_dist_schedule): Fix up typos in the
	check_no_duplicate_clause call.  Comment it out, instead emit a
	warning for duplicate dist_schedule clauses.

	* parser.c (cp_parser_omp_clause_dist_schedule): Comment out the
	check_no_duplicate_clause call, instead emit a warning for duplicate
	dist_schedule clauses.

	* c-c++-common/gomp/pr91401-1.c: New test.
	* c-c++-common/gomp/pr91401-2.c: New test.

From-SVN: r277243
2019-10-21 13:35:09 +02:00
Jakub Jelinek 68a88d9a64 backport: quadmath.h (M_Eq, [...]): Use two more decimal places.
Backported from mainline
	2019-08-02  Jakub Jelinek  <jakub@redhat.com>

	* quadmath.h (M_Eq, M_LOG2Eq, M_LOG10Eq, M_LN2q, M_LN10q, M_PIq,
	M_PI_2q, M_PI_4q, M_1_PIq, M_2_PIq, M_2_SQRTPIq, M_SQRT2q,
	M_SQRT1_2q): Use two more decimal places.

From-SVN: r277242
2019-10-21 13:34:04 +02:00
GCC Administrator b1a1f2b34c Daily bump.
From-SVN: r277220
2019-10-21 00:16:13 +00:00
GCC Administrator d0175ab0af Daily bump.
From-SVN: r277208
2019-10-20 00:16:24 +00:00
GCC Administrator 4f8bfc8eef Daily bump.
From-SVN: r277198
2019-10-19 00:18:12 +00:00
Steven G. Kargl 11aa1d0228 re PR fortran/69455 ([F08] Assembler error(s) when using intrinsic modules in two BLOCK)
2019-10-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/69455
	* trans-decl.c (generate_local_decl): Avoid misconstructed
	intrinsic modules in a BLOCK construct.

2019-10-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/69455
	* gfortran.dg/pr69455_1.f90: New test.
	* gfortran.dg/pr69455_2.f90: Ditto.

From-SVN: r277160
2019-10-18 17:59:32 +00:00
Tobias Burnus 412f7637d1 Fortran] PR91586 Fix ICE on invalid code with CLASS
gcc/fortran/
        Backport from mainline
        2019-10-18  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/91586
        * class.c (gfc_find_derived_vtab): Return NULL
        instead of deref'ing NULL pointer.

        gcc/testsuite/
        Backport from mainline
        2019-10-18  Tobias Burnus  <tobias@codesourcery.com>

        PR fortran/91586
        * gfortran.dg/class_71.f90: New.

From-SVN: r277154
2019-10-18 14:38:26 +02:00
Georg-Johann Lay 3c6c71fcda backport: re PR target/86040 ([avr]: RAMPZ is not always cleared after loading __flashN data)
Backport from 2019-10-18 trunk r277143.
	PR target/86040
	* config/avr/avr.c (avr_out_lpm): Do not shortcut-return.

From-SVN: r277147
2019-10-18 09:10:20 +00:00
Georg-Johann Lay 473237d3ca avr-mmcu.texi: Re-generate because config/avr/avr-devices.c was changed in r269487.
* doc/avr-mmcu.texi: Re-generate because config/avr/avr-devices.c
	was changed in r269487.

From-SVN: r277146
2019-10-18 09:06:40 +00:00
Iain Sandoe 5b236c5474 [Darwin] Amend section for constants with relocations.
Darwin's linker doesn't like text section relocations (they require special
enabling).  The Fortran FE, at least, seems to generate cases where the
initialiser for a pointer constant can need a relocation.  We can handle
this by special-casing SECCAT_RODATA when the relocation is present by
placing the constant in the .const_data section.

gcc/

2019-10-18  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-10-05  Iain Sandoe  <iain@sandoe.co.uk>

	PR target/59888
	* config/darwin.c (darwin_rodata_section): Add relocation flag,
	choose const_data section for constants with relocations.
	(machopic_select_section): Pass relocation flag to
	darwin_rodata_section ().

From-SVN: r277145
2019-10-18 08:42:41 +00:00
Iain Sandoe 18ab02dc31 [Darwin] Update machopic_legitimize_pic_address.
Some changes were missed here in the transition to LRA. The Darwin
archs are all using LRA now, testing for reload is not correct.

2019-10-18  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-09-21  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (machopic_legitimize_pic_address): Check
	for lra, rather than reload.

From-SVN: r277144
2019-10-18 07:54:12 +00:00
GCC Administrator 2de95dfec0 Daily bump.
From-SVN: r277139
2019-10-18 00:16:18 +00:00
John David Anglin f1c2021734 pa.c (pa_output_indirect_call): Fix typos in last change.
* config/pa/pa.c (pa_output_indirect_call): Fix typos in last change.

From-SVN: r277136
2019-10-17 22:44:24 +00:00
Richard Earnshaw aef3827944 [arm] PR target/89400 fix thumb1 unaligned access expansion
Armv6 has support for unaligned accesses to memory.  However, the
thumb1 code patterns were trying to use the 32-bit code constraints.
One failure mode from this was that the patterns are designed to be
compatible with conditional execution and this was then causing an
assert in the compiler.

The unaligned_loadhis pattern is only used for expanding extv, which
in turn is only enabled for systems supporting thumb2.  Given that
there is no simple expansion for a thumb1 sign-extending load (the
instruction has no immediate offset form and requires two registers in
the address) it seems simpler to just disable this for thumb1.

Fixed thusly:

        Backport from trunk:
	2019-05-03  Richard Earnshaw  <rearnsha@arm.com>

	PR target/89400
	* config/arm/arm.md (unaligned_loadsi): Add variant for thumb1.
	Restrict 'all' variant to 32-bit configurations.
	(unaligned_loadhiu): Likewise.
	(unaligned_storehi): Likewise.
	(unaligned_storesi): Likewise.
	(unaligned_loadhis): Disable when compiling for thumb1.

From-SVN: r277123
2019-10-17 16:45:46 +00:00
Steven G. Kargl 07136dbc06 re PR fortran/83113 (Bogus "duplicate allocatable attribute" error for submodule character function)
2019-10-17  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/83113
	PR fortran/89943
	decl.c (gfc_match_function_decl): Ignore duplicate BIND(C) for function
	declaration in submodule.  Implement at check for F2018 C1550.
	(gfc_match_entry): Use temporary for locus, which allows removal of
	one gfc_error_now().
	(gfc_match_subroutine): Ignore duplicate BIND(C) for subroutine
	declaration in submodule.  Implement at check for F2018 C1550.

2019-10-17  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/83113
	PR fortran/89943
	* gfortran.dg/pr89943_1.f90: New test.
	* gfortran.dg/pr89943_2.f90: Ditto.
	* gfortran.dg/pr89943_3.f90: Ditto.
	* gfortran.dg/pr89943_4.f90: Ditto.

From-SVN: r277122
2019-10-17 16:30:25 +00:00
Bill Schmidt 949e5c7be1 backport: re PR testsuite/92093 (New test case gcc.target/powerpc/pr91275.c from r276410 fails on BE)
2019-10-17  Bill Schmidt  <wschmidt@linux.ibm.com>

	Backport from mainline
	2019-10-15  Bill Schmidt  <wschmidt@linux.ibm.com>

	PR target/92093
	* gcc.target/powerpc/pr91275.c: Fix type and endian issues.

From-SVN: r277117
2019-10-17 15:32:40 +00:00
GCC Administrator 1d0b59fa1f Daily bump.
From-SVN: r277087
2019-10-17 00:16:13 +00:00
Iain Sandoe 4513e4dd3c [Darwin] Pick up SDKROOT as the sysroot fallback.
For compatibility with xcrun and the behaviour of the clang driver, make use
of the setting of the SDKROOT environment variable when it is available.
This applies to both finding headers and libraries (i.e. it is also passed to
ld64).

Priority:
1. User's command-line specified --sysroot= or -isysroot.
2. The SDKROOT variable when set, and validated.
3. Any sysroot provided by --with-sysroot= configuration parameter.

SDKROOT is checked thus:
1. Presence.
2. That it starts with / (i.e. 'absolute').
3. That it is not / only (since that's the default).
4. That it is readable by the process executing the driver.

This is pretty much the same rule set as used by the clang driver.

NOTE: (3) might turn out to be overly restrictive in the case that we
have configured with --with-sysroot= and then we want to run on a system
with an installation of the headers/libraries in /. We can revisit this
if that turns out to be an important use-case.

So one can do:

xcrun --sdk macosx /path/to/gcc ....

and that provides the SDK path as the sysroot to GCC as expected.

CAVEAT: An unfortunate effect of the fact that gcc (and g++) are
executables in the Xcode installation, which are found ahead of any such
named in the /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin:/usr/local/tools/gcc-2016/bin:

PATH=/path/to/gcc/install:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin:/usr/local/tools/gcc-2016/bin
xcrun --sdk macosx gcc ....

does *not* work, instead that executes the clang from the xcode/commmand
line tools installation.

PATH=/path/to/gcc/install:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin:/usr/local/tools/gcc-2016/bin
xcrun --sdk macosx x64_64-apple-darwinXX-gcc ...

does work as expected, however.

2019-10-16  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-10-03  Iain Sandoe  <iain@sandoe.co.uk>

	PR target/87243
	* config/darwin-driver.c (maybe_get_sysroot_from_sdkroot): New.
	(darwin_driver_init): Use the sysroot provided by SDKROOT when that
	is available and the user has not set one on the command line.

From-SVN: r277079
2019-10-16 19:22:17 +00:00
Iain Sandoe 3fb05f2ad3 [Darwin, specs] Backport fixes for driver handling of PIE options.
pie, no-pie and rdynamic are driver options, we can process them in the
relevant place and drop them once dealt with. There's no need to generate
a new header to process the no_compact_unwind which is applied on the
basis of the target system.

Support for the -pie, -no_pie and -no_compact_unwind options should ideally
be checked at configure time, however the status quo is to assert that linkers
capable of targeting the relevant systems support these options (i.e. we trust
that the user doesn't attempt to configure inappropriately).

TODO: check the availability of the linker opts in configure rather than
trusting to the user.

This will fix the fail of pie-7.c, which is a result of failing to handle the
no-pie driver option.

2019-10-16  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-07-03  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.h (DRIVER_SELF_SPECS): Remove the linker cases.
	(RDYNAMIC): Rename to, DARWIN_RDYNAMIC.
	(DARWIN_PIE_SPEC, DARWIN_NOPIE_SPEC): Adjust to remove the Xlinker
	clauses.
	(LINK_COMMAND_SPEC_A): Add DARWIN_RDYNAMIC, DARWIN_PIE_SPEC and
	DARWIN_NOPIE_SPEC.

	Backport from mainline
	2019-06-19  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.h (DRIVER_SELF_SPECS): Add RDYNAMIC, DARWIN_PIE_SPEC
	and DARWIN_NOPIE_SPEC.
	(RDYNAMIC): New, modified from DARWIN_EXPORT_DYNAMIC.
	(DARWIN_PIE_SPEC): Collate from darwin.h and darwin9.h.
	(DARWIN_NOPIE_SPEC): Collate from darwin10.h.
	(DARWIN_NOCOMPACT_UNWIND): New from darwin10.h
	(DARWIN_EXPORT_DYNAMIC): Delete.
	* config/darwin10.h (LINK_GCC_C_SEQUENCE_SPEC): Move no_compact_unwind
	and pie options processing to  darwin.h.
	* config/darwin9.h (DARWIN_PIE_SPEC): Move pie processing to darwin.h

From-SVN: r277078
2019-10-16 19:12:33 +00:00
Richard Biener c7f4da9f30 Backport PRs 91606, 91772, 91790, 91812, 91968
2019-10-16  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-10-04  Richard Biener  <rguenther@suse.de>

	PR lto/91968
	* tree.c (find_decls_types_r): Do not remove LABEL_DECLs from
	BLOCK_VARS.

	2019-10-02  Richard Biener  <rguenther@suse.de>

	PR c++/91606
	* decl.c (build_ptrmemfunc_type): Mark pointer-to-member
	fat pointer structure members as DECL_NONADDRESSABLE_P.

	* g++.dg/torture/pr91606.C: New testcase.

	2019-09-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91812
	* tree-ssa-phiprop.c (propagate_with_phi): Do not replace
	volatile loads.

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

	2019-09-17  Richard Biener  <rguenther@suse.de>

	PR debug/91772
	* dwarf2out.c (dwarf2out_late_global_decl): If early dwarf
	was missing generate locations only once.

	2019-09-17  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91790
	* tree-vect-stmts.c (vectorizable_load): For BB vectorization
	use the correct DR for setting up realignment.

From-SVN: r277055
2019-10-16 09:25:34 +00:00
GCC Administrator 80f606b1f3 Daily bump.
From-SVN: r277032
2019-10-16 00:16:11 +00:00
John David Anglin 68397a8ff9 fptr.c (_dl_read_access_allowed): Change argument to unsigned int.
* config/pa/fptr.c (_dl_read_access_allowed): Change argument to
	unsigned int.  Adjust callers.
	(__canonicalize_funcptr_for_compare): Change plabel type to volatile
	unsigned int *.  Load relocation offset before function pointer.
	Add barrier to ensure ordering.

From-SVN: r277016
2019-10-15 22:20:12 +00:00
GCC Administrator cecc781c19 Daily bump.
From-SVN: r276981
2019-10-15 00:16:13 +00:00
Will Schmidt e504cd9a4f backport: rs6000-builtin.def: (LVSL...
Backport from trunk
[gcc]

2019-09-26  Will Schmidt <will_schmidt@vnet.ibm.com>
	* config/rs6000/rs6000-builtin.def: (LVSL, LVSR, LVEBX, LVEHX,
	LVEWX, LVXL, LVXL_V2DF, LVXL_V2DI, LVXL_V4SF, LVXL_V4SI, LVXL_V8HI,
	LVXL_V16QI, LVX, LVX_V1TI, LVX_V2DF, LVX_V2DI, LVX_V4SF, LVX_V4SI,
	LVX_V8HI, LVX_V16QI, LVLX, LVLXL, LVRX, LVRXL, LXSDX, LXVD2X_V1TI,
	LXVD2X_V2DF, LXVD2X_V2DI, LXVDSX, LXVW4X_V4SF, LXVW4X_V4SI,
	LXVW4X_V8HI, LXVW4X_V16QI, LD_ELEMREV_V1TI, LD_ELEMREV_V2DF,
	LD_ELEMREV_V2DI, LD_ELEMREV_V4SF, LD_ELEMREV_V4SI, LD_ELEMREV_V8HI,
	LD_ELEMREV_V16QI): Use the PURE attribute.

[testsuite]

2019-09-26  Will Schmidt <will_schmidt@vnet.ibm.com>
	* gcc.target/powerpc/pure-builtin-redundant-load.c:  New.

From-SVN: r276966
2019-10-14 18:11:47 +00:00
GCC Administrator 711cd9cea2 Daily bump.
From-SVN: r276946
2019-10-14 00:16:12 +00:00
GCC Administrator 9fe3fc5d56 Daily bump.
From-SVN: r276932
2019-10-13 00:16:40 +00:00
John David Anglin 6f3b5c4d45 pa.c (pa_output_call): Load descriptor address to register %r22.
* config/pa/pa.c (pa_output_call): Load descriptor address to register
	%r22.  Load function address before global pointer.
	(pa_attr_length_indirect_call): Adjust length of inline versions of
	$$dyncall.
	(pa_output_indirect_call): Remove fast inline version of $$dyncall
	before normal cases.  Update inline $$dyncall sequences to preserve
	function descriptor address in register %r22.
	(TRAMPOLINE_CODE_SIZE): Adjust.
	(pa_asm_trampoline_template): Revise 32-bit trampoline.  Don't assume
	register %r22 contains trampoline address.
	(pa_trampoline_init): Adjust offsets.
	(pa_trampoline_adjust_address): Likewise.
	* config/pa/pa.h (TRAMPOLINE_SIZE): Adjust 32-bit size.

From-SVN: r276929
2019-10-12 20:39:41 +00:00
John David Anglin f0e39057b6 lib2funcs.S (__gcc_plt_call): Load branch target to %r21.
* config/pa/lib2funcs.S (__gcc_plt_call): Load branch target to %r21.
	Load PIC register after branch target.  Fix white space.
	* config/pa/milli64.S ($$dyncall): Separate LINUX and non LINUX
	implementations.  Load PIC register after branch target.  Don't
	clobber function pointer when it points to function descriptor.
	Use nullification instead of branch in LINUX implementation.

From-SVN: r276927
2019-10-12 19:44:29 +00:00
Eric Botcazou 72c1a8216d re PR ada/91995 (gnat miscompilation and bootstrap failure on m68k-linux)
PR ada/91995
	* sem_ch8.adb (Chain_Use_Clause): Remove second argument in calls
	to Defining_Entity.
	* sem_elab.adb (Find_Unit_Entity): Likewise.  Deal with N_Subunit
	here in lieu of in Defining_Entity.
	* sem_spark.adb (Check_Callable_Body): Likewise.
	(Check_Package_Body): Likewise.
	* sem_util.ads (Defining_Entity): Remove 2nd and 3th parameters.
	* sem_util.adb (Defining_Entity): Remove 2nd and 3th parameters,
	and adjust accordingly.  Deal with N_Compilation_Unit.

From-SVN: r276917
2019-10-12 14:49:21 +00:00
GCC Administrator 47c5cac3e6 Daily bump.
From-SVN: r276911
2019-10-12 00:16:13 +00:00
Steven G. Kargl a0368cad1d re PR fortran/91715 (ICE in resolve_fntype, at fortran/resolve.c:16884)
2019-10-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91715
	* decl.c (gfc_match_prefix): If matching a type-spec returns an error,
	it's an error so re-act correctly.

2019-10-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91715
	* gfortran.dg/function_kinds_5.f90: Prune run-on error.
	* gfortran.dg/pr85543.f90: Ditto.
	* gfortran.dg/pr91715.f90: New test.

From-SVN: r276905
2019-10-11 20:19:28 +00:00
Steven G. Kargl 2a5edf2170 re PR fortran/91649 (ICE in gfc_resolve_findloc, at fortran/iresolve.c:1827)
2019-10-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91649
	check.c (gfc_check_findloc): Additional checking for valid arguments

2019-10-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91649
	* gfortran.dg/pr91649.f90: New test.

From-SVN: r276904
2019-10-11 20:06:15 +00:00
Joseph Myers 10532b8acc * fi.po: Update.
From-SVN: r276895
2019-10-11 18:24:22 +01:00
Eric Botcazou 4c675f6df4 decl.c (annotate_value): Really test the sign of the value when deciding to build a NEGATE_EXPR.
* gcc-interface/decl.c (annotate_value) <INTEGER_CST>: Really test the
	sign of the value when deciding to build a NEGATE_EXPR.
	<PLUS_EXPR>: Remove redundant line.
	<BIT_AND_EXPR>: Do the negation here.

From-SVN: r276867
2019-10-11 08:57:37 +00:00
GCC Administrator cb16c175bb Daily bump.
From-SVN: r276857
2019-10-11 00:16:38 +00:00
Steven G. Kargl 7c2031db03 re PR fortran/91801 (ICE in gfc_simplify_reshape, at fortran/simplify.c:6733)
2019-10-10  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91801
	* simplify.c (gfc_simplify_reshape): Convert a gcc_assert into a
	gfc_error as a user can easily hit the condition.

2019-10-10  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91801
	* gfortran.dg/pr91801.f90: New test.

From-SVN: r276853
2019-10-10 21:56:08 +00:00
Uros Bizjak 082b25fb77 re PR target/92022 (ICE in alpha_handle_trap_shadows, at config/alpha/alpha.c:8847)
PR target/92022
	* config/alpha/alpha.c (alpha_handle_trap_shadows): Skip DEBUG_INSN.

testsuite/ChangeLog:

	PR target/92022
	* g++.dg/pr92022.C: New test.

From-SVN: r276844
2019-10-10 19:45:40 +02:00
Oleg Endo 26c8923aab backport: re PR target/88630 (Incorrect float negating together with convertion to int on ST-40)
gcc/
	Backport from mainline
	2019-10-10  Oleg Endo  <olegendo@gcc.gnu.org>

	PR target/88630
	* config/sh/sh.h (TARGET_FPU_SH4_300): New macro.
	* config/sh/sh.c (sh_option_override): Enable fsca and fsrra insns
	also for TARGET_FPU_SH4_300.
	(sh_emit_mode_set): Check for TARGET_FPU_SH4_300 instead of
	TARGET_SH4_300.
	* config/sh/sh.md (toggle_pr): Add TARGET_FPU_SH4_300 condition.
	(negsf2): Expand to either negsf2_fpscr or negsf2_no_fpscr.
	(*negsf2_i): Split into ...
	(negsf2_fpscr, negsf2_no_fpscr): ... these new patterns.
	(abssf2): Expand to either abssf2_fpsc or abssf2_no_fpsc.
	(**abssf2_i): Split into ...
	(abssf2_fpscr, abssf2_no_fpscr): ... these new patterns.
	(negdf2): Expand to either negdf2_fpscr or negdf2_no_fpscr.
	(*negdf2_i): Split into ...
	(negdf2_fpscr, negdf2_no_fpscr): ... these new patterns.
	(absdf2): Expand to either absdf2_fpscr or absdf2_no_fpsc.
	(**abssf2_i): Split into ...
	(absdf2_fpscr, absdf2_no_fpscr): ... these new patterns.

From-SVN: r276825
2019-10-10 15:24:05 +00:00
Andreas Krebbel ac017398dc S/390: Add support for z15 as CPU name.
So far z15 was identified as arch13. After the machine has been
announced we can now add the real name.

gcc/ChangeLog:

2019-10-10  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2019-10-10  Andreas Krebbel  <krebbel@linux.ibm.com>

	* common/config/s390/s390-common.c (PF_ARCH13): Rename to...
	(PF_Z15): ... this.
	* config.gcc: Add z15 as option for --with-arch and --with-tune
	configure switches.
	* config/s390/s390-c.c (s390_resolve_overloaded_builtin): Add
	error reporting for unsupported builtins.
	* config/s390/s390-opts.h (enum processor_type): Rename
	PROCESSOR_8561_ARCH13 to PROCESSOR_8561_Z15.
	* config/s390/8561.md: Rename arch13 to z15 throughout the file.
	* config/s390/driver-native.c (s390_host_detect_local_cpu):
	Likewise.
	* config/s390/s390-builtins.def: Likewise.
	* config/s390/s390.c (processor_table): Add z15 as option and keep arch13 as alternative.
	(s390_expand_builtin): Add missing check for unsupported builtins.
	(s390_canonicalize_comparison): Rename TARGET_ARCH13 to TARGET_Z15.
	(s390_rtx_costs): Likewise.
	(s390_get_sched_attrmask): Rename arch13 to z15.
	(s390_get_unit_mask): Likewise.
	(s390_is_fpd): Likewise.
	(s390_is_fxd): Likewise.
	* config/s390/s390.h (enum processor_flags): Likewise.
	* config/s390/s390.md: Likewise.
	* config/s390/vector.md: Likewise.
	* config/s390/vx-builtins.md: Likewise.
	* config/s390/s390.opt: Add z15 to processor_type value.

From-SVN: r276793
2019-10-10 09:09:42 +00:00
GCC Administrator e730a1dcaf Daily bump.
From-SVN: r276785
2019-10-10 00:16:15 +00:00
GCC Administrator 1cc19198e6 Daily bump.
From-SVN: r276749
2019-10-09 00:16:18 +00:00
Marek Polacek b3416a9a62 PR c++/91740 - ICE with constexpr call and ?: in ARRAY_REF.
* pt.c (build_non_dependent_expr): Call build_non_dependent_expr for
	the first operand.

From-SVN: r276699
2019-10-08 13:38:35 +00:00
GCC Administrator cec06322ce Daily bump.
From-SVN: r276684
2019-10-08 00:16:12 +00:00
Thomas Koenig c5b2ab5b80 backport: re PR fortran/84487 (Large rodate section increase in 465.tonto with r254427)
2019-10-07  Thomas Koenig <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/84487
	* trans-decl.c (gfc_get_symbol_decl): For __def_init, set
	DECL_ARTIFICAL and do not set TREE_READONLY.

2019-10-07  Thomas Koenig <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/84487
	* gfortran.dg/typebound_call_22.f03: xfail.

From-SVN: r276672
2019-10-07 20:10:22 +00:00
Bill Schmidt eb9379e2ce backport: re PR target/91275 (__builtin_crypto_vpmsumd gives different results -O[123] vs -O0)
[gcc]

2019-10-07  Bill Schmidt  <wschmidt@linux.ibm.com>

	Backport from mainline
	2019-10-01  Bill Schmidt  <wschmidt@linux.ibm.com>

	PR target/91275
	* config/rs6000/rs6000-p8swap.c (rtx_is_swappable_p): Don't swap
	vpmsumd.

[gcc/testsuite]

2019-10-07  Bill Schmidt  <wschmidt@linux.ibm.com>

	Backport from mainline
	2019-10-01  Bill Schmidt  <wschmdit@linux.ibm.com>

	PR target/91275
	* gcc.target/powerpc/pr91275.c: New.

From-SVN: r276667
2019-10-07 18:23:20 +00:00
GCC Administrator 5d584583e2 Daily bump.
From-SVN: r276643
2019-10-07 00:16:21 +00:00
GCC Administrator 82f6a2872f Daily bump.
From-SVN: r276633
2019-10-06 00:16:33 +00:00
Steven G. Kargl af7096d694 re PR fortran/47054 (Compilation error when cray pointers are declared in both host and internal subroutines)
2019-10-05  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/47054
	* decl.c (variable_decl): Do not search parent namespace for symbol.

2019-10-05  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/47054
	* gfortran.dg/pr47054_1.f90: New test
	* gfortran.dg/pr47054_2.f90: Ditto.

From-SVN: r276628
2019-10-05 15:42:25 +00:00
Andrea Corallo 40d2b0af81 Backport fix for PR jit/91928
gcc/ChangeLog

2019-10-05  Andrea Corallo  <andrea.corallo@arm.com>

	Backport from mainline
	2019-10-03  Andrea Corallo  <andrea.corallo@arm.com>
	* gcc/ipa-cp.c (ipa_cp_c_finalize): Release ipcp_transformation_sum
	when finished.
	* ipa-prop.c (ipcp_free_transformation_sum): New function.
	* ipa-prop.h (ipcp_free_transformation_sum): Add declaration.

From-SVN: r276625
2019-10-05 09:02:25 +00:00
Steven G. Kargl aaeb2de782 re PR fortran/91942 (ICE in match_vtag, at fortran/io.c:1485)
2019-10-04  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91942
	* io.c (match_vtag): Check for non-NULL result->symtree.
	(match_out_tag): Check for invalid constant due to inquiry parameter.
	(match_filepos): Instead of a syntax error, go to cleanup to get better
	error messages.

2019-10-04  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91942
	* gfortran.dg/pr91587.f90: Update dg-error regex.
	* gfortran.dg/pr91942.f90: New test.

From-SVN: r276620
2019-10-05 04:05:05 +00:00
Steven G. Kargl 4e58c9a2c7 re PR fortran/91785 (ICE in check_assumed_size_reference, at fortran/resolve.c:1601)
2019-10-04  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91785
	* primary.c (gfc_match_varspec): Ensure an inquiry parameter has
	it locus set.

2019-10-04  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91785
	* gfortran.dg/pr91785.f90: New test.

From-SVN: r276619
2019-10-05 03:55:05 +00:00
GCC Administrator 6c59051d84 Daily bump.
From-SVN: r276617
2019-10-05 00:16:16 +00:00
Dragan Mladjenovic aeee85cef5 Backport fix for PR target/91769
gcc/ChangeLog:

2019-10-04  Dragan Mladjenovic <dmladjenovic@wavecomp.com>

	Backport from mainline
	2019-10-03  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

		PR target/91769
		* config/mips/mips.c (mips_split_move): Use reg_overlap_mentioned_p
		instead of REGNO equality check on addr.reg.

gcc/testsuite/ChangeLog:

2019-10-04  Dragan Mladjenovic <dmladjenovic@wavecomp.com>

	Backport from mainline
	2019-10-03  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

		PR target/91769
		* gcc.target/mips/pr91769.c: New test.

From-SVN: r276570
2019-10-04 11:10:01 +00:00
Dragan Mladjenovic b753d85d20 Backprot fix for uninitialised use in mips_split_move
Fixes PR target/91474 and PR target/91702.

2019-10-04  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>

	Backport from mainline
	2019-07-07  Richard Sandiford  <richard.sandiford@arm.com>

	gcc/
		* config/mips/mips.c (mips_split_move): Zero-initialize addr
		and check whether addr.reg is nonnull before using it.

From-SVN: r276569
2019-10-04 10:57:48 +00:00
GCC Administrator 3d583f47b7 Daily bump.
From-SVN: r276559
2019-10-04 00:16:23 +00:00
GCC Administrator 251de2cc07 Daily bump.
From-SVN: r276501
2019-10-03 00:16:15 +00:00
Bernd Edlinger 091421018c backport: re PR fortran/91716 (ICE in output_constant, at varasm.c:5026)
2019-10-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        Backport from mainline

        2019-09-13  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR fortran/91716
        * trans-array.c (gfc_conv_array_initializer): Always assign the
        array type of the field to the string constant.

        PR fortran/91716
        * gfortran.dg/pr91716.f90: New test.

From-SVN: r276458
2019-10-02 13:22:37 +00:00
GCC Administrator 69e83e5017 Daily bump.
From-SVN: r276437
2019-10-02 00:16:15 +00:00
Steven G. Kargl a68dbdc9d9 [multiple changes]
2019-10-01  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91864
	* gcc/fortran/io.c (match_io_element): An inquiry parameter cannot be
	read into.
	* gcc/fortran/match.c (gfc_match_allocate): An inquiry parameter 
	can be neither an allocate-object nor stat variable.
	(gfc_match_deallocate): An inquiry parameter cannot be deallocated.

2019-10-01 Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91864
	* gcc/testsuite/gfortran.dg/pr91864.f90

From-SVN: r276425
2019-10-01 19:21:05 +00:00
Steven G. Kargl 2d280a1cfd backport: re PR fortran/91802 (ICE in mio_name_expr_t, at fortran/module.c:2141)
2019-10-01  Steven G. Kargl  <kargl@gcc.ngu.org>

	Backport of r276254+276265
	PR fortran/91802
	* decl.c (attr_decl1): Check if rank+corank > 15.

2019-10-01  Steven G. Kargl  <kargl@gcc.ngu.org>

	PR fortran/91802
	* gfortran.dg/pr91802.f90: New test.

From-SVN: r276423
2019-10-01 18:58:01 +00:00
Steven G. Kargl f934bfb416 re PR fortran/91714 (Accepts type statement without delimiter in free form)
2019-10-01  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91714
	* decl.c (gfc_match_decl_type_spec):  Issue errors for a few
	mangled types.

2019-10-01  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91714
	* gfortran.dg/dec_type_print_3.f90: Update dg-error regex.
	* gfortran.dg/pr91714.f90: New test.

From-SVN: r276421
2019-10-01 18:37:53 +00:00
Steven G. Kargl 7c4b35823f re PR fortran/91641 (ICE in gfc_conv_is_contiguous_expr, at fortran/trans-intrinsic.c:2857)
2019-10-01  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91641
	* check.c (gfc_check_is_contiguous): null() cannot be an actual
	argument to is_contiguous().

2019-10-01  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91641
	* gfortran.dg/pr91641.f90: New test.

From-SVN: r276419
2019-10-01 18:16:36 +00:00
Oleg Endo 101400d33c backport: re PR c++/88562 (Incorrect pointer incrementing on SH4)
gcc/
2019-10-01  Oleg Endo  <olegendo@gcc.gnu.org>

	Backport from mainline

	2019-10-01  Oleg Endo  <olegendo@gcc.gnu.org>

	PR target/88562
	* config/sh/sh.c (sh_extending_set_of_reg::use_as_extended_reg): Use
	sh_check_add_incdec_notes to preserve REG_INC notes when replacing
	a memory access insn.

From-SVN: r276412
2019-10-01 14:58:10 +00:00
Kyrylo Tkachov 1144493ff5 [AArch64] Don't split 64-bit constant stores to volatile location
2019-10-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	Backport from mainline
	2019-09-24  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* config/aarch64/aarch64.md (mov<mode>): Don't call
	aarch64_split_dimode_const_store on volatile MEM.

	* gcc.target/aarch64/nosplit-di-const-volatile_1.c: New test.

From-SVN: r276398
2019-10-01 10:33:40 +00:00
Kyrylo Tkachov 8ab88e8eb6 driver: Also prune joined switches with negation
2019-10-01  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	Backport from mainline
	2019-09-26  Matt Turner  <mattst88@gmail.com>

	PR driver/69471
	* config/aarch64/aarch64.opt (march=): Add Negative(march=).
	(mtune=): Add Negative(mtune=).
	(mcpu=): Add Negative(mcpu=).
	* config/arm/arm.opt: Likewise.

From-SVN: r276397
2019-10-01 10:28:40 +00:00
GCC Administrator 7f8b9d0134 Daily bump.
From-SVN: r276385
2019-10-01 00:16:12 +00:00
Joseph Myers 6cffaf61ba * es.po: Update.
From-SVN: r276381
2019-09-30 22:54:07 +01:00
GCC Administrator 1bbc9c1280 Daily bump.
From-SVN: r276275
2019-09-30 00:16:43 +00:00
GCC Administrator c627c7511b Daily bump.
From-SVN: r276263
2019-09-29 00:16:27 +00:00
Marek Polacek cc205a58e9 PR c++/91923 - failure-to-SFINAE with class type NTTP in C++17.
* pt.c (invalid_nontype_parm_type_p): Only emit errors when
	tf_error.

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

From-SVN: r276250
2019-09-28 11:50:11 +00:00
Oleg Endo 534d9c823c backport: re PR target/86805 (sh port needs updating for CVE-2017-5753)
gcc/
2019-09-28  Oleg Endo  <olegendo@gcc.gnu.org>

	Backport from mainline
	2019-09-28  Oleg Endo  <olegendo@gcc.gnu.org>

	PR target/86805
	* config/sh/sh.c (TARGET_HAVE_SPECULATION_SAFE_VALUE): Define.

From-SVN: r276245
2019-09-28 08:55:03 +00:00
Oleg Endo 7f3471d204 backport: re PR target/80672 (gcc/config/sh/sh.c:716: prefer compare to find.)
gcc/
2019-09-28  Oleg Endo  <olegendo@gcc.gnu.org>

	Backport from mainline
	2019-09-28  Oleg Endo  <olegendo@gcc.gnu.org>

	PR target/80672
	* config/sh/sh.c (parse_validate_atomic_model_option): Use
	std::string::compare instead of std::string::find.

From-SVN: r276241
2019-09-28 08:37:23 +00:00
GCC Administrator 014663c56c Daily bump.
From-SVN: r276226
2019-09-28 00:16:20 +00:00
GCC Administrator b15817b5e4 Daily bump.
From-SVN: r276171
2019-09-27 00:16:16 +00:00
GCC Administrator 0b80f7e7c2 Daily bump.
From-SVN: r276138
2019-09-26 00:16:20 +00:00
Kyrylo Tkachov 28e0d7f15c [arm] Fix use of CRC32 intrinsics with Armv8-a and hard-float
Backport from mainline
	2019-08-22  Kyrylo Tkachov <kyrylo.tkachov@arm.com>

	* config/arm/arm_acle.h: Use arch=armv8-a+crc+simd pragma for CRC32
	intrinsics if __ARM_FP.
	Use __ARM_FEATURE_CRC32 ifdef guard.

	* gcc.target/arm/acle/crc_hf_1.c: New test.

From-SVN: r276126
2019-09-25 13:48:29 +00:00
GCC Administrator 4905c07ab0 Daily bump.
From-SVN: r276110
2019-09-25 00:16:38 +00:00
GCC Administrator 5a49193de4 Daily bump.
From-SVN: r276088
2019-09-24 00:16:32 +00:00
Eric Botcazou 792844ba98 trans.c (Attribute_to_gnu): Test Can_Use_Internal_Rep on the underlying type of the node.
* gcc-interface/trans.c (Attribute_to_gnu): Test Can_Use_Internal_Rep
	on the underlying type of the node.
	(Call_to_gnu): Likewise with the type of the prefix.

From-SVN: r276042
2019-09-23 08:08:45 +00:00
Max Filippov 2e1e7ad18e xtensa: backport fix for PR target/90922
Stack pointer adjustment code in prologue missed a case of no
callee-saved registers and a stack frame size bigger than 128 bytes.
Handle that case.

This fixes the following gcc tests with call0 ABI:
  gcc.c-torture/execute/stdarg-2.c
  gcc.dg/torture/pr55882.c
  gcc.dg/torture/pr57569.c

gcc/
2019-09-23  Max Filippov  <jcmvbkbc@gmail.com>

	Backport from mainline
	2019-06-18  Max Filippov  <jcmvbkbc@gmail.com>

	* config/xtensa/xtensa.c (xtensa_expand_prologue): Add stack
	pointer adjustment for the case of no callee-saved registers and
	stack frame bigger than 128 bytes.

From-SVN: r276037
2019-09-23 07:47:14 +00:00
GCC Administrator 721fce0395 Daily bump.
From-SVN: r276034
2019-09-23 00:16:20 +00:00
Iain Sandoe a387a60d13 [Darwin, opts processing] Fix missing RejectNegative etc.
This adds RejectNegative in a number of places it was needed,
reorders the opts into two groups (one general and one driver-only).
We also add a minimal description to each opt, and note some that
are now obsolete. The only functional change is to permit
-mtarget-linker= as an alias of -mtarget-linker.

This fixes the Darwin part of PR89327

2019-09-22  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-06-16  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.opt (prebind, noprebind, seglinkedit,
	noseglinkedit): Add RejectNegative.

	Backport from mainline
	2019-06-14  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.opt: Add RejectNegative where needed, reorder
	and add minimal functional descriptions.

From-SVN: r276031
2019-09-22 19:36:09 +00:00
GCC Administrator e51a41e506 Daily bump.
From-SVN: r276025
2019-09-22 00:16:12 +00:00
Paul Thomas 698624cd25 backport: re PR fortran/91588 (ICE in check_inquiry, at fortran/expr.c:2673)
2019-09-21  Paul Thomas  <pault@gcc.gnu.org>

	Backport from mainline
	PR fortran/91588
	* expr.c (check_inquiry): Remove extended component refs by
	using symbol pointers. If a function argument is an associate
	variable with a constant target, copy the target expression in
	place of the argument expression. Check that the charlen is not
	NULL before using the string length.

2019-09-21  Paul Thomas  <pault@gcc.gnu.org>

	Backport from mainline
	PR fortran/91588
	* gfortran.dg/associate_49.f90 : New test.

From-SVN: r276016
2019-09-21 08:35:17 +00:00
GCC Administrator bb5c6ac305 Daily bump.
From-SVN: r276014
2019-09-21 00:16:13 +00:00
John David Anglin 3850084870 pa.c (pa_trampoline_init): Remove spurious extended character.
* config/pa/pa.c (pa_trampoline_init): Remove spurious extended
	character.

From-SVN: r276008
2019-09-20 21:53:40 +00:00
Andreas Krebbel 84a05cb50f re PR rtl-optimization/88751 (Performance regression reload vs lra)
Fix PR88751

This patch implements a small improvement for the heuristic in lra
which decides when it has to activate the simpler register allocation
algorithm.

gcc/ChangeLog:

2019-09-20  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2019-06-06  Andreas Krebbel  <krebbel@linux.ibm.com>

	PR rtl-optimization/88751
	* ira.c (ira): Use the number of the actually referenced registers
	when calculating the threshold.

From-SVN: r276000
2019-09-20 12:18:26 +00:00
Kito Cheng a2eb0d2171 RISC-V: Fix more splitters accidentally calling gen_reg_rtx.
PR target/91683
	* config/riscv/riscv-protos.h (riscv_split_symbol): New bool parameter.
	(riscv_move_integer): Likewise.
	* config/riscv/riscv.c (riscv_split_integer): Pass FALSE for new
	riscv_move_integer arg.
	(riscv_legitimize_move): Likewise.
	(riscv_force_temporary): New parameter in_splitter.  Don't call
	force_reg if true.
	(riscv_unspec_offset_high): Pass FALSE for new riscv_force_temporary
	arg.
	(riscv_add_offset): Likewise.
	(riscv_split_symbol): New parameter in_splitter.  Pass to
	riscv_force_temporary.
	(riscv_legitimize_address): Pass FALSE for new riscv_split_symbol
	arg.
	(riscv_move_integer): New parameter in_splitter.  New local
	can_create_psuedo.  Don't call riscv_split_integer or force_reg when
	in_splitter TRUE.
	(riscv_legitimize_const_move): Pass FALSE for new riscv_move_integer,
	riscv_split_symbol, and riscv_force_temporary args.
	* config/riscv/riscv.md (low<mode>+1): Pass TRUE for new
	riscv_move_integer arg.
	(low<mode>+2): Pass TRUE for new riscv_split_symbol arg.

From-SVN: r275997
2019-09-20 10:41:51 +00:00
Eric Botcazou 905277d746 re PR target/91269 (unaligned floating-point register with -mcpu=niagara4 -fcall-used-g6)
PR target/91269
	* config/sparc/sparc.h (HARD_REGNO_CALLER_SAVE_MODE): Define.

From-SVN: r275995
2019-09-20 09:45:26 +00:00
GCC Administrator 3394b7520f Daily bump.
From-SVN: r275985
2019-09-20 00:16:11 +00:00
Steven G. Kargl d1a7e5b09a re PR fortran/91727 (ICE in conformable_arrays, at fortran/resolve.c:7490)
2019-09-19  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91727
	* resolve.c (conformable_arrays):  If array-spec is NULL, then
	allocate-object is a scalar.  a conformability check only occurs
	for an array source-expr.

2019-09-19  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91727
	* gfortran.dg/pr91727.f90: New test.

From-SVN: r275973
2019-09-19 17:54:53 +00:00
Kito Cheng 51d0da2fde RISC-V: Fix bad insn splits with paradoxical subregs.
Shifting by more than the size of a SUBREG_REG doesn't work, so we either
need to disable splits if an input is paradoxical, or else we need to
generate a clean temporary for intermediate results.

Jakub wrote the first version of this patch, so gets primary credit for it.

	gcc/
	PR target/91635
	* config/riscv/riscv.md (zero_extendsidi2, zero_extendhi<GPR:mode>2,
	extend<SHORT:mode><SUPERQI:mode>2): Don't split if
	paradoxical_subreg_p (operands[0]).
	(*lshrsi3_zero_extend_3+1, *lshrsi3_zero_extend_3+2): Add clobber and
	use as intermediate value.

	gcc/testsuite/
	PR target/91635
	* gcc.c-torture/execute/pr91635.c: New test.
	* gcc.target/riscv/shift-shift-4.c: New test.
	* gcc.target/riscv/shift-shift-5.c: New test.

From-SVN: r275929
2019-09-19 06:38:23 +00:00
GCC Administrator c2be2c0414 Daily bump.
From-SVN: r275923
2019-09-19 00:16:12 +00:00
Thomas Koenig 066ef19d5d backport: re PR fortran/91550 (ICE in do_subscript, at fortran/frontend-passes.c:2652)
2019-09-18  Thomas Koenig  <tkoenig@gcc.gnu.org>

    Backport from trunk
    PR fortran/91550
    * frontend-passes.c (do_subscript): If step equals
    zero, a previuos error has been reported; do nothing
    in this case.
    * resolve.c (gfc_resolve_iterator): Move error checking
    after type conversion.

2019-09-18  Thomas Koenig  <tkoenig@gcc.gnu.org>

    Backport from trunk
    PR fortran/91550
    * gfortran.dg/do_subscript_6.f90: New test.

From-SVN: r275891
2019-09-18 17:32:08 +00:00
GCC Administrator f15b8c082c Daily bump.
From-SVN: r275832
2019-09-18 00:16:12 +00:00
GCC Administrator d9d6e1add5 Daily bump.
From-SVN: r275762
2019-09-17 00:16:34 +00:00
GCC Administrator 7fd2af6d97 Daily bump.
From-SVN: r275740
2019-09-16 00:16:23 +00:00
Thomas Koenig 121cc969e6 backport: re PR fortran/91557 (Bogus warning about unused dummy argument _formal_*)
2019-09-15  Thomas Koenig  <tkoenig@gcc.gnu.org>

    Backport from trunk
    PR fortran/91557
    * trans-decl.c (generate_local_decl): Do not warn if the symbol
    is artificial.
    * trans-types.c (get_formal_from_actual_arglist): Set artificial
    attribute on dummy arguments.

2019-09-15  Thomas Koenig  <tkoenig@gcc.gnu.org>

    Backport from trunk
    PR fortran/91557
    * gfortran.dg/warn_unused_dummy_argument_5.f90: New test.

From-SVN: r275733
2019-09-15 19:48:41 +00:00
GCC Administrator 9b71088373 Daily bump.
From-SVN: r275722
2019-09-15 00:16:19 +00:00
Steven G. Kargl f97453cb20 re PR fortran/91553 (ICE in gfc_real2complex, at fortran/arith.c:2208)
2019-09-14  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91553
	* simplify.c (gfc_convert_constant):  During conversion check if the
	constant is enclosed in parenthesis, and simplify expression.

2019-09-14  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91553
	* gfortran.dg/pr91553.f90: New test.

From-SVN: r275716
2019-09-14 17:05:17 +00:00
Steven G. Kargl bae31807f5 re PR fortran/91566 (ICE in gfc_constructor_copy, at fortran/constructor.c:103)
2019-09-14  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91566
	* simplify.c (gfc_simplify_merge): Need to simplify expression
	after insertation of parenthesis.

2019-09-14  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91566
	* gfortran.dg/pr91566.f90: New test.

From-SVN: r275715
2019-09-14 16:39:41 +00:00
Steven G. Kargl ef31f2b7e0 re PR fortran/91642 (ICE: Bad IO basetype (transfer_expr, at fortran/trans-io.c:2507))
2019-09-14  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91642
	* io.c (gfc_match_inquire): null() cannot be in an iolength inquire
	list.

2019-09-14  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91642
	* gfortran.dg/pr91642.f90: New test.

From-SVN: r275714
2019-09-14 16:21:33 +00:00
GCC Administrator 3493ca0d95 Daily bump.
From-SVN: r275708
2019-09-14 00:16:13 +00:00
GCC Administrator 6217eac02b Daily bump.
From-SVN: r275694
2019-09-13 00:16:15 +00:00
Jonathan Wakely 506bcbef00 PR libstdc++/91748 fix std::for_each_n for random access iterators
PR libstdc++/91748
	* include/bits/stl_algo.h (for_each_n): Fix random access iterator
	case.
	* testsuite/25_algorithms/for_each/for_each_n.cc: Test with random
	access iterators.

From-SVN: r275684
2019-09-12 11:51:58 +01:00
GCC Administrator ce583e0ad6 Daily bump.
From-SVN: r275679
2019-09-12 00:16:15 +00:00
Jonathan Wakely 14c154f953 Fix Xmethod for shared_ptr::use_count()
This was reported in https://bugzilla.redhat.com/show_bug.cgi?id=1749578

	* python/libstdcxx/v6/xmethods.py (SharedPtrUseCountWorker.__call__):
	Fix syntax error.

From-SVN: r275645
2019-09-11 12:40:23 +01:00
Eric Botcazou dd8c82e856 re PR rtl-optimization/89795 (wrong code with -O2 -fno-dce -fno-forward-propagate -fno-sched-pressure)
PR rtl-optimization/89795
	* rtlanal.c (nonzero_bits1) <SUBREG>: Do not propagate results from
	inner REGs to paradoxical SUBREGs if WORD_REGISTER_OPERATIONS is set.

From-SVN: r275636
2019-09-11 10:42:31 +00:00
GCC Administrator 5334438e67 Daily bump.
From-SVN: r275621
2019-09-11 00:16:34 +00:00
Marek Polacek b66c82990a PR c++/91705 - constexpr evaluation rejects ++/-- on floats.
* constexpr.c (cxx_eval_increment_expression): Call fold_simple on
	the offset.

	* g++.dg/cpp1y/constexpr-incr2.C: New test.

From-SVN: r275615
2019-09-10 22:39:46 +00:00
Ian Lance Taylor 25130d4dfd re PR go/91621 (libgo/mksysinfo.sh: please avoid test ==)
PR go/91621
    mksysinfo: change test == to test =
    
    Fixes https://gcc.gnu.org/PR91621
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194569

From-SVN: r275609
2019-09-10 20:32:42 +00:00
Ian Lance Taylor da85ce4c0d go/internal/gccgoimporter: support embedded field in pointer loop
Backport of https://golang.org/cl/194440.  Original description:
    
        If an embedded field refers to a type via a pointer, the parser needs
        to know the name of the embedded field. It is possible that the
        pointer type is not yet resolved. This CL fixes the parser to handle
        that case by setting the pointer element type to the unresolved named
        type while the pointer is being resolved.
    
    Updates golang/go#34182
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194562

From-SVN: r275607
2019-09-10 20:26:11 +00:00
GCC Administrator c0bc2fa412 Daily bump.
From-SVN: r275554
2019-09-10 00:16:19 +00:00
Edward Smith-Rowland cf33425f64 Update docs for p858 - Constexpr iterator changes available since 9.1.
2019-09-09  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Update docs for p858 - Constexpr iterator changes available since 9.1.
	* doc/xml/manual/status_cxx2020.xml: Update p0858r0 status.

From-SVN: r275523
2019-09-09 17:17:48 +00:00
Jakub Jelinek 3100d074f3 re PR target/87853 (_mm_cmpgt_epi8 broken with -funsigned-char)
PR target/87853
	* config/i386/emmintrin.h (_mm_cmpeq_epi8): Use casts to __v16qi
	instead of __v16qs.

	* gcc.target/i386/pr87853.c: New test.

From-SVN: r275510
2019-09-09 12:52:00 +02:00
Jakub Jelinek a3d5f4e209 re PR target/91704 ([X86] Codegen for _mm256_cmpgt_epi8 is affected by -funsigned-char)
PR target/91704
	* config/i386/avxintrin.h (__v32qs): New typedef.
	* config/i386/avx2intrin.h (_mm256_cmpgt_epi8): Use casts to __v32qs
	instead of __v32qi.

	* gcc.target/i386/pr91704.c: New test.

From-SVN: r275509
2019-09-09 12:51:04 +02:00
GCC Administrator 33ccf76972 Daily bump.
From-SVN: r275500
2019-09-09 00:17:04 +00:00
GCC Administrator e205cd8748 Daily bump.
From-SVN: r275492
2019-09-08 00:16:30 +00:00
Paul Thomas f23797e382 re PR fortran/91589 (ICE in gfc_conv_component_ref, at fortran/trans-expr.c:2447)
2019-09-07  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/91589
	* primary.c (gfc_match_varspec): Return MATCH_NO on an apparent
	component ref, when the primary type is intrinsic.

2019-09-07  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/91589
	* gfortran.dg/pr91589.f90 : New test.

From-SVN: r275487
2019-09-07 14:41:25 +00:00
GCC Administrator df9679c70f Daily bump.
From-SVN: r275481
2019-09-07 00:16:37 +00:00
GCC Administrator aab620b97c Daily bump.
From-SVN: r275448
2019-09-06 00:16:33 +00:00
Harald Anlauf 4d077d4469 backport: re PR fortran/91496 (!GCC$ directives error if mistyped or unknown)
2019-09-05  Harald Anlauf  <anlauf@gmx.de>

	Backport from mainline
	PR fortran/91496
	* gfortran.h: Extend struct gfc_iterator for loop annotations.
	* array.c (gfc_copy_iterator): Copy loop annotations by IVDEP,
	VECTOR, and NOVECTOR pragmas.
	* decl.c (gfc_match_gcc_ivdep, gfc_match_gcc_vector)
	(gfc_match_gcc_novector): New matcher functions handling IVDEP,
	VECTOR, and NOVECTOR pragmas.
	* match.h: Declare prototypes of matcher functions handling IVDEP,
	VECTOR, and NOVECTOR pragmas.
	* parse.c (decode_gcc_attribute, parse_do_block)
	(parse_executable): Decode IVDEP, VECTOR, and NOVECTOR pragmas;
	emit warning for unrecognized pragmas instead of error.
	* trans-stmt.c (gfc_trans_simple_do, gfc_trans_do): Add code to
	emit annotations for IVDEP, VECTOR, and NOVECTOR pragmas.
	* gfortran.texi: Document IVDEP, VECTOR, and NOVECTOR pragmas.

	PR fortran/91496
	* parse.c (parse_executable): Improve error messages for
	improperly placed pragmas not preceeding a loop.

	PR fortran/91496
	* gfortran.dg/pr91496.f90: New testcase.

	PR fortran/91496
	* gfortran.dg/directive_unroll_5.f90: Adjust error message.

From-SVN: r275445
2019-09-05 21:02:44 +00:00
Steven G. Kargl b3ec4913db re PR fortran/91660 (Missing error on invalid type declaration)
2019-09-05  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91660
	* decl.c (gfc_match_decl_type_spec): Improve and restore error
	message for malformed types-spec.

2019-09-05  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91660
	* gfortran.dg/pdt_4.f03: Fix invalid code.
	* gfortran.dg/pr91660_1.f90: New test.
	* gfortran.dg/pr91660_2.f90: Ditto.

From-SVN: r275427
2019-09-05 18:37:13 +00:00
GCC Administrator 5fd85b2bd9 Daily bump.
From-SVN: r275394
2019-09-05 00:16:22 +00:00
Wilco Dijkstra 7204c71263 [AArch64] Fix PR81800
PR81800 is about the lrint inline giving spurious FE_INEXACT exceptions.
The previous change for PR81800 didn't fix this: when lrint is disabled
in the backend, the midend will simply use llrint.  This actually makes
things worse since llrint now also ignores FE_INVALID exceptions!
The fix is to disable lrint/llrint on double if the size of a long is
smaller (ie. ilp32).

    gcc/
	PR target/81800
	* gcc/config/aarch64/aarch64.md (lrint): Disable lrint pattern if GPF
	operand is larger than a long int.

    testsuite/
	PR target/81800
	* gcc.target/aarch64/no-inline-lrint_3.c: New test.

From-SVN: r275373
2019-09-04 12:42:22 +00:00
GCC Administrator aa90fd568c Daily bump.
From-SVN: r275361
2019-09-04 00:16:28 +00:00
Jakub Jelinek 925e219e72 re PR tree-optimization/91597 (GCC miscompiles a branch depending on a pointer tag)
PR tree-optimization/91597
	* tree-vrp.c (extract_range_from_binary_expr): Remove unsafe
	BIT_AND_EXPR optimization for pointers, even if both operand
	ranges don't include NULL, the result can be NULL.

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

From-SVN: r275345
2019-09-03 18:55:31 +02:00
GCC Administrator 4ff5893eae Daily bump.
From-SVN: r275327
2019-09-03 00:16:35 +00:00
Steven G. Kargl a1a9738246 re PR fortran/91552 (ICE with valid array constructor)
2019-09-02  Steven G. Kargl  <kargl@gc.gnu.org>

	PR fortran/91552
	* array.c (walk_array_constructor): New function.
	(gfc_match_array_constructor): Use it.

2019-09-02  Steven G. Kargl  <kargl@gc.gnu.org>

	PR fortran/91552
	* gfortran.dg/pr91552.f90: New test.

From-SVN: r275323
2019-09-02 17:16:05 +00:00
Jonathan Wakely 7a62100980 Update libstdc++ docs for library version bumps
* doc/xml/manual/abi.xml: Document 9.x library versions.
	* doc/html/*: Regenerate.

From-SVN: r275310
2019-09-02 12:10:03 +01:00
Martin Liska 1448cf4c4e Backport r275292
2019-09-02  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-09-02  Martin Liska  <mliska@suse.cz>

	PR c++/91155
	* c-common.c (fname_as_string): Use cxx_printable_name for
	__PRETTY_FUNCTION__ same as was used before r265711.
2019-09-02  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-09-02  Martin Liska  <mliska@suse.cz>

	PR c++/91155
	* g++.dg/torture/pr91155.C: New test.

From-SVN: r275302
2019-09-02 08:58:39 +00:00
Martin Liska 8a1e1c00c9 Backport r275291
2019-09-02  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-09-02  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/91601
	* gcov.c (path_contains_zero_cycle_arc): Rename to ...
	(path_contains_zero_or_negative_cycle_arc): ... this and handle
	also negative edges.
	(circuit): Handle also negative edges as they can happen
	in some situations.

From-SVN: r275301
2019-09-02 08:58:17 +00:00
Rainer Orth 6e690485d5 Update Solaris baselines for GCC 9.3
* config/abi/post/i386-solaris2.10/baseline_symbols.txt: Regenerate.
	* config/abi/post/i386-solaris2.10/amd64/baseline_symbols.txt: Likewise.
	* config/abi/post/i386-solaris2.11/baseline_symbols.txt: Likewise.
	* config/abi/post/i386-solaris2.11/amd64/baseline_symbols.txt: Likewise.
	* config/abi/post/sparc-solaris2.10/baseline_symbols.txt: Likewise.
	* config/abi/post/sparc-solaris2.10/sparcv9/baseline_symbols.txt:
	Likewise.
	* config/abi/post/sparc-solaris2.11/baseline_symbols.txt: Likewise.
	* config/abi/post/sparc-solaris2.11/sparcv9/baseline_symbols.txt:
	Likewise.

From-SVN: r275300
2019-09-02 08:40:41 +00:00
GCC Administrator f8bbd3810b Daily bump.
From-SVN: r275289
2019-09-02 00:16:33 +00:00
Marek Polacek 06de36ba95 PR c++/91129 - wrong error with binary op in template argument.
* typeck.c (warn_for_null_address): Use fold_for_warn instead of
	fold_non_dependent_expr.
	(cp_build_binary_op): Likewise.

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

From-SVN: r275286
2019-09-01 22:59:10 +00:00
Eric Botcazou 2c57172ec9 re PR target/91472 (gmp testsuite segfaults with gcc-8 and gcc-9, works fine with gcc-7)
PR target/91472
	* config/sparc/sparc.c (sparc_cannot_force_const_mem): Return true
	during LRA/reload in PIC mode if the PIC register hasn't been used yet.
	(sparc_pic_register_p): Test reload_in_progress for consistency's sake.

From-SVN: r275272
2019-09-01 12:57:56 +00:00
GCC Administrator ab4b40c38d Daily bump.
From-SVN: r275263
2019-09-01 00:16:43 +00:00
Joseph Myers 607535aae7 * es.po: Update.
From-SVN: r275259
2019-08-31 22:49:46 +01:00
Iain Sandoe 4574bbc072 [c-family] Backport fix for PCH / PR61250.
When we are parsing a source file, the very first token might
be a PRAGMA_GCC_PCH_PREPROCESS. This indicates that we are going
read in a PCH file (named as the value of the pragma). If we don't
see this pragma, then we know that it's OK to release any resources
that the host might have set aside for the PCH file.

There is a thinko in the current implementation, in that the decision
to release resources is happening unconditionally right after the first
token is extracted but before it's been checked or acted upon.

This leads to the pch bug on Darwin, because we actually do release
resources - which are subsequently (reasonably) assumed to be available
when reading a PCH file. We then get random crashes or hangs depending
on the interaction between unmmap and malloc.

The bug is present everywhere but doesn't show on (say) Linux, since
the release of PCH resources is a NOP there.

This effects all the c-family front ends, because they all use
c_lex_with_flags () to implement this.

The solution is to check for the PRAGMA_GCC_PCH_PREPROCESS and only call
c_common_no_more_pch () when that is not the first token.

A secondary effect of the collection is that the name of the PCH file
can be collected during the ggc_pch_read() reset of state. Therefore
we should issue any diagnostic that might name the file before the
collections are triggered.

gcc/

2019-08-31  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-08-23  Iain Sandoe  <iain@sandoe.co.uk>

	PR pch/61250
	* ggc-page.c (ggc_pch_read): Read the ggc_pch_ondisk structure
	and issue any diagnostics needed before collecting the pre-PCH
	state.

gcc/c-family/

2019-08-31  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-08-23  Iain Sandoe  <iain@sandoe.co.uk>

	PR pch/61250
	* c-lex.c (c_lex_with_flags):  Don't call
	c_common_no_more_pch () from here.

gcc/c/

2019-08-31  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-08-23  Iain Sandoe  <iain@sandoe.co.uk>

	PR pch/61250
	* c-parser.c (c_parse_file): Call c_common_no_more_pch ()
	after determining that the first token is not
	PRAGMA_GCC_PCH_PREPROCESS.

gcc/cp/

2019-08-31  Iain Sandoe  <iain@sandoe.co.uk>

	Backported from mainline
	2019-08-23  Iain Sandoe  <iain@sandoe.co.uk>

	PR pch/61250
	* parser.c (cp_parser_initial_pragma): Call c_common_no_more_pch ()
	after determining that the first token is not
	PRAGMA_GCC_PCH_PREPROCESS.

From-SVN: r275246
2019-08-31 19:12:10 +00:00
Steven G. Kargl 1fef602810 re PR fortran/91587 (ICE in gfc_resolve_filepos, at fortran/io.c:2913)
2019-08-30  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91587
	* io.c (match_filepos): MATCH_ERROR should branch to a syntax error.

2019-08-30  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91587
	* gfortran.dg/pr91587.f90: New test.

From-SVN: r275241
2019-08-31 03:27:45 +00:00
GCC Administrator e8a8414cc3 Daily bump.
From-SVN: r275234
2019-08-31 00:16:47 +00:00
Steven G. Kargl cd3f639472 re PR fortran/91565 (ICE in gfc_simplify_reshape, at fortran/simplify.c:6707 etc.)
2019-08-30  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91565
	* simplify.c (gfc_simplify_reshape): Add additional checks of the
	ORDER dummy argument.

2019-08-30  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91565
	* gfortran.dg/pr91565.f90: New test.

From-SVN: r275230
2019-08-30 23:30:35 +00:00
Steven G. Kargl 2d0f1081ec re PR fortran/91564 (ICE in gimplify_expr, at gimplify.c:14147)
2019-08-30  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91564
	* check.c (gfc_check_kill_sub): Additional checks on status dummy
	argument.

2019-08-30  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91564
	* gfortran.dg/pr91564.f90: New test.

From-SVN: r275229
2019-08-30 23:19:30 +00:00
Steven G. Kargl a70b6d0627 re PR fortran/91551 (ICE in sort_actual, at fortran/intrinsic.c:4193)
2019-08-30  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91551
	* intrinsic.c (sort_actual): ALLOCATED has one argument. Check for
	no argument case.

2019-08-30  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91551
	* gfortran.dg/allocated_3.f90

From-SVN: r275228
2019-08-30 23:02:37 +00:00
Segher Boessenkool 5233accf77 backport: re PR target/91481 (POWER9 "DARN" RNG intrinsic produces repeated output (CVE-2019-15847))
Backport from trunk
	2019-08-23  Segher Boessenkool  <segher@kernel.crashing.org>

gcc/testsuite/
	PR target/91481
	* gcc.target/powerpc/darn-3.c: New testcase.

From-SVN: r275176
2019-08-30 15:53:11 +02:00
Segher Boessenkool dc2b6f50dd backport: re PR target/91481 (POWER9 "DARN" RNG intrinsic produces repeated output (CVE-2019-15847))
Backport from trunk
	2019-08-22  Segher Boessenkool  <segher@kernel.crashing.org>

	PR target/91481
	* config/rs6000/rs6000.md (unspec): Delete UNSPEC_DARN, UNSPEC_DARN_32,
	and UNSPEC_DARN_RAW.
	(unspecv): New enumerator values UNSPECV_DARN, UNSPECV_DARN_32, and
	UNSPECV_DARN_RAW.
	(darn_32): Use an unspec_volatile, and UNSPECV_DARN_32.
	(darn_raw): Use an unspec_volatile, and UNSPECV_DARN_RAW.
	(darn): Use an unspec_volatile, and UNSPECV_DARN.

From-SVN: r275175
2019-08-30 15:51:26 +02:00
Segher Boessenkool 414c00b7fd backport: altivec.md (unspec): Delete UNSPEC_DARN...
Backport from trunk
	2019-08-22  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/altivec.md (unspec): Delete UNSPEC_DARN, UNSPEC_DARN_32,
	UNSPEC_DARN_RAW, UNSPEC_CMPRB, UNSPEC_CMPRB2, UNSPEC_CMPEQB; move to...
	* config/rs6000/rs6000.md (unspec): ... here.
	* config/rs6000/altivec.md (darn_32, darn_raw, darn, cmprb,
	*cmprb_internal, setb_signed, setb_unsigned, cmprb2, *cmprb2_internal,
	cmpeqb, *cmpeqb_internal): Delete, move to...
	* config/rs6000/rs6000.md (darn_32, darn_raw, darn, cmprb,
	*cmprb_internal, setb_signed, setb_unsigned, cmprb2, *cmprb2_internal,
	cmpeqb, *cmpeqb_internal): ... here.

From-SVN: r275170
2019-08-30 15:48:48 +02:00
Richard Biener 8b06ee3c2d backport: re PR tree-optimization/90278 (ICE: verify_gimple failed (error: statement marked for throw, but doesn't))
2019-08-30  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-04-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90278
	* tree-ssa-forwprop.c (pass_forwprop::execute): Transfer/clean
	EH on comparison simplification.

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

From-SVN: r275167
2019-08-30 13:14:59 +00:00
GCC Administrator c272916856 Daily bump.
From-SVN: r275058
2019-08-30 00:16:20 +00:00
Jonathan Wakely 7532a97151 PR libstdc++/91067 add more missing exports for directory iterators
PR libstdc++/91067
	* acinclude.m4 (libtool_VERSION): Bump to 6:28:0.
	* configure: Regenerate.
	* config/abi/pre/gnu.ver (GLIBCXX_3.4.28): Add new version. Export
	missing symbols.
	* testsuite/27_io/filesystem/iterators/91067.cc: Test move
	constructors.
	* testsuite/util/testsuite_abi.cc: Add new symbol version.

From-SVN: r275033
2019-08-29 14:22:13 +01:00
Jakub Jelinek 0549ad5e34 baseline_symbols.txt: Update.
* config/abi/post/aarch64-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/s390x-linux-gnu/baseline_symbols.txt: Update.

From-SVN: r275029
2019-08-29 12:27:38 +02:00
Richard Biener b72ee9d7f7 re PR tree-optimization/91568 (internal compiler error: in vect_schedule_slp_instance, at tree-vect-slp.c:3922)
2019-08-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91568
	* tree-vectorizer.h (_slp_tree::max_nunits): Add.
	(vect_update_max_nunits): Add overload for poly_uint64.
	* tree-vect-slp.c (vect_create_new_slp_node): Initialize it.
	(vect_build_slp_tree): Record max_nunits into the subtree
	and merge it upwards.
	(vect_print_slp_tree): Print max_nunits.

	* gfortran.dg/pr91568.f: New testcase.

From-SVN: r275024
2019-08-29 08:12:57 +00:00
GCC Administrator 5b1fda991e Daily bump.
From-SVN: r275020
2019-08-29 00:16:20 +00:00
Jonathan Wakely db2230347d Update ABI baselines for x86 and powerpc GNU targets
* config/abi/post/i386-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/i486-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/powerpc-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt: Update.
	* config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt: Update.
	* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update.

From-SVN: r275014
2019-08-28 23:16:33 +01:00
Joseph Myers 44538cdf80 * es.po: Update.
From-SVN: r275013
2019-08-28 22:41:01 +01:00
Richard Biener b824853ea6 backport: re PR tree-optimization/90637 (ICE in vect_loop_versioning, at tree-vect-loop-manip.c:3055)
2019-08-28  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-05-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90637
	* tree-ssa-sink.c (statement_sink_location): Honor the
	computed sink location for single-uses.

	* gcc.dg/gomp/pr90637.c: New testcase.

From-SVN: r274989
2019-08-28 12:12:20 +00:00
GCC Administrator cf6ebf8218 Daily bump.
From-SVN: r274979
2019-08-28 00:16:18 +00:00
GCC Administrator 3a8eed0fbf Daily bump.
From-SVN: r274943
2019-08-27 00:16:29 +00:00
Xiong Hu Luo d7131bd5b8 backport: Enable math functions linking with static library for LTO
Backport r274411 from trunk to gcc-9-branch

Backport r274411 of "Enable math functions linking with static library
for LTO" from mainline to gcc-9-branch.

Bootstrapped/Regression-tested on Linux POWER8 LE.

gcc/ChangeLog
2019-08-26  Xiong Hu Luo  <luoxhu@linux.ibm.com>

	Backport r274411 from trunk to gcc-9-branch.
	2019-08-14  Xiong Hu Luo  <luoxhu@linux.ibm.com>

	PR lto/91287
	* builtins.c (builtin_with_linkage_p): New function.
	* builtins.h (builtin_with_linkage_p): New function.
	* symtab.c (write_symbol): Remove redundant assert.
	* lto-streamer-out.c (symtab_node::output_to_lto_symbol_table_p):
	Remove FIXME and use builtin_with_linkage_p.

From-SVN: r274921
2019-08-26 08:53:27 +00:00
GCC Administrator 8da62abae6 Daily bump.
From-SVN: r274918
2019-08-26 00:16:35 +00:00
Uros Bizjak 3072e76439 re PR target/91533 (abs pattern generates MMX instructions but fails to call EMMS)
PR target/91533
	Backport from mainline
	2019-06-30  Uroš Bizjak  <ubizjak@gmail.com>

	* config/i386/sse.md (ssse3_abs<mode>2): Rename from abs<mode>2.
	* config/i386/i386-builtin.def (__builtin_ia32_pabsb):
	Use CODE_FOR_ssse3_absv8qi2.
	(__builtin_ia32_pabsw): Use CODE_FOR_ssse3_absv4hi2.
	(__builtin_ia32_pabsd): Use CODE_FOR_ssse3_absv2si2.

From-SVN: r274910
2019-08-25 20:21:04 +02:00
GCC Administrator 67e15d5ac2 Daily bump.
From-SVN: r274906
2019-08-25 00:16:46 +00:00
GCC Administrator 551528f7ce Daily bump.
From-SVN: r274897
2019-08-24 00:16:33 +00:00
Marek Polacek 736257f74f PR c++/91521 - wrong error with operator->.
* decl.c (grokdeclarator): Return error_mark_node for an invalid
	trailing return type.

	* g++.dg/parse/operator8.C: New test.

From-SVN: r274892
2019-08-23 23:26:17 +00:00
Joseph Myers ce42d48212 Fix libstdc++ lstat missing return type for Windows target.
Building for i686-mingw32 target (with some local changes) produced an
error

error: ISO C++ forbids declaration of 'lstat' with no type [-fpermissive]

in libstdc++-v3/src/filesystem/ops-common.h.  This patch adds the
missing return type.  OK to commit (trunk and GCC 9 branch)?

Note 1: I haven't run the testsuite with this patch, but it fixes the
build failure I see (in sources with other local changes).

Note 2: I don't know why this hasn't produced build failures for other
people, but the missing return type looks wrong in any case even if
other local changes are for some reason needed for it to produce an
error.

	* src/filesystem/ops-common.h [_GLIBCXX_FILESYSTEM_IS_WINDOWS]
	(std::filesystem::__gnu_posix::lstat): Add return type.

From-SVN: r274886
2019-08-23 22:05:50 +01:00
Joseph Myers fb0c8fb6bc * zh_CN.po: Update.
From-SVN: r274869
2019-08-23 20:48:22 +01:00
Mihailo Stojanovic e5bd4faa8b mips.md (mips_get_fcsr, [...]): Use SI machine mode for unspec_volatile operand.
* config/mips/mips.md (mips_get_fcsr, *mips_get_fcsr): Use SI
        machine mode for unspec_volatile operand.

        * gcc.target/mips/get-fcsr-3.c: New test.

From-SVN: r274864
2019-08-23 13:09:07 -06:00
Martin Liska ecd06a4cc0 Backport r274504
2019-08-23  Martin Liska  <mliska@suse.cz>

	PR ipa/91508
	Backport from mainline
	2019-08-15  Martin Liska  <mliska@suse.cz>

	PR ipa/91438
	* cgraph.c (cgraph_node::remove): When setting
	n->origin = NULL for all nested functions, reset
	also next_nested.

From-SVN: r274853
2019-08-23 11:42:19 +00:00
Martin Liska 009fed7825 Backport r274503
2019-08-23  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-08-15  Martin Liska  <mliska@suse.cz>

	* cgraph.c (cgraph_node::verify_node): Verify origin, nested
	and next_nested.

From-SVN: r274852
2019-08-23 11:41:32 +00:00
Martin Liska 55581ff1a2 Backport r274502
2019-08-23  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-08-15  Martin Liska  <mliska@suse.cz>

	PR ipa/91404
	* passes.c (order): Remove.
	(uid_hash_t): Likewise).
	(remove_cgraph_node_from_order): Remove from set
	of pointers (cgraph_node *).
	(insert_cgraph_node_to_order): New.
	(duplicate_cgraph_node_to_order): New.
	(do_per_function_toporder): Register all 3 cgraph hooks.
	Skip removed_nodes now as we know about all of them.

From-SVN: r274851
2019-08-23 11:41:16 +00:00
GCC Administrator 4dc192c8fe Daily bump.
From-SVN: r274842
2019-08-23 00:16:50 +00:00
GCC Administrator f961bcc9f7 Daily bump.
From-SVN: r274815
2019-08-22 00:16:13 +00:00
Iain Sandoe f8d9f32e0c [Darwin, fixincludes] Backport fix for PR83531
There is no reasonable chance that the SDKs in question will be re-
issued, so the only viable solution is a fixincludes.

2019-08-21  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-08-18  C.G. Dogan <gcc+cgdogan.00@gmail.com>
		    Iain Sandoe  <iain@sandoe.co.uk>

	PR target/83531
	* inclhack.def (darwin_api_availability): New; strip leading
	underscores from API_XXXX defines.
	* fixincl.x: Regenerate.
	* tests/base/os/availability.h: New file.

From-SVN: r274807
2019-08-21 19:18:14 +00:00
Iain Sandoe 0a8b0a4c6f [Darwin, PPC] Fix fail of cpp/assert4.c
This test needs the cpu and machine asserts to be implemented
which hadn't been done for PPC Darwin.

2019-08-21  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-08-18  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/darwin.h (TARGET_OS_CPP_BUILTINS): Add asserts
	for cpu and machine.  Factor 64/32b builtins.

From-SVN: r274806
2019-08-21 18:45:45 +00:00
GCC Administrator da5c5f7a00 Daily bump.
From-SVN: r274762
2019-08-21 00:16:12 +00:00
Jonathan Wakely fc628a1a08 Fix markdown in Doxygen comments for std::reduce
* include/std/numeric (reduce): Fix Doxygen markup.

From-SVN: r274759
2019-08-20 22:40:37 +01:00
Jonathan Wakely 14cbcae81a Implement new serial algorithms from Parallelism TS (P0024R2)
These new (non-parallel) algorithms were added to C++17 along with the
parallel algorithms, but were missing from libstdc++.

Backported for PR libstdc++/91495, replacing the use of
std::__size_to_integer which is not present on the branch.

Backport from mainline
2019-06-19  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/numeric (reduce(Iter, Iter, T, BinOp)): Fix value
	category used in invocable check.
	(reduce(Iter, Iter, T)): Pass initial value as rvalue.
	* testsuite/26_numerics/reduce/2.cc: New test.

Backport from mainline
2019-06-18  Jonathan Wakely  <jwakely@redhat.com>

	* include/bits/algorithmfwd.h: Change title of doc group.
	* include/bits/stl_algo.h (for_each_n): Add new C++17 algorithm from
	P0024R2.
	* include/bits/stl_numeric.h: Define doc group and add algos to it.
	* include/std/numeric (__is_random_access_iter): New internal trait.
	(reduce, transform_reduce, exclusive_scan, inclusive_scan)
	(transform_exclusive_scan, transform_inclusive_scan): Likewise.
	* testsuite/25_algorithms/for_each/for_each_n.cc: New test.
	* testsuite/26_numerics/exclusive_scan/1.cc: New test.
	* testsuite/26_numerics/inclusive_scan/1.cc: New test.
	* testsuite/26_numerics/reduce/1.cc: New test.
	* testsuite/26_numerics/transform_exclusive_scan/1.cc: New test.
	* testsuite/26_numerics/transform_inclusive_scan/1.cc: New test.
	* testsuite/26_numerics/transform_reduce/1.cc: New test.
	* testsuite/util/testsuite_iterators.h (test_container::size()): New
	member function.

From-SVN: r274754
2019-08-20 22:03:11 +01:00
Uros Bizjak feb2e3cccf baseline_symbols.txt: Update.
* config/abi/post/alpha-linux-gnu/baseline_symbols.txt: Update.

From-SVN: r274753
2019-08-20 22:13:16 +02:00
Eric Botcazou 70a8c9b950 re PR rtl-optimization/91347 (hppa: wrong code generated with tail call optimisation)
PR rtl-optimization/91347
	* dse.c (scan_insn): Call add_wild_read for non-const/memset tail calls
	before reload if HARD_FRAME_POINTER_IS_ARG_POINTER.

From-SVN: r274709
2019-08-20 09:13:29 +00:00
GCC Administrator 5ed3bb6860 Daily bump.
From-SVN: r274688
2019-08-20 00:16:18 +00:00
Richard Earnshaw 88cf851d26 [aarch64] PR target/91386 Use copy_rtx to avoid modifying original insns in peep2 pattern
PR target/91386 is a situation where a peephole2 pattern substitution
is discarded late because the selected instructions contain
frame-related notes that we cannot redistribute (because the pattern
has more than one insn in the output).  Unfortunately, the original
insns were being modified during the generation, so after the undo we
are left with corrupt RTL.

We avoid this by ensuring that the modifications are always made on a
copy, so that the original insns are never changed.

	Backport from mainline
	2019-09-09  Richard Earnshaw  <rearnsha@arm.com>

	PR target/91386
        * config/aarch64/aarch64.c (aarch64_gen_adjusted_ldpstp): Use copy_rtx
        to preserve the contents of the original insns.

From-SVN: r274675
2019-08-19 16:11:30 +00:00
Steven G. Kargl ea75b9638e re PR fortran/91485 (Erroneous conflict between variable x and operator(.x.))
2019-08-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91485
	module.c (gfc_match_use): User defined operator cannot conflict with
	a rename symbol.

2019-08-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91485
	* gfortran.dg/pr91485.f90: New test.

From-SVN: r274632
2019-08-19 03:21:46 +00:00
GCC Administrator 54bb1ff66b Daily bump.
From-SVN: r274628
2019-08-19 00:16:14 +00:00
Iain Sandoe f4acd2b46a Darwin, libsanitizer - remove reference to __cxa_rethrow_primary_exception.
For some Darwin versions the absence of the rethrow_primary_exception
symbol causes almost all sanitizer tests to fail.
The symbol is not present in libstdc++ and, therefore is is correct to
remove the reference to it for all platforms.  We do this by adding a
new guard "ASAN_HAS_CXA_RETHROW_PRIMARY_EXCEPTION".

For the backported version, to avoid bumping the library version, this
is only applied for Darwin (because of the way that symbol interposing
works on Darwin, this does not alter the exported symbols list).

libsanitizer/

2019-08-18  Iain Sandoe  <iain@sandoe.co.uk>


	Backport from mainline
	2019-06-18  Iain Sandoe  <iain@sandoe.co.uk>

	PR libsanitizer/87880
	* asan/asan_interceptors.h:
	(ASAN_INTERCEPT___CXA_RETHROW_PRIMARY_EXCEPTION): New.
	* asan/Makefile.am (DEFS): Add (for Darwin only)
	ASAN_HAS_CXA_RETHROW_PRIMARY_EXCEPTION, defined to 0.
	* asan/Makefile.in: Regenerated.

From-SVN: r274625
2019-08-18 19:11:29 +00:00
GCC Administrator 26c9027d4c Daily bump.
From-SVN: r274617
2019-08-18 00:16:16 +00:00
Steven G. Kargl e7840406b9 re PR fortran/91471 (f951: internal compiler error: gfc_variable_attr(): Bad array reference)
2019-08-17  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91471
	* primary.c (gfc_variable_attr): Remove a gfc_internal_error(),
	which cannot be reached by conforming Fortran code, but seems to
	be reachable from nonconforming Fortran code.  Treat the AR_UNKNOWN
	case as a no-op.

2019-08-17  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91471
	* gfortran.dg/pr91471.f90: New test.

From-SVN: r274612
2019-08-17 18:16:51 +00:00
Steven G. Kargl 69112d45bb re PR fortran/78739 (ICE in gfc_get_symbol_decl, at fortran/trans-decl.c:1477)
2019-08-17  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78739
	* match.c (gfc_match_st_function):  When matching a statement function,
	need to check if the statement function name shadows the function
	name.

2019-08-17  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78739
	* fortran.dg/pr78739.f90: New test.

From-SVN: r274611
2019-08-17 18:14:26 +00:00
Steven G. Kargl a5d319be20 re PR fortran/78719 ([F03] ICE in gfc_get_symbol_decl, at fortran/trans-decl.c:1438)
2019-08-17  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78719
	* decl.c (get_proc_name): Check for a CLASS entity when trying to
	add attributes to an entity that already has an explicit interface.

2019-08-17  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78719
	* gfortran.dg/pr78719_1.f90: New test.
	* gfortran.dg/pr78719_2.f90: Ditto.
	* gfortran.dg/pr78719_3.f90: Ditto.

From-SVN: r274610
2019-08-17 18:11:58 +00:00
Steven G. Kargl 58dbb372c0 re PR fortran/82992 (ICE in create_int_parameter_array, at fortran/module.c:6586)
2019-08-17  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/82992
	* module.c (gfc_match_use):  When renaming a module entity, search
	current namespace for conflicting symbol.

2019-08-17  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/82992
	* gfortran.dg/pr71649.f90: Adjust error messages.
	* gfortran.dg/use_15.f90: Ditto.
	* gfortran.dg/use_rename_8.f90: Ditto.

From-SVN: r274609
2019-08-17 18:08:21 +00:00
Jason Merrill 8194d5ae96 PR c++/90393 - ICE with throw in ?:
I fixed the DR 1560 implementation properly for GCC 10, but for GCC 9 feel
that it's better not to change the meaning of well-formed code.  Reverting
the incomplete implementation fixes the ICEs.

	* call.c (build_conditional_expr_1): Revert changes from
	PR c++/64372 and c++/86205.

From-SVN: r274597
2019-08-16 21:34:00 -04:00
GCC Administrator ac9ea80f7c Daily bump.
From-SVN: r274594
2019-08-17 00:16:13 +00:00
Bernd Edlinger 3be4451740 backport: re PR tree-optimization/91109 ([arm] gcc.c-torture/execute/20040709-1.c fails since r273135)
2019-08-16  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        Backport from mainline
        2019-08-16  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR tree-optimization/91109
        * lra-int.h (lra_need_for_scratch_reg_p): Declare.
        * lra.c (lra): Use lra_need_for_scratch_reg_p.
        * lra-spills.c (lra_need_for_scratch_reg_p): New function.

From-SVN: r274578
2019-08-16 16:37:04 +00:00
Bernd Edlinger caf4834ef8 backport: re PR tree-optimization/91109 ([arm] gcc.c-torture/execute/20040709-1.c fails since r273135)
2019-08-16  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        Backport from mainline
        2019-08-07  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR tree-optimization/91109
        * lra-remat.c (update_scratch_ops): Remove assignment of the
        hard register.

From-SVN: r274577
2019-08-16 16:31:13 +00:00
Uros Bizjak 78c13f46b3 test_summary: Do not escape "=".
* test_summary: Do not escape "=".

From-SVN: r274566
2019-08-16 14:03:09 +02:00
GCC Administrator cc93dc0dc5 Daily bump.
From-SVN: r274554
2019-08-16 00:16:13 +00:00
Steve Ellcey 0540982587 backport: omp-simd-clone.c (simd_clone_adjust_return_type): Remove call to build_distinct_type_copy.
2019-08-15  Steve Ellcey  <sellcey@marvell.com>

	Backport from mainline
	2019-08-02  Steve Ellcey  <sellcey@marvell.com>

	* omp-simd-clone.c (simd_clone_adjust_return_type): Remove call to
	build_distinct_type_copy.
	(simd_clone_adjust_argument_types): Ditto.
	(simd_clone_adjust): Call build_distinct_type_copy here.
	(expand_simd_clones): Ditto.

From-SVN: r274548
2019-08-15 20:41:47 +00:00
Marek Polacek 3bc5b51175 PR c++/90884 - stray note with -Wctor-dtor-privacy.
* class.c (maybe_warn_about_overly_private_class): Guard the call to
	inform.

From-SVN: r274547
2019-08-15 18:35:07 +00:00
Marek Polacek 8f236cea1d PR c++/90473 - wrong code with nullptr in default argument.
* call.c (null_ptr_cst_p): Update quote from the standard.
	* decl.c (check_default_argument): Don't return nullptr when the arg
	has side-effects.

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

From-SVN: r274546
2019-08-15 18:33:43 +00:00
Marek Polacek 9be0b095c9 PR c++/87519 - bogus warning with -Wsign-conversion.
* typeck.c (cp_build_binary_op): Use same_type_p instead of comparing
	the types directly.

	* g++.dg/warn/Wsign-conversion-5.C: New test.

From-SVN: r274545
2019-08-15 18:32:33 +00:00
Marek Polacek 857f2fe622 PR c++/81429 - wrong parsing of constructor with C++11 attribute.
* parser.c (cp_parser_constructor_declarator_p): Handle the scenario
	when a parameter declaration begins with [[attribute]].

	* g++.dg/cpp0x/gen-attrs-68.C: New test.
	* g++.dg/cpp0x/gen-attrs-69.C: New test.

From-SVN: r274544
2019-08-15 18:31:16 +00:00
Richard Biener bb4446179d backport: [multiple changes]
2019-08-15  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91445
	* gcc.dg/torture/pr91445.c: New testcase.

	Backport from mainline
	2019-07-05  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91091
	* tree-ssa-alias.h (get_continuation_for_phi): Add tbaa_p parameter.
	(walk_non_aliased_vuses): Likewise.
	* tree-ssa-alias.c (maybe_skip_until): Pass down tbaa_p.
	(get_continuation_for_phi): New tbaa_p parameter and pass
	it down.
	(walk_non_aliased_vuses): Likewise.
	* tree-ssa-pre.c (translate_vuse_through_block): Likewise.
	* tree-ssa-scopedtables.c (avail_exprs_stack::lookup_avail_expr):
	Likewise.
	* tree-ssa-sccvn.c (struct vn_walk_cb_data): Add tbaa_p flag.
	(vn_reference_lookup_3): Handle and pass down tbaa_p flag.
	(vn_reference_lookup_pieces): Adjust.
	(vn_reference_lookup): Remove alias-set altering, instead pass
	down false as tbaa_p.

	* gcc.dg/tree-ssa/pr91091-2.c: New testcase.

	2019-07-04  Richard Biener  <rguenther@suse.de>

	* tree-ssa-sccvn.h (vn_reference_lookup): Add last_vuse_ptr
	argument.
	* tree-ssa-sccvn.c (last_vuse_ptr, vn_walk_kind): Move
	globals into...
	(struct vn_walk_cb_data): New callback data struct.
	(vn_reference_lookup_2): Adjust.
	(vn_reference_lookup_3): Likewise.
	(vn_reference_lookup_pieces): Likewise.
	(vn_reference_lookup): Likewise, get last_vuse_ptr argument.
	(visit_reference_op_load): Adjust.

From-SVN: r274532
2019-08-15 12:02:47 +00:00
GCC Administrator 6ee515d505 Daily bump.
From-SVN: r274500
2019-08-15 00:16:22 +00:00
Martin Sebor 1a095ab0a9 backport: re PR c++/90947 (Simple lookup table of array of strings is miscompiled)
Backport from mainline

	2019-08-01  Martin Sebor  <msebor@redhat.com>

	PR c++/90947
	* tree.c (type_initializer_zero_p): Define.
	* tree.h (type_initializer_zero_p): New function.

	2019-08-05  Martin Sebor  <msebor@redhat.com>

	* doc/extend.texi (Common Variable Attributes): Document alias
	attribute.

	2019-08-01  Martin Sebor  <msebor@redhat.com>

	PR c++/90947
	* decl.c (reshape_init_array_1): Avoid truncating initializer
	lists containing string literals.

	2019-08-14  Martin Sebor  <msebor@redhat.com>

	PR tree-optimization/91294
	* gcc.dg/strlenopt-44.c: Adjust tested result.
	* gcc.dg/strlenopt-70.c: Avoid exercising unimplemnted optimization.
	* gcc.dg/strlenopt-73.c: New test.
	* gcc.dg/strlenopt-74.c: New test.
	* gcc.dg/strlenopt-75.c: New test.
	* gcc.dg/strlenopt-76.c: New test.
	* gcc.dg/strlenopt-77.c: New test.

From-SVN: r274494
2019-08-14 14:36:46 -06:00
Jonathan Wakely 10e3d230dd PR c++/91436 fix C++ dialect for std::make_unique fix-it hint
The std::make_unique function wasn't added until C++14, and neither was
the std::complex_literals namespace.

gcc/cp:

	PR c++/91436
	* name-lookup.c (get_std_name_hint): Fix min_dialect field for
	complex_literals and make_unique entries.

gcc/testsuite:

	PR c++/91436
	* g++.dg/lookup/missing-std-include-5.C: Limit test to C++14 and up.
	* g++.dg/lookup/missing-std-include-6.C: Don't check make_unique in
	test that runs for C++11.
	* g++.dg/lookup/missing-std-include-8.C: Check make_unique here.

From-SVN: r274493
2019-08-14 21:10:00 +01:00
Steven G. Kargl d5c39366b6 re PR fortran/87991 (ICE in gfc_constructor_append_expr, at fortran/constructor.c:135)
2019-08-13  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/87991
	* resolve.c (check_data_variable): data-stmt-object with pointer
	attribute requires a data-stmt-value with the target attribute.
 
2019-08-13  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/87991
	* gfortran.dg/pr87991.f90: New test.

From-SVN: r274413
2019-08-14 04:38:29 +00:00
GCC Administrator b43c457d46 Daily bump.
From-SVN: r274409
2019-08-14 00:16:15 +00:00
Thomas Koenig 088f5f1596 backport: re PR fortran/90563 (Out of bounds error when compiling with -Wextra)
2013-08-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/90563
	* frontend-passes.c (insert_index): Suppress errors while
	simplifying the resulting expression.

2013-08-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/90563
	* gfortran.dg/do_subsript_5.f90: New test.

From-SVN: r274405
2019-08-13 22:25:32 +00:00
Steven G. Kargl b332d1d054 re PR fortran/88072 (gfortran crashes with an internal compiler error)
2019-08-13  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88072
	* misc.c (gfc_typename): Do not point to something that ought not to 
	be pointed at.

2019-08-13  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88072
	* gfortran.dg/pr88072.f90: New test.
	* gfortran.dg/unlimited_polymorphic_28.f90: Fix error message.

From-SVN: r274401
2019-08-13 20:38:01 +00:00
Thomas Koenig 1e43632dbd backport: re PR fortran/90561 (ICE in gimplify_var_or_parm_decl, at gimplify.c:2747)
2019-08-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/90561
	* trans.h (gfc_evaluate_now_function_scope): New function.
	* trans.c (gfc_evaluate_now_function_scope): New function.
	* trans-expr.c (gfc_trans_assignment): Use it.

2019-08-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/90561
	* gfortran.dg/deferred_character_34.f90: New test.

From-SVN: r274398
2019-08-13 20:01:43 +00:00
Steven G. Kargl 46af5b2e56 re PR fortran/89647 (Host associated procedure unable to be used as binding target)
2019-08-13  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/89647
	resolve.c (resolve_typebound_procedure): Allow host associated 
	procedure to be a binding target.  While here, wrap long line.

2019-08-13  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/89647
	* gfortran.dg/pr89647.f90: New test.

From-SVN: r274395
2019-08-13 18:49:00 +00:00
Steven G. Kargl 6a2ca0d431 re PR fortran/87993 (ICE in gfc_constructor_first, at fortran/constructor.c:234)
2019-08-13  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/87993
	* expr.c (gfc_simplify_expr): Simplifcation of an array with a kind
	type inquiry suffix yields a constant expression.

2019-08-13  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/87993
	* gfortran.dg/pr87993.f90: New test.

From-SVN: r274390
2019-08-13 18:27:05 +00:00
Jonathan Wakely 06b6df92d4 PR libstdc++/90361 add missing macro definition
The src/c++17/string-inst.cc file needs to override the default string
ABI so that it still contains the expected symbols even when the library
is configured with --with-default-libstdcxx-abi=gcc4-compatible.

Backport from mainline
2019-08-12  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90361
	* src/c++17/string-inst.cc: Use _GLIBCXX_USE_CXX11_ABI=1 by default.

From-SVN: r274379
2019-08-13 14:14:45 +01:00
Thomas Koenig 17adf232a0 backport: re PR fortran/91424 (Extend warnings about DO loops)
2019-08-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/91424
	* frontend-passes.c (do_subscript): Do not warn for an
	expression a second time.  Do not warn about a zero-trip loop.
	(doloop_warn): Also look at contained namespaces.

2019-08-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/91424
	* gfortran.dg/do_subscript_3.f90: New test.
	* gfortran.dg/do_subscript_4.f90: New test.
	* gfortran.dg/pr70754.f90: Use indices that to not overflow.

2019-08-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/91422
	* testsuite/libgomp.oacc-fortran/routine-7.f90: Correct array
	dimension.

From-SVN: r274369
2019-08-13 10:05:44 +00:00
Janne Blomqvist 4c98406c52 PR fortran/91414 Correctly fill master_state from os_seed.
From-SVN: r274364
2019-08-13 12:02:25 +03:00
Janne Blomqvist 2a3c1bfcdd PR fortran/91414 Improve initialization of PRNG
As part of PR 91414 an improved PRNG was contributed to trunk. This is
a partial backport of some related changes to the PRNG. Namely when
seeding the PRNG, it needs only 8 bytes of randomness from the OS, and
uses a simple splitmix64 PRNG to fill in the rest of the state,
instead of getting all the state from the OS. This can be useful for
operating systems that can run out of entropy.

libgfortran/ChangeLog:

2019-08-13  Janne Blomqvist  <jb@gcc.gnu.org>

	Partial backport from trunk
	PR fortran/91414
	* intrinsics/random.c (lcg_parkmiller): Replace with splitmix64.
	(splitmix64): New function.
	(getosrandom): Fix return value, simplify.
	(init_rand_state): Use getosrandom only to get 8 bytes, splitmix64
	to fill rest of state.

From-SVN: r274362
2019-08-13 11:42:43 +03:00
GCC Administrator 097cc23be3 Daily bump.
From-SVN: r274326
2019-08-13 00:16:12 +00:00
Steven G. Kargl a77715d940 re PR fortran/91359 (logical function X returns .TRUE. - Warning: spaghetti code)
2019-08-12  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91359
	* trans-decl.c (gfc_generate_return): Ensure something is returned
	from a function.

2019-08-12  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91359
	* gfortran.dg/pr91359_1.f: New test.
	* gfortran.dg/pr91359_2.f: Ditto.

From-SVN: r274319
2019-08-12 20:09:00 +00:00
Steven G. Kargl 5c97aa1975 re PR fortran/42546 (ALLOCATED statement typo in the docs and for scalar variables)
2019-08-01  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/42546
	* check.c(gfc_check_allocated): Add comment pointing to ...
	* intrinsic.c(sort_actual): ... the checking done here.
 
2019-08-01  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/42546
	* gfortran.dg/allocated_1.f90: New test.
	* gfortran.dg/allocated_2.f90: Ditto.

From-SVN: r274318
2019-08-12 19:48:37 +00:00
Tom Honermann 6e21f7d2cc PR c++/88095, CTAD for literal operator templates per P0732
This patch fixes PR c++/88095: class nontype template parameter UDL string
literals doesn't accepts deduction placeholder

It also addresses a latent issue; literal operator templates with template
parameter packs of literal class type were previously accepted.  The patch
corrects this and adds a test (udlit-class-nttp-neg.C).

This fix is needed for one of the char8_t remediation approaches documented
in P1423, and may be helpful for existing code bases impacted by the char8_t
changes adopted via P0482 for C++20.

gcc/cp/ChangeLog:

2019-08-02  Tom Honermann  <tom@honermann.net>

        * parser.c (cp_parser_template_declaration_after_parameters): Enable
        class template argument deduction for non-type template parameters
        in literal operator templates.

gcc/testsuite/ChangeLog:

2019-08-02  Tom Honermann  <tom@honermann.net>

        PR c++/88095
        * g++.dg/cpp2a/udlit-class-nttp-ctad.C: New test.
        * g++.dg/cpp2a/udlit-class-nttp-ctad-neg.C: New test.
        * g++.dg/cpp2a/udlit-class-nttp-ctad-neg2.C: New test.
        * g++.dg/cpp2a/udlit-class-nttp.C: New test.
        * g++.dg/cpp2a/udlit-class-nttp-neg.C: New test.
        * g++.dg/cpp2a/udlit-class-nttp-neg2.C: New test.

From-SVN: r274317
2019-08-12 13:46:37 -04:00
Jason Merrill 0b8c260326 PR c++/91378 - ICE with noexcept and auto return type.
Here, since the call to g is not type-dependent, we call mark_used on it to
determine its return type.  This also wants to instantiate the
noexcept-expression.  But since nothing in maybe_instantiate_noexcept was
calling push_to_top_level, we substituted b.i with processing_template_decl
set, so we left it unresolved for later access checking.  As a result, the
type of C::g<int> remained instantiation-dependent, leading to an ICE in
type_dependent_expression_p on the assert that the type of a function
template with no dependent template arguments must be non-dependent.

	* pt.c (maybe_instantiate_noexcept): push_to_top_level.

From-SVN: r274316
2019-08-12 13:46:32 -04:00
Jason Merrill 3f92498c3f PR c++/90538 - multiple expansions of capture packs
Previously, with init-capture the type of the closure field was a
DECLTYPE_TYPE of the initializer.  But since each time we tsubst a lambda we
get a different lambda, that meant that if the initializer is a lambda, we'd
end up with different closure types in the field and initializer after
substitution (PR 87322).  We dealt with this by remembering the lambda
instantiation within each pack expansion element, using
local_specialization_stack to separate the elements.  But that broke this
testcase, because it lost lambda capture proxies that also use
local_specializations.

So, this patch removes the local_specializations changes from that patch and
fixes 87322 differently, by giving init-capture fields 'auto' type and doing
deduction later.  There's a bit of a kludge to get the right number of
fields by pretending that 'auto...' uses the parameter packs from the
initializer, but it does the trick.

	* cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): Remove.
	* lambda.c (add_capture): Copy parameter packs from init.
	(lambda_capture_field_type): Always use auto for init-capture.
	* pt.c (uses_parameter_packs): Return tree.
	(tsubst) [DECLTYPE_TYPE]: Remove init-capture handling.
	(gen_elem_of_pack_expansion_instantiation): Don't push
	local_specialization_stack.
	(prepend_one_capture): New.
	(tsubst_lambda_expr): Use it.  Don't touch local_specializations.
	(do_auto_deduction): Avoid redundant error.

From-SVN: r274315
2019-08-12 13:46:25 -04:00
Richard Biener 56067ed575 backport: [multiple changes]
2019-08-12  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-08-12  Richard Biener  <rguenther@suse.de>

	PR lto/91375
	* tree.c (free_lang_data_in_type): Do not free TYPE_BINFO dependent on
	flag_devirtualize.

	2019-08-12  Richard Biener  <rguenther@suse.de>

	PR driver/91130
	* lto-wrapper.c (get_options_from_collect_gcc_options): Remove
	lang_mask option, always use CL_DRIVER.
	(find_and_merge_options): Adjust.
	(run_gcc): Likewise.

	2019-08-07  Richard Earnshaw  <rearnsha@arm.com>

	PR driver/91130
	* lto-wrapper.c (find_and_merge_options): Use CL_DRIVER when
	processing COLLECT_GCC_OPTIONS.
	(run_gcc): Likewise.

From-SVN: r274311
2019-08-12 12:59:08 +00:00
Jakub Jelinek a8e4a6e0ca * BASE-VER: Set to 9.2.1.
From-SVN: r274276
2019-08-12 10:40:24 +02:00
Jakub Jelinek a0c06cc27d Update ChangeLog and version files for release
From-SVN: r274274
2019-08-12 09:38:49 +02:00
GCC Administrator 3244e42a52 Daily bump.
From-SVN: r274271
2019-08-12 00:16:21 +00:00
GCC Administrator 64ec603fe7 Daily bump.
From-SVN: r274260
2019-08-11 00:16:21 +00:00
GCC Administrator 175890a983 Daily bump.
From-SVN: r274247
2019-08-10 00:16:19 +00:00
Joseph Myers 8c6e179a70 * zh_TW.po: Update.
From-SVN: r274244
2019-08-09 23:02:27 +01:00
Joseph Myers 4f3bacbcfb * uk.po: Update.
From-SVN: r274242
2019-08-09 23:00:57 +01:00
GCC Administrator dbe254e509 Daily bump.
From-SVN: r274223
2019-08-09 00:16:13 +00:00
GCC Administrator d51ec706e8 Daily bump.
From-SVN: r274204
2019-08-08 00:16:25 +00:00
GCC Administrator bd6a87ed21 Daily bump.
From-SVN: r274154
2019-08-07 00:16:23 +00:00
GCC Administrator 7df42f137e Daily bump.
From-SVN: r274133
2019-08-06 00:16:18 +00:00
Iain Sandoe 0ae5ccfd0b Ada, Darwin, PPC, backport fix for stack check probes.
On PPC, Darwin uses the same code as other parts of the port.

2019-08-05  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-07-02  Iain Sandoe  <iain@sandoe.co.uk>

	* libgnat/system-darwin-ppc.ads: Set Stack_Check_Probes True for
	PPC Darwin.

From-SVN: r274111
2019-08-05 08:12:23 +00:00
Iain Sandoe fd2db2c38b Ada, backport push -shared-libgcc where needed.
Gnatlink has code that checks for duplicate '-shared-libgcc’ switches (but not
duplicate ‘static-libgcc’) and also pushes ’static-libgcc' onto the link line for
targets that default to static linking, provided '-shared-libgcc' is not present.

For targets that should use a shared libgcc we need the same process to be
applied (in inverse), in the event that they do not default to providing the
shared flag implicitly.

So this adds the complementary set of tests for the shared case and pushes
the shared flag as needed. As a minor tidy-up there’s no need push duplicates
of the libgcc switch onto the link line when one has already been seen (given by
the user).

The patch does not alter any of the platform defaults for static/shared libgcc,
but it ensures that the intent of the link is explicit.

2019-08-05  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-30  Iain Sandoe  <iain@sandoe.co.uk>

	* gnatlink.adb (Link_Step): Remove duplicate -static-libgcc switches.
	Push -shared-libgcc explicitly, when it is the target default (unless
	overidden by the static flag).
	When the user has put an instance of shared/static-libgcc do not push
	a duplicate of this.

From-SVN: r274110
2019-08-05 08:09:34 +00:00
Kito Cheng 41e094840b RISC-V: Promote type correctly for libcalls
- argument and return value for libcall won't promote at
   default_promote_function_mode_always_promote, however we expect it
   should sign-extend as normal function.

 - Witout this patch, this test case will fail at -march=rv64i -mabi=lp64.

 - The implementation of riscv_promote_function_mode is borrowed from MIPS.

gcc/ChangeLog

	Backport from mainline
	2019-08-05  Kito Cheng  <kito.cheng@sifive.com>

	* config/riscv/riscv.c (riscv_promote_function_mode): New.
	(TARGET_PROMOTE_FUNCTION_MODE): Use riscv_promote_function_mode.

gcc/testsuite/ChangeLog

	Backport from mainline
	2019-08-05  Kito Cheng  <kito.cheng@sifive.com>

	* gcc.target/riscv/promote-type-for-libcall.c: New.

From-SVN: r274108
2019-08-05 07:54:31 +00:00
Alan Modra 2aeeb52fc4 PR91349, powerpc64*-*-freebsd* defines _GNU_SOURCE
rev 266496 (git ab6b1bb456) undefined some macros in rs6000/freebsd.h
but missed doing the same in rs6000/freebsd64.h.

	PR target/91349
	* config/rs6000/freebsd64.h (CPLUSPLUS_CPP_SPEC),
	(LINK_GCC_C_SEQUENCE_SPEC): Undef.

From-SVN: r274106
2019-08-05 11:23:31 +09:30
Jerry DeLisle a520fd91c4 backport: re PR fortran/87233 (Constraint C1279 still followed after f2008 standard revision (?))
2019-08-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	Backport from trunk
	PR fortran/87233
	* expr.c (check_restricted): Relax constraint C1279 which was
	removed from F2008 and above.

	* gfortran.dg/initialization_14.f90: Modify to now pass by
	removing two dg-error commands. Added comments.
	* gfortran.dg/initialization_30.f90: New test that includes the
	two tests removed above with the 'dg-options -std=f95'.

From-SVN: r274104
2019-08-05 00:47:41 +00:00
GCC Administrator b80e6fe7ba Daily bump.
From-SVN: r274102
2019-08-05 00:16:19 +00:00
Segher Boessenkool 691a9e8841 backport: rs6000.c (rs6000_dbx_register_number): Return the correct numbers for TFHAR, TFIAR, TEXASR.
Backport from trunk
	2019-05-02  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.c (rs6000_dbx_register_number): Return the
	correct numbers for TFHAR, TFIAR, TEXASR.

From-SVN: r274097
2019-08-04 21:23:59 +02:00
Iain Sandoe c63d7838df Objective-C, NeXT, backport workaround for PR90709
Since we cannot parse the current NeXT headers, because of PR90709 and its
dependents, we have a large amount of testsuite noise for Darwin platforms.
In order to restore the usefulness of the testsuite, we are going add headers
without the modern syntax elements that trigger the bug, and use these for
test runs on newer Darwin.

The headers are imported from GNUStep, with some local modifications to make
sure that __BLOCKS__ is honoured as a gate for Apple-style blocks closures.

CF-CFString.h, F-NS*.h are proxy headers that use the installed CoreFoundation
or Foundation headers on systems <= Darwin12 and the GNUStep headers for newer.

Use the CF-CFString.h, F-NS*.h proxy headers where needed in the objective-c
testsuite. Make minor adjustments to tests as required, providing that those
do not alter the test intent.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-15  Iain Sandoe  <iain@sandoe.co.uk>

	PR objc/90709
	* obj-c++.dg/proto-lossage-7.mm: Use proxy headers.
	* obj-c++.dg/strings/const-cfstring-2.mm: Likewise.
	* obj-c++.dg/strings/const-cfstring-5.mm: Likewise
	* obj-c++.dg/strings/const-str-12.mm: Likewise.
	* obj-c++.dg/syntax-error-1.mm: Likewise.
	* obj-c++.dg/torture/strings/const-cfstring-1.mm: Likewise.
	* obj-c++.dg/torture/strings/const-str-10.mm: Likewise.
	* obj-c++.dg/torture/strings/const-str-11.mm: Likewise.
	* obj-c++.dg/torture/strings/const-str-9.mm: Likewise.
	* obj-c++.dg/cxx-ivars-3.mm: Skip on later Darwin, where the 10.4 API
	in no longer supported, also on m64 where there's no meaning to it.
	* obj-c++.dg/isa-field-1.mm: Suppress unwanted warning, add comment why.
	* obj-c++.dg/objc-gc-3.mm: Skip for Darwin > 16, the API use is an error
	there.
	* obj-c++.dg/qual-types-1.mm: Prune a spurious l64 warning.
	* obj-c++.dg/stubify-1.mm: Tidy up after better compiler warnings.
	* obj-c++.dg/stubify-2.mm: Likewise.
	* obj-c++.dg/try-catch-1.mm: Likewise.
	* obj-c++.dg/try-catch-3.mm: Likewise.

	Backport from mainline.
	2019-06-15  Iain Sandoe  <iain@sandoe.co.uk>

	PR objc/90709
	* objc.dg/encode-7-next-64bit.m: Use proxy headers.
	* objc.dg/image-info.m: Likewise.
	* objc.dg/method-6.m: Likewise.
	* objc.dg/no-extra-load.m: Likewise.
	* objc.dg/objc-foreach-4.m: Likewise.
	* objc.dg/objc-foreach-5.m: Likewise.
	* objc.dg/proto-lossage-7.m: Likewise.
	* objc.dg/strings/const-cfstring-2.m: Likewise.
	* objc.dg/strings/const-cfstring-5.m: Likewise.
	* objc.dg/strings/const-str-12b.m: Likewise.
	* objc.dg/symtab-1.m: Likewise.
	* objc.dg/torture/strings/const-cfstring-1.m: Likewise.
	* objc.dg/torture/strings/const-str-10.m: Likewise.
	* objc.dg/torture/strings/const-str-11.m: Likewise.
	* objc.dg/torture/strings/const-str-9.m: Likewise.
	* objc.dg/zero-link-1.m: Likewise.
	* objc.dg/zero-link-2.m: Likewise.
	* objc.dg/zero-link-3.m: Likewise.
	* objc.dg/isa-field-1.m: Suppress unwanted warning, add comment why.
	* objc.dg/headers.m: XFAIL for Darwin14-19.
	* objc.dg/objc-gc-4.m: Skip for Darwin > 16, the API use is an error
	there.

	Backport from mainline.
	2019-06-15  Iain Sandoe  <iain@sandoe.co.uk>

	PR objc/90709
	* objc-obj-c++-shared/CF-CFString.h: New.
	* objc-obj-c++-shared/F-NSArray.h: New.
	* objc-obj-c++-shared/F-NSAutoreleasePool.h: New.
	* objc-obj-c++-shared/F-NSObject.h: New.
	* objc-obj-c++-shared/F-NSString.h: New.
	* objc-obj-c++-shared/F-NSValue.h: New.
	* objc-obj-c++-shared/GNUStep/CoreFoundation/CFArray.h: New.
	* objc-obj-c++-shared/GNUStep/CoreFoundation/CFAvailability.h: New.
	* objc-obj-c++-shared/GNUStep/CoreFoundation/CFBase.h: New.
	* objc-obj-c++-shared/GNUStep/CoreFoundation/CFCharacterSet.h: New.
	* objc-obj-c++-shared/GNUStep/CoreFoundation/CFData.h: New.
	* objc-obj-c++-shared/GNUStep/CoreFoundation/CFDictionary.h: New.
	* objc-obj-c++-shared/GNUStep/CoreFoundation/CFLocale.h: New.
	* objc-obj-c++-shared/GNUStep/CoreFoundation/CFString.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSArray.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSAutoreleasePool.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSDate.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSEnumerator.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSGeometry.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSObjCRuntime.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSObject.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSRange.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSString.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSValue.h: New.
	* objc-obj-c++-shared/GNUStep/Foundation/NSZone.h: New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/GNUstep.h: New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/GSBlocks.h: New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/GSConfig.h: New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/GSObjCRuntime.h: New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/GSVersionMacros.h: New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/NSArray+GNUstepBase.h: New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/NSMutableString+GNUstepBase.h:
	New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/NSNumber+GNUstepBase.h: New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/NSObject+GNUstepBase.h: New.
	* objc-obj-c++-shared/GNUStep/GNUstepBase/NSString+GNUstepBase.h: New.

From-SVN: r274095
2019-08-04 13:34:19 +00:00
Iain Sandoe 38a52f7464 Darwin, PPC, testsuite, backport fix for bmi2-bzhi64-1a.c
This test is failing with older cpus because the included header needs both
altivec and vsx to be enabled to succeed in compiling. Without this (if these
are not defaults for the cpu) there are errors like:

In file included from ... x86intrin.h:41,
from ... bmi2-bzhi64-1a.c:6:
... xmmintrin.h: In function '_mm_loadu_ps':
... xmmintrin.h:122:11:
error: incompatible types when returning type 'int' but '__m128' {aka '__vector(4) float'} was expected
<snip>
... xmmintrin.h: In function '_mm_cvtps_pi32':
... xmmintrin.h:996:3:
error: use of 'long long' in AltiVec types is invalid without '-mvsx'
<snip>

Fixed by adding -maltivec -mvsx to the options

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-07-27  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/powerpc/bmi2-bzhi64-1a.c: Add options to enable altivec
	and vsx.

From-SVN: r274093
2019-08-04 13:17:15 +00:00
Iain Sandoe 937e3317aa Darwin, testsuite, backport fix for 91087.
The testcase is failing to instrument part of the source because of a bug
in the ordering of static DTORs. It seems unlikely that this is generically
fixable in the toolchain (and given that it's likely to be a dynamic loader
change would not be expected to be applied retrospectively to OS versions
that are out of support). To avoid the testsuite noise, xfail the count lines
that don't match (we can adjust the xfails as/when the upstream bug is fixed).

dejagnu xfails do not seem to work when embedded in a line like:
~Test (void) { .... /* count(1) { xfail ... } */ }
the closing brace seems to confuse the parser. The solution is to exapnd the
text onto three lines.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-07-25  Iain Sandoe  <iain@sandoe.co.uk>

	PR gcov-profile/91087
	* g++.dg/gcov/pr16855.C: Xfail the count lines for the DTORs and the
	"final" line for the failure summaries.  Adjust source layout so that
	dejagnu xfail expressions work.

From-SVN: r274092
2019-08-04 13:12:26 +00:00
Iain Sandoe 7137a9c7cf Darwin, PPC, testsuite - backport fix for stabs-attrib-vect-darwin.
This test requires stabs support in the assembler so require it.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-07-13  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/powerpc/stabs-attrib-vect-darwin.c: Require stabs
	support.

From-SVN: r274091
2019-08-04 13:10:00 +00:00
Iain Sandoe 9d97d364d6 Darwin, testsuite, backport removal of unused test.
During GCC-9, the codegen for unreachable switch case statements changed
such that the (undefined) behaviour of reaching such statements is directed
to one of the existing switch cases. This means that the testcase which
deals with the old behaviour can no longer work (and there is nothing to test
with it). The [Darwin-specific] test is now redundant and can be removed.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-07-12  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.dg/pr57438-2.c: Remove.

From-SVN: r274090
2019-08-04 13:06:11 +00:00
Iain Sandoe 312258b69f Darwin, PPC, testsuite - backport fix for safe-indirect-jump* fails.
The -mno-speculate-indirect-jumps functionality is not implemented for
Darwin.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-24  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/powerpc/safe-indirect-jump-1.c: Skip for Darwin.
	* gcc.target/powerpc/safe-indirect-jump-7.c: Likewise.

From-SVN: r274088
2019-08-04 12:59:22 +00:00
Iain Sandoe 2165bc2dc9 Darwin, PPC, testsuite - backport fix for powerpc/spec-barr-1.c
We just needed to adjust the regex to accept Darwin's register names.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-24  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/powerpc/spec-barr-1.c: Adjust scan assembler regex
	to recognise Darwin's register names.

From-SVN: r274087
2019-08-04 12:55:56 +00:00
Iain Sandoe 653561962e Darwin, testsuite - backport fix for cpp/isysroot-1.c.
For the test to succeed there needs to be some header that is to be found in
the 'expected' place i.e. <sysroot>/usr/include/. It's important that it is
not the name of a header for which fixincludes have been applied, since such
headers will be found in the gcc include-fixed dir and, in general, reference
additional headers. The dummy sysroot will prevent the additional headers
from being found, resulting in a failed test. The fix is to use a header name
that isn't expected to be present in a real sysroot.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-24  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.dg/cpp/isysroot-1.c: Use <example.h> as the test header.
	* gcc.dg/cpp/usr/include/stdio.h: Rename...
	* gcc.dg/cpp/usr/include/example.h: ... to this.

From-SVN: r274086
2019-08-04 12:52:31 +00:00
Iain Sandoe 504ea2ade6 Darwin, PPC< testsuite - backport fix for powerpc/builtins-2.c
This cannot pass for current Darwin, since it requires VSX and we
don't have any hardware supporting that. Add a dg-requires clause
for this.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-23  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/powerpc/builtins-2.c: Require VSX hardware support.

From-SVN: r274085
2019-08-04 12:49:12 +00:00
Iain Sandoe 5406f55fb5 Darwin, PPC, testsuite, backport fix for pr80125.
Darwin (unlike most of the members of the PowerPC port family)
defaults to signed chars, so the test was failing to compile with
a "mismatched parameters" error.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-23  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/powerpc/pr80125.c (foo): Use an unsigned char
	vector explicitly for the vec_perm.

From-SVN: r274084
2019-08-04 12:46:00 +00:00
Iain Sandoe 83a52fd08c Darwin, PPC, testsuite - backport fix for builtins-1.
This needs to account for Darwin's __USER_LABEL_PREFIX__.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-23  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/powerpc/builtins-1.c: Account for Darwin's use of
	__USER_LABEL_PREFIX__.

From-SVN: r274083
2019-08-04 12:40:43 +00:00
Iain Sandoe 04f5aea46f Darwin, PPC, testsuite, backport fix for pr71785.
Firstly, we adjust the test conditions to use non-PIC code for Darwin.
Secondly, we have to account for out-of-line GPR restores which gives
a false positive on one of the scan-assembler-not. Lastly, we make the
test a bit more specific for Darwin - that it looks for absence of
branches to local labels.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-23  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/powerpc/pr71785.c: For Darwin, make test non-PIC,
	expect the out-of-line GPR restore, and test specifically for
	absence of branches to local labels.

From-SVN: r274082
2019-08-04 12:37:28 +00:00
Iain Sandoe 049c6c4ff8 Darwin, PPC, testsuite, require DFP for two tests using it.
The two tests use decimal floating point, add the relevant dg-requires
so that they are unsupported on platforms without DFP.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-22  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/powerpc/pr64205.c: Require effective target dfp.
	* gcc.target/powerpc/pr79909.c: Likewise.

From-SVN: r274081
2019-08-04 12:29:53 +00:00
Iain Sandoe ebe1b3d02a Darwin, ppc, testsuite, backport fix for darwin-bool-1.
This test is failing because of a pedantic warning that is unrelated to the
purpose of the test. Fixed by suppressing that warning

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-22  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/powerpc/darwin-bool-1.c: Suppress the pedantic
	warning about _Bool.

From-SVN: r274080
2019-08-04 12:22:55 +00:00
Iain Sandoe 8d4735c76c Darwin, testsuite, backport fix for pr71694.
This test fails for Darwin m32 because it's scanning for absence
of an instruction that's validly used in PIC code.  Fixed, in this
case, by using non-PIC codegen.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-13  Iain Sandoe  <iain@sandoe.co.uk>

	* g++.dg/pr71694.C: Use non-PIC codegen for Darwin m32.

From-SVN: r274079
2019-08-04 12:16:10 +00:00
Iain Sandoe f58ad7a2eb Darwin, testsuite, backport fix for darwin-minversion-1,2.
Newer OS versions (10.14+) do not provide some of the CRTs that are used
for older ones (e.g. 10.5), and thus link tests that specify targeting
such a revision fail. We retain the testing of the correct defined OS
version number but switch to compile-only testing for these two tests.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-13  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.dg/darwin-minversion-1.c: Use compile rather than link/run.
	* gcc.dg/darwin-minversion-2.c: Likewise.

From-SVN: r274078
2019-08-04 12:12:30 +00:00
Iain Sandoe a8fed94384 Darwin, testsuite, require alias support in a test using it.
2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-13  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.dg/pr90760.c: Require alias support.

From-SVN: r274077
2019-08-04 12:08:41 +00:00
Iain Sandoe 2a4741c315 Darwin, testsuite, backport fix for PR65364
This test currently fails on Darwin, because the port inlines fn2 for
both PIC (and non-pic for m32).  Fixed by adjusting the target condition.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-11  Iain Sandoe  <iain@sandoe.co.uk>

	PR testsuite/65364
	* gcc.dg/uninit-19.c (fn1): Adjust target condition for Darwin.
	(fn2): Likewise.

From-SVN: r274076
2019-08-04 12:04:06 +00:00
Iain Sandoe 8193730064 Darwin, testsuite, backport fix for test using aliases.
2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-10  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.dg/attr-copy-6.c: Require alias support.

From-SVN: r274075
2019-08-04 12:00:42 +00:00
Iain Sandoe 2ee9abad37 Darwin, testsuite, backport fix for cpp0x/alignas4.C
Darwin produces aligned zerofill directives for the objects represented.
We can scan for these using lp64 and ilp32 to catch operation on both
X86 and PowerPC ports (the test is for the alignment which is the trailing
value in the zerofill directive, as a power of two).

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-06  Iain Sandoe  <iain@sandoe.co.uk>

	* g++.dg/cpp0x/alignas4.C: Amend test to check for zerofill syntax
	on Darwin.

From-SVN: r274074
2019-08-04 11:57:41 +00:00
Iain Sandoe 928b22fbcb Darwin, X86, backport test adjusts for PR90698.
We don't have support for -mcmodel={medium, large, kernel} so don't
expect tests for those things to work.

For now mark them as xfail where possible and skip where that isn't.
These changes will be logged onto the PR and therefore can be backed
out when the facility is implemented.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-01  Iain Sandoe  <iain@sandoe.co.uk>

	PR target/90698
	* gcc.target/i386/pr49866.c: XFAIL for Darwin.
	* gcc.target/i386/pr63538.c: Likewise.
	* gcc.target/i386/pr61599-1.c: Skip for Darwin.

From-SVN: r274073
2019-08-04 11:54:13 +00:00
Iain Sandoe f0d4ff52fc Darwin, testsuite, require alias in a test where it's used.
2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-31  Iain Sandoe  <iain@sandoe.co.uk>

	* g++.dg/cpp0x/pr84497.C: Require alias support.

From-SVN: r274072
2019-08-04 11:46:44 +00:00
Iain Sandoe 5a9638e9fa Darwin, X86, backport testsuite fixes for align syntax.
Darwin has a .align taking a power of 2 by default, so that some
tests expecting a byte count are failing.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-31  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/i386/falign-functions-3.c: Adjust align syntax
	and label for Darwin.
	* gcc.target/i386/attr-aligned-2.c: Adjust align syntax for
	Darwin.

From-SVN: r274071
2019-08-04 11:43:19 +00:00
Iain Sandoe e3ed4177af Darwin, x86, backport TLS test fixes.
Require native TLS for two tests that use it.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-30  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/i386/pr86257.c: Require native TLS support.
	* gcc.target/i386/stack-prot-sym.c: Likewise.

From-SVN: r274070
2019-08-04 11:40:24 +00:00
Iain Sandoe 5a66a005c8 Darwin, x86, testsuite - backport for for pr22076 fail.
Darwin has a .align taking a power of 2 by default, so that some
tests expecting a byte count are failing, fixed thus.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-27  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/i386/pr22076.c: Adjust options to
	match codegen expected by the scan-asms.

From-SVN: r274069
2019-08-04 11:32:48 +00:00
Iain Sandoe c9d3b18629 Darwin, X86, backport fixes for three PIE tests.
Darwin requires PIC code in order to support PIE, amend the test scan-asms
to match this.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-26  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/i386/pr39013-1.c: Adjust scan-asms for PIE to
	account for PIC code on Darwin.
	* gcc.target/i386/pr39013-2.c: Likewise.
	* gcc.target/i386/pr64317.c: Likewise.

From-SVN: r274068
2019-08-04 11:01:41 +00:00
Iain Sandoe 68c80719ad Darwin, X86, backport test fix for pr59874-3.
This test fails on Darwin because the port has a different
spelling for popcnt.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-25  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/i386/pr59874-3.c: Use the spelling of popcnt
	expected for Darwin.

From-SVN: r274067
2019-08-04 10:53:48 +00:00
Iain Sandoe a4b691a706 Darwin, x86, backport testsuite fix.
Require alias support in a test using aliases.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-25  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/i386/pr82659-3.c: Require alias support.

From-SVN: r274066
2019-08-04 10:47:16 +00:00
Iain Sandoe 26913944c8 Darwin, X86, testsuite, backport matching fixes.
Some of the i386.exp tests fail on Darwin (and at least one passes
incorrectly on Linux) because their scan-asm match strings are too
general.  In some cases the strings also match instances in the .file
and size directives or in comment output.  This patch makes the match
strings more specific.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-24  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/i386/pconfig-1.c: Scan for the string in the generated
	code, not in comments or miscellaneous directives.
	* gcc.target/i386/pr18041-1.c: Likewise.
	* gcc.target/i386/pr18041-2.c: Likewise.
	* gcc.target/i386/wbinvd-1.c: Likewise.
	* gcc.target/i386/wbnoinvd-1.c: Likewise.
	* gcc.target/i386/pr66819-3.c: Specifically, check that there is no
	call to "bar".
	* gcc.target/i386/pr66819-4.c: Likewise.
	* gcc.target/i386/pr82662.c
	* gcc.target/i386/ptwrite2.c: Make the checks look for the specific
	destination register, don't try the m32 test on m64 targets.

From-SVN: r274065
2019-08-04 10:40:16 +00:00
Iain Sandoe 93d7687e69 Darwin, X86, testsuite backport USER_LABEL_PREFIX fixes.
more tests that failed on Darwin because of missing
__USER_LABEL_PREFIX__ matching.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-24  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/i386/pr67985-2.c: Adjust label checks for
	Darwin.
	* gcc.target/i386/pr77881.c: Likewise.

From-SVN: r274064
2019-08-04 10:33:57 +00:00
Iain Sandoe 11487843a9 Darwin, X86, backport test fixes.
Skip three tests that cannot pass on Darwin.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-24  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/i386/falign-functions-2.c: Skip for Darwin.
	* gcc.target/i386/pr70738-7.c: Likewise.
	* gcc.target/i386/pr24414.c: Likewise.

From-SVN: r274063
2019-08-04 10:29:37 +00:00
Iain Sandoe 17cef097cc Darwin, X86, backport fixes for 64895.
Although this is marked as rtl-optimisation, the Darwin
issue is that the testcase XPASS there since the codegen
is different.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-23  Iain Sandoe  <iain@sandoe.co.uk>

	PR rtl-optimisation/64895
	* gcc.target/i386/fuse-caller-save-rec.c: Remove XFAILs.
	* gcc.target/i386/fuse-caller-save.c: Likewise.
	* gcc.target/i386/fuse-caller-save-xmm.c: Adjust tests for
	PIC cases, remove XFAILs.

From-SVN: r274062
2019-08-04 10:24:34 +00:00
Iain Sandoe 43e803cbcf Darwin, testsuite, backport for for 27221.
This can't pass on 32b power Darwin, since the ABI conflicts.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-22  Iain Sandoe  <iain@sandoe.co.uk>

	PR testsuite/27221
	* g++.dg/ext/alignof2.C: XFAIL for 32bit Darwin.

From-SVN: r274061
2019-08-04 10:11:53 +00:00
Iain Sandoe 27eb679971 Darwin, X86, backport testsuite fix for 67958.
2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-21  Iain Sandoe  <iain@sandoe.co.uk>

	PR testsuite/67958
	* gcc.target/i386/pr32219-1.c: Adjust scan-asms for Darwin, comment
	the differences.
	* gcc.target/i386/pr32219-2.c: Likewise.
	* gcc.target/i386/pr32219-3.c: Likewise.
	* gcc.target/i386/pr32219-4.c: Likewise.
	* gcc.target/i386/pr32219-5.c: Likewise.
	* gcc.target/i386/pr32219-6.c: Likewise.
	* gcc.target/i386/pr32219-7.c: Likewise.
	* gcc.target/i386/pr32219-8.c: Likewise.

From-SVN: r274060
2019-08-04 10:06:33 +00:00
Iain Sandoe e986cbf43d Darwin, testsuite, backport fix for PR83891
2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-21  Iain Sandoe  <iain@sandoe.co.uk>

	PR target/63891
	* gcc.dg/darwin-weakimport-3.c: Adjust options and explain
	the reasons.

From-SVN: r274059
2019-08-04 09:59:21 +00:00
Iain Sandoe 305e10b977 Darwin, X86, backport fix for PR58321.
2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-20  Iain Sandoe  <iain@sandoe.co.uk>

	PR testsuite/58321
	* gcc.target/i386/memcpy-strategy-3.c: Adjust count for Darwin and
	add a comment as to the reason for the difference.
	* gcc.target/i386/memset-strategy-1.c: Likewise.

From-SVN: r274058
2019-08-04 09:53:37 +00:00
Iain Sandoe 6f2b8b5a5c Darwin, ppc, backport fixes to exclude Darwin from VSX, power8 & 9.
This fixes a large number of test fails when we build PPC Darwin
with an LLVM-based assembler (that recognises the insns).

The patch augments the tests for feature support for VSX,
power8 and power9 to exclude Darwin even if the assembler can
handle the instructions.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-15  Iain Sandoe  <iain@sandoe.co.uk>

	* lib/target-supports.exp 
	(check_effective_target_powerpc_p8vector_ok): No support for Darwin.
	(check_effective_target_powerpc_p9vector_ok): Likewise.
	(check_effective_target_powerpc_float128_sw_ok): Likewise.
	(check_effective_target_powerpc_float128_hw_ok): Likewise.
	(check_effective_target_powerpc_vsx_ok): Likewise.
	* gcc.target/powerpc/bfp/bfp.exp: Don't try to run this for Darwin.
	* gcc.target/powerpc/dfp/dfp.exp: Likewise.

From-SVN: r274057
2019-08-04 09:49:27 +00:00
Iain Sandoe 92e0a5ca82 Darwin, ppc, backport testsuite fix for pr87600.
This test fails because it was expecting __powerpc__ to be
defined, where Darwin defines __POWERPC__.

2019-08-04  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-15  Iain Sandoe  <iain@sandoe.co.uk>
	* gcc.dg/pr87600.h: Add __POWERPC__ as an alternate test
	for PowerPC platforms.

From-SVN: r274056
2019-08-04 09:39:02 +00:00
GCC Administrator 656e41a545 Daily bump.
From-SVN: r274053
2019-08-04 00:16:12 +00:00
Iain Sandoe 8750956c7d Objective-C, backport fix for recognition of instancetype.
This addresses a number of test fails that occur for the
NeXT runtime.

gcc/objc/
2019-08-03  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-18  Iain Sandoe  <iain@sandoe.co.uk>

	* objc/objc-act.h (OCTI_INSTANCE_TYPE, OCTI_INSTANCETYPE_NAME): New.
	(objc_global_trees): Add instance type and name.
	(INSTANCE_TYPEDEF_NAME): New.
	* objc/objc-act.c (synth_module_prologue): Build decls for
	objc_instancetype_type and objc_instancetype_name.

gcc/testsuite/
2019-08-03  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-18  Iain Sandoe  <iain@sandoe.co.uk>

	* objc.dg/instancetype-0.m: New.

From-SVN: r274050
2019-08-03 20:21:44 +00:00
Iain Sandoe 72f36fffb4 Darwin, backport fix for PR87030
273746 , 273749, 273768 [Darwin] Fix PR87030 and tidy config fragments.

This is about 32/64b host and multilib support across the range of Darwin
systems.

Prior to Darwin8 (OS X 10.4), the toolchains support only PowerPC and only 32b.

On Darwin8 it is possible to target a 64b multilib, but with support limited
to a few of the main libraries on the system (not a recommended configuration).

From Darwin9 to Darwin17 (OSX 10.5 to 10.13) it is possible to have either
32 or 64b hosted toolchains, with support for a 64 or 32b multilib respectively.

On Darwin9 the kernel is 32b, but with support for 64b executables, so it's
conventional to build a 32b host toolchain supporting a 64b multilib. However
this is not enforced (merely a convention).

There is also some platform hardware supporting Darwin10/11 which is only 32b
and for which the same situation applies. However, from Darwin10 to Darwin17,
the majority of platform hardware supports a 64b kernel and it's conventional
to build a 64b host toolchain with support for a 32b multilib.

On/from Darwin18 (OS X 10.14), the development headers (in the SDK) no longer
expose the interfaces for the 32b multilib support (although sufficient runtime
support remains installed that the testsuite can be run for a 32b multilib).

The PR is raised against this latter situation since the absence of exposed
interfaces causes a 'default' bootstrap fail regardless of the availability of
the runtimes. Given the number of permutations, I felt it warranted a general
solution, especially since the current scheme of target headers and t-make
fragments has become somewhat messy.

The changes here enforce the single 32b PowerPC multilib for Darwin < 8 and the
single X86 64b multilib for Darwin >= 18. This means that there is no longer
any need to configure Darwin18+ '--disable-multilib', but also that if you want
to use the ability to continue to test the compiler's 32b multilib there, you
need to make a configuration targeting an earlier OS version (and using the
SDK from that).

2019-08-03  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-07-24  Iain Sandoe  <iain@sandoe.co.uk>

	PR bootstrap/87030
	* config/i386/darwin.h (REAL_LIBGCC_SPEC): Revert change from r273749.

	PR bootstrap/87030
	* config/i386/darwin.h (REAL_LIBGCC_SPEC): Move from here...
	* config/i386/darwin32-biarch.h .. to here.
	* config/i386/darwin64-biarch.h: Adjust comments.
	* config/rs6000/darwin32-biarch.h: Likewise.
	* config/rs6000/darwin64-biarch.h: Likewise.
	* config.gcc: Missed commit from r273746
	(*-*-darwin*): Don't include CPU t-darwin here.
	(i[34567]86-*-darwin*): Adjust to use biarch files. Produce
	an error message if i686-darwin configuration is attempted for
	Darwin >= 18.

	Backport from mainline
	2019-07-23  Iain Sandoe  <iain@sandoe.co.uk>

	PR bootstrap/87030
	* config.gcc (*-*-darwin*): Don't include CPU t-darwin here.
	(i[34567]86-*-darwin*): Adjust to use biarch files. Produce
	an error message if i686-darwin configuration is attempted for
	Darwin >= 18.
	(x86_64-*-darwin*): Switch to single multilib for Darwin >= 18.
	(powerpc-*-darwin*): Use biarch files where needed.
	(powerpc64-*-darwin*): Likewise.
	* config/i386/darwin.h (REAL_LIBGCC_SPEC): Move to new biarch file.
	(DARWIN_ARCH_SPEC, DARWIN_SUBARCH_SPEC): Revise for default single
	arch case.
	* config/i386/darwin32-biarch.h: New.
	* config/i386/darwin64.h: Rename.
	* gcc/config/i386/darwin64-biarch.h: To this.
	* config/i386/t-darwin: Rename.
	* gcc/config/i386/t-darwin32-biarch: To this.
	* config/i386/t-darwin64: Rename.
	* gcc/config/i386/t-darwin64-biarch: To this.
	* config/rs6000/darwin32-biarch.h: New.
	* config/rs6000/darwin64.h: Rename.
	* config/rs6000/darwin64-biarch.h: To this.
	(DARWIN_ARCH_SPEC, DARWIN_SUBARCH_SPEC): Revise for default single
	arch case.
	* config/rs6000/t-darwin8: Rename.
	* config/rs6000/t-darwin32-biarch: To this.
	* config/rs6000/t-darwin64 Rename.
	* config/rs6000/t-darwin64-biarch: To this.

From-SVN: r274049
2019-08-03 20:16:22 +00:00
Iain Sandoe bd9a0dce18 Darwin, backport codegen fix.
Darwin only supports "static" code in the kernel and
kernel extensions.  This check tries to prevent the case
that cascaded PIC/PIE options on the command line cause
non-pic to be selected.

2019-08-03  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-07-07  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (darwin_override_options): Make a final check on PIC
	options.

From-SVN: r274048
2019-08-03 20:05:21 +00:00
Iain Sandoe 8e28d02d02 Darwin, backport kext codegen fix.
It's not correct for all current Darwin versions to jam
symbol stubs on for kexts.

2019-08-03  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-07-07  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (darwin_override_options): Don't jam symbol stubs
	on for kernel code.

From-SVN: r274047
2019-08-03 19:58:33 +00:00
Iain Sandoe b2ba0fd304 Darwin, ppc, Fix test fails that depend on installed headers.
Several port tests use headers that Darwin has not been
installing.  This removes the override on the header install
thus making Darwin's set match the reset of the port.

2019-08-03  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-06-28  Iain Sandoe  <iain@sandoe.co.uk>

	* config.gcc (powerpc-*-darwin*, powerpc64-*-darwin*): Remove
	override on extra_headers.

From-SVN: r274046
2019-08-03 19:53:51 +00:00
Iain Sandoe a6e4cd6106 Darwin, ppc, backport fix for codegen in kexts.
This honours the users choice of float ABI in kexts.

2019-08-03  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-06-27  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/rs6000.c (darwin_rs6000_override_options): Honour
	user-specified float mode choice for kernel mode code.

From-SVN: r274045
2019-08-03 19:49:43 +00:00
Iain Sandoe 9964a11fd3 Darwin, ppc, backport wrong code fix.
We should never have been using longcalls by default in
64b code.

2019-08-03  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-06-27  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/rs6000.c (darwin_rs6000_override_options): Do not
	use longcall for 64b code.

From-SVN: r274044
2019-08-03 19:44:13 +00:00
Iain Sandoe 9535e8591c Darwin, ppc, backport build fix for unwinder.
When libgcc is built on Darwin, it is usually built for the earliest potential
target (Darwin8, 10.4). Build for that revision default to assuming that the
processor might be G3 (without vector ops) and there is an outlined function
used for save/restore that checks whether the processor is G3 or G4+ at run-
time. However, the unwinder itself needs to be built with the assumption of
vector usage so that the relevant outlined functions are called.

2019-08-03  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-06  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/t-darwin: Ensure that the unwinder is built with
	altivec enabled.

From-SVN: r274043
2019-08-03 19:36:37 +00:00
Iain Sandoe 95c96b8a25 Darwin, ppc, backport test fixes.
Several tests expect support for the GCC target pragma.
Act on this for compatibility with the port.

2019-08-03  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-06-23  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/darwin.h: Handle GCC target pragma.

From-SVN: r274042
2019-08-03 19:32:18 +00:00
Iain Sandoe 3e12a88316 Darwin, ppc, backport test fixes.
Some tests expect upper case versions of the ppc/ppc64
macros, so bring Darwin into line with other port
members.

2019-08-03  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-06-23  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/darwin.h: (__PPC__, __PPC64__): New.

From-SVN: r274041
2019-08-03 19:25:05 +00:00
Iain Sandoe 7146dba1ff Darwin, fixincludes - backport fixes Darwin9/10 math.h issues.
Darwin has had long long functions for some considerable time and these are
exposed in Darwin8 and Darwin11+ headers. However, for some reason it was
elected to hide them behind __STRICT_ANSI__ and __STDC_VERSION__ on Darwin9
and Darwin10. This is a problem for G++/libstdc++ that expects the functions
to be available for strict ansi (-std=c++14, for example) and without
defining __STDC_VERSION__. The fix here follows the pattern used in
Darwin11+ headers where the functions may be explicitly hidden by defining
__DARWIN_NO_LONG_LONG.

This fixes the tr1 testsuite fails seen on Darwin9 and 10.

2019-08-03  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-21  Iain Sandoe  <iain@sandoe.co.uk>

	* inclhack.def: Replace the complex test using __STRICT_ANSI__ and
	__STDC_VERSION__ with a test using __DARWIN_NO_LONG_LONG.
	Ensure that the top level math.h uses <> to wrap included headers
	rather than "".
	* fixincl.x: Regenerated.
	* tests/base/architecture/ppc/math.h: Update test to include the
	__DARWIN_NO_LONG_LONG case.

From-SVN: r274040
2019-08-03 19:21:08 +00:00
Iain Sandoe 5d2930ea7a Darwin, fixincludes - backport build fixes.
There are two issues with the Darwin14 (SDK) headers in which unguarded
advanced syntax elements causes any code including these headers to fail.

2019-08-03  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-06-21  Iain Sandoe  <iain@sandoe.co.uk>

	* inclhack.def: Guard __has_attribute and __has_extension in
	os/base.h.
	Guard Apple blocks syntax in dispatch/object.h.
	* fixincl.x: Regenerate.
	* tests/base/dispatch/object.h: New file.
	* tests/base/os/base.h: New file.

From-SVN: r274039
2019-08-03 19:11:05 +00:00
GCC Administrator ad27bccddd Daily bump.
From-SVN: r274036
2019-08-03 00:16:19 +00:00
Martin Sebor 6952bd1177 backport: PR c/90737 - [8/9/10 Regression] inconsistent address of a local converted to intptr_t between callee and caller
Backport from mainline

PR c/90737 - [8/9/10 Regression] inconsistent address of a local converted to intptr_t between callee and caller

gcc/c/ChangeLog:

	PR c/90737
	* c-typeck.c (c_finish_return): Only consider functions returning
	pointers as candidates for -Wreturn-local-addr.

gcc/cp/ChangeLog:

	PR c/90737
	* typeck.c (maybe_warn_about_returning_address_of_local): Only
	consider functions returning pointers as candidates for
	-Wreturn-local-addr.

gcc/testsuite/ChangeLog:

	PR c/90737
	* c-c++-common/Wreturn-local-addr.c: New test.
	* g++.dg/warn/Wreturn-local-addr-6.C: New test.

From-SVN: r274022
2019-08-02 11:05:34 -06:00
Martin Sebor 6575dd2408 backport: PR tree-optimization/90989 - incorrrect strlen result after second strcpy
Backport from mainline

PR tree-optimization/90989 - incorrrect strlen result after second strcpy
	into the same destination

gcc/ChangeLog:

	PR tree-optimization/90989
	* tree-ssa-strlen.c (handle_char_store): Constrain a single character
	optimization to just single character stores.

gcc/testsuite/ChangeLog:

	PR tree-optimization/90989
	* gcc.dg/strlenopt-26.c: Exit with test result status.
	* gcc.dg/strlenopt-67.c: New test.

From-SVN: r274021
2019-08-02 10:57:19 -06:00
Iain Sandoe bcb176f838 darwin, backport driver fixes.
272260,r272479 - Darwin, Driver - Improve processing of macosx-version-min=

For PR target/63810 some improvements were made in the parsing of
the version string at the point it's used to define the built-in
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__. This is fine, but the
specs processing also uses the version, and specs version-compare
doesn't like leading zeros on components. This means that while we
succeed in processing -mmacosx-version-min=010.00002.000099 on compile
lines, it fails for any other line that uses the value as part of a spec
(in particular, link lines fail).

To fix this, we need to apply a bit of clean-up to the version that's
presented to the driver, and push that back into the command line opts.

The value can come from four places:
1. User-entered on the command line
2. User-entered as MACOSX_DEPLOYMENT_TARGET= environment var.
3. Absent those two
3a For self-hosting systems, look-up from the kernel
3b For cross-compilers, as a default supplied at configure time.

We apply the clean-up to all 4 (although it shouldn't really be needed
for the cases under 3).

We also supply a test-case that adapts to the target-version of the
system, so that the link requirements are met by the SDK in use (if you
try to link i686-darwin9 on an x86-64-darwin18 SDK, it will fail).

gcc/

2019-08-02  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-06-19  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin-driver.c (darwin_driver_init): Fix off-by-one errors
	in computing the number of options to be moved.

	Backport from mainline
	2019-06-13  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin-driver.c (validate_macosx_version_min): New.
	(darwin_default_min_version): Cleanup and validate supplied version.
	(darwin_driver_init): Likewise and push cleaned version into opts.

gcc/testsuite/

2019-08-02  Iain Sandoe  <iain@sandoe.co.uk>

	2019-06-13  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.dg/darwin-minversion-link.c: New test.

From-SVN: r274017
2019-08-02 14:54:57 +00:00
Iain Sandoe 926c0c8fb8 darwin, x86, backport fix for missing .p2align.
This fixes a number of testcases that expect use of
.p2align, which was omitted from the darwin X86 port
(but is available in all assemblers used with that).

2019-08-02  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-05-31  Iain Sandoe  <iain@sandoe.co.uk>

	* config/i386/darwin.h (ASM_OUTPUT_MAX_SKIP_ALIGN): New.

From-SVN: r274016
2019-08-02 14:44:23 +00:00
Iain Sandoe 679c6492d1 darwin, objc, backport fix for objc header paths
Don't try to prepend a sysroot for the gnu-objc headers, which
are compiler-relative.

Darwin is able to use two runtimes for objective-c; the
default is its native "NeXT" runtime, but also it can build
code using the "gnu-runtime". In order to do this, we have to
be able to find the gnu-runtime headers (which are installed
into the compiler's tree).

The process to do this is erroneously prepending the sysroot
to this when a sysroot is in force. The gnu-runtime headers have
never been installed in a Darwin (macOS) SDK so we must make
sure that they are found local to the compiler.

gcc/

2019-08-02  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-05-18  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin-c.c (darwin_register_objc_includes): Do not
	prepend the sysroot when building gnu-runtime header search
	paths.

From-SVN: r274015
2019-08-02 14:34:02 +00:00
Iain Sandoe 22105fb28b darwin, backport fix for objc section switches.
gcc/

2019-08-02  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline
	2019-05-18  Iain Sandoe  <iain@sandoe.co.uk>

	* config/darwin.c (darwin_file_end): Use switch_to_section ()
	instead of direct output of the asm.

From-SVN: r274014
2019-08-02 14:25:04 +00:00
Iain Sandoe b5fbe4b03b Darwin, ppc, backport build fix.
libgcc/

2019-08-02  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-12  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/darwin-vecsave.S: Set .machine appropriately.

From-SVN: r274013
2019-08-02 14:19:42 +00:00
Marek Polacek 361be3ccb9 PR c++/91230 - wrong error with __PRETTY_FUNCTION__ and generic lambda.
* pt.c (value_dependent_expression_p): Consider __PRETTY_FUNCTION__
	inside a template function value-dependent.

	* g++.dg/cpp1y/lambda-generic-pretty1.C: New test.

From-SVN: r274010
2019-08-02 13:29:05 +00:00
Richard Biener baefa04d76 backport: re PR tree-optimization/91280 (ICE in get_constraint_for_component_ref, at tree-ssa-structalias.c:3259 since r260354)
2019-08-02  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-07-31  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91280
	* tree-ssa-structalias.c (get_constraint_for_component_ref):
	Decompose MEM_REF manually for offset handling.

	* g++.dg/torture/pr91280.C: New testcase.

	2019-07-31  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91293
	* tree-vect-slp.c (vect_build_slp_tree_2): Do not swap operands
	of reduction stmts.

	* gcc.dg/vect/pr91293-1.c: New testcase.
	* gcc.dg/vect/pr91293-2.c: Likewise.
	* gcc.dg/vect/pr91293-3.c: Likewise.

From-SVN: r274007
2019-08-02 12:07:33 +00:00
Richard Biener 9d72c9e1bc backport: [multiple changes]
2019-08-02  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-07-31  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91178
	* tree-ssa-sccvn.c (vn_reference_maybe_forwprop_address):
	Use tail-recursion.

	* gcc.dg/torture/pr91178-2.c: New testcase.

	2019-07-17  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91178
	* tree-ssa.c (release_defs_bitset): Iterate from higher to
	lower SSA names to avoid quadratic behavior in the common case.
	* tree-data-ref.c (split_constant_offset): Add limit argument
	and pass it down.  Initialize it from PARAM_SSA_NAME_DEF_CHAIN_LIMIT.
	(split_constant_offset_1): Add limit argument and use it to
	limit SSA def walking.  Optimize the common plus/minus case.

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

	2019-07-12  Martin Sebor  <msebor@redhat.com>

	* doc/invoke.texi (ssa-name-def-chain-limit): Document new --param.
	* params.def (PARAM_SSA_NAME_DEF_CHAIN_LIMIT): Add new --param.
	* tree-vrp.c (vrp_prop::check_mem_ref): Use
	PARAM_SSA_NAME_DEF_CHAIN_LIMIT.

	* gcc.dg/Warray-bounds-43.c: New test.

From-SVN: r274000
2019-08-02 08:40:34 +00:00
GCC Administrator a2e06b0d99 Daily bump.
From-SVN: r273992
2019-08-02 00:16:11 +00:00
Jakub Jelinek 361e71bf2d backport: re PR c/91192 (non-deterministic ICE on invalid)
Backported from mainline
	2019-07-31  Jakub Jelinek  <jakub@redhat.com>

	PR c/91192
	* c-parser.c (c_parser_sizeof_expression): Call set_c_expr_source_range
	even if finish is UNKNOWN_LOCATION, just use start as finish in that
	case.

From-SVN: r273967
2019-08-01 08:31:54 +02:00
Jakub Jelinek 4d2186971e backport: re PR middle-end/91301 (ICE in omp_add_variable on random access iterator distribute parallel for private (iterator))
Backported from mainline
	2019-07-31  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/91301
	* gimplify.c (gimplify_omp_for): If for class iterator on
	distribute parallel for there is no data sharing clause
	on inner_for_stmt, look for private clause on combined
	parallel too and if found, move it to inner_for_stmt.

	* testsuite/libgomp.c++/for-27.C: New test.

From-SVN: r273966
2019-08-01 08:31:20 +02:00
Jakub Jelinek 82565b4ed7 backport: re PR middle-end/91216 (OpenMP ICE starting with r265930)
Backported from mainline
	2019-07-30  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/91216
	* omp-low.c (global_nonaddressable_vars): New variable.
	(use_pointer_for_field): For global decls, if they are non-addressable,
	remember it in the global_nonaddressable_vars bitmap, if they are
	addressable and in the global_nonaddressable_vars bitmap, ignore their
	TREE_ADDRESSABLE bit.
	(omp_copy_decl_2): Clear TREE_ADDRESSABLE also on private copies of
	vars in global_nonaddressable_vars bitmap.
	(execute_lower_omp): Free global_nonaddressable_vars bitmap.

	* gcc.dg/gomp/pr91216.c: New test.

From-SVN: r273965
2019-08-01 08:30:26 +02:00
Jakub Jelinek 1c0ee8716d backport: re PR target/91150 (wrong code with -O -mavx512vbmi due to wrong writemask)
Backported from mainline
	2019-07-30  Jakub Jelinek  <jakub@redhat.com>

	PR target/91150
	* config/i386/i386.c (expand_vec_perm_blend): Change mask type
	from unsigned to unsigned HOST_WIDE_INT.  For E_V64QImode cast
	comparison to unsigned HOST_WIDE_INT before shifting it left.

	* gcc.target/i386/avx512bw-pr91150.c: New test.

From-SVN: r273964
2019-08-01 08:29:22 +02:00
Jakub Jelinek c327c178f0 backport: re PR tree-optimization/91157 (ICE: verify_gimple failed (error: position plus size exceeds size of referenced object in 'bit_field_ref'))
Backported from mainline
	2019-07-17  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/91157
	* tree-vect-generic.c (expand_vector_comparison): Handle lhs being
	a vector boolean with scalar mode.
	(expand_vector_condition): Handle first operand being a vector boolean
	with scalar mode.
	(expand_vector_operations_1): For comparisons, don't bail out early
	if the return type is vector boolean with scalar mode, but comparison
	operand type is not.

	* gcc.target/i386/avx512f-pr91157.c: New test.
	* gcc.target/i386/avx512bw-pr91157.c: New test.

From-SVN: r273963
2019-08-01 08:28:19 +02:00
Alan Modra d35a5e7259 [RS6000] PR91135, __linux__ not defined with -mcall-aixdesc on 9.x and ppc64
This patch makes the obvious fix for PR91135, and deletes extraneous
copies of GNU_USER_TARGET_D_OS_VERSIONS that appear in rs6000/linux.h
and rs6000/linux64.h.  Since all configurations using either of these
files also include linux.h there is no need to duplicate the macro.

	PR target/91135
	* config/rs6000/linux.h (GNU_USER_TARGET_D_OS_VERSIONS): Don't
	define.
	* config/rs6000/linux64.h (TARGET_OS_CPP_BUILTINS): Invoke
	GNU_USER_TARGET_OS_CPP_BUILTINS for aixdesc abi.
	(GNU_USER_TARGET_D_OS_VERSIONS): Don't define.

From-SVN: r273962
2019-08-01 15:27:12 +09:30
GCC Administrator 9e361dc6c1 Daily bump.
From-SVN: r273959
2019-08-01 00:16:14 +00:00
Jonathan Wakely b9d801662e Use standard <float.h> macros in test
The <float.h> changes to define these for C++ have been backported, so
the test can use them now.

	* testsuite/26_numerics/midpoint/floating.cc: Use standard macros
	instead of GCC-specific ones.

From-SVN: r273950
2019-07-31 20:56:19 +01:00
Jonathan Wakely 20ac9d2b38 Define C11 macros such as FLT_DECIMAL_DIG for C++17
Backport from mainline
2019-06-24  Jonathan Wakely  <jwakely@redhat.com>

	* ginclude/float.h (FLT_DECIMAL_DIG, DBL_DECIMAL_DIG, LDBL_DECIMAL_DIG)
	(FLT_HAS_SUBNORM, DBL_HAS_SUBNORM, LDBL_HAS_SUBNORM, FLT_TRUE_MIN)
	(DBL_TRUE_MIN, LDBL_TRUE_MIN): Also define for C++17.

Backport from mainline
2019-06-24  Jonathan Wakely  <jwakely@redhat.com>

	* testsuite/18_support/headers/cfloat/values_c++17.cc: New test.

From-SVN: r273949
2019-07-31 20:56:16 +01:00
Jonathan Wakely 061151b45b Qualify call to prevent ADL
Backport from mainline
2019-07-31  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/memory (make_obj_using_allocator): Qualify call to
	uses_allocator_construction_args.

From-SVN: r273948
2019-07-31 20:56:12 +01:00
Jonathan Wakely 0793403db3 PR libstdc++/91308 fix constraints on unique_ptr assignment
Backport from mainline
2019-07-31  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/91308
	* include/bits/unique_ptr.h (unique_ptr::__safe_conversion_up): Remove
	constraints on deleter that should only apply to the constructor.
	(unique_ptr<T[], D>::__safe_conversion_up): Likewise.
	(unique_ptr<T[], D>::unique_ptr(unique_ptr<U, D>&&)): Restore
	constraints on deleter here.
	* testsuite/20_util/unique_ptr/assign/91308.cc: New test.

From-SVN: r273947
2019-07-31 20:56:08 +01:00
Jonathan Wakely 9acd8777c4 PR libstdc++/51333 Define recursive_init_error constructor non-inline
The recursive_init_error class is defined in a header, with an inline
constructor, but the definition of the vtable and destructor are not
exported from the shared library. With -fkeep-inline-functions the
constructor gets emitted in user code, and requires the (non-exported)
vtable. This fails to link.

As far as I can tell, the recursive_init_error class definition was
moved into <cxxabi.h> so it could be documented with Doxygen, not for
any technical reason. But now it's there (and documented), somebody
could be relying on it, by catching that type and possibly performing
derived-to-base conversions to the std::exception base class. So the
conservative fix is to leave the class definition in the header but make
the constructor non-inline. This still allows the type to be caught and
still defines its base class.

Backport from mainline
2019-07-29  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/51333
	* libsupc++/cxxabi.h (__gnu_cxx::recursive_init_error): Do not define
	constructor inline.
	* libsupc++/guard_error.cc (__gnu_cxx::recursive_init_error): Define
	constructor.
	* testsuite/18_support/51333.cc: New test.

From-SVN: r273946
2019-07-31 20:56:04 +01:00
Richard Biener 8153c366de Backport PRs 91126, 91131, 91145, 91162, 91200
2019-07-31  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-07-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91200
	* tree-ssa-phiopt.c (cond_store_replacement): Check we have
	no PHI nodes in middle-bb.

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

	2019-07-15  Richard Biener  <rguenther@suse.de>

	PR middle-end/91162
	* tree-cfg.c (move_block_to_fn): When releasing a virtual PHI
	node make sure to replace all uses with something valid.

	* gcc.dg/autopar/pr91162.c: New testcase.

	2019-07-12  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91145
	* tree-vect-slp.c (vect_build_slp_tree_2): Fix reduction
	chain check.

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

	2019-07-11  Richard Biener  <rguenther@suse.de>

	PR middle-end/91131
	* gimplify.c (gimplify_compound_literal_expr): Force a temporary
	when the object is volatile and we have not cleared it even though
	there are no nonzero elements.

	* gcc.target/i386/pr91131.c: New testcase.

	2019-07-10  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91126
	* tree-ssa-sccvn.c (n_walk_cb_data::push_partial_def): Adjust
	native encoding offset for BYTES_BIG_ENDIAN.
	(vn_reference_lookup_3): Likewise.

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

From-SVN: r273939
2019-07-31 15:40:36 +00:00
GCC Administrator a49eae070c Daily bump.
From-SVN: r273919
2019-07-31 00:16:19 +00:00
Steven G. Kargl de61fb689a re PR fortran/91296 (ICE when passing complex number %re/%im as a procedure argument with -Waliasing.)
2019-07-30  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91296
	* interface.c (compare_actual_expr): When checking for aliasing, add
	a case to handle REF_INQUIRY (e.g., foo(x%re, x%im) do not alias).

2019-07-30  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91296
	* gfortran.dg/pr91296.f90: New test.

From-SVN: r273916
2019-07-30 21:38:48 +00:00
Thomas KoenigandPaul Thomas 402b831544 backport: re PR fortran/90786 (ICE on procedure pointer assignment to function with class pointer result)
2019-07-29  Thomas Koenig  <tkoenig@gcc.gnu.org>
	Paul Thomas <pault@gcc.gnu.org>

	Backport from trunk
	PR fortran/90786
	PR fortran/90813
	* trans-expr.c (pointer_assignment_is_proc_pointer) Remove as
	it is very simple and only called from one place.
	(gfc_trans_pointer_assignment): Rename non_proc_pointer_assign
	as non_proc_ptr_assign. Assign to it directly, rather than call
	to above, deleted function and use gfc_expr_attr instead of
	only checking the reference chain.
	* dump-parse-tree.c (show_global_symbol): New function.
	(gfc_dump_global_symbols): New function.
	* gfortran.h (gfc_traverse_gsymbol): Add prototype.
	(gfc_dump_global_symbols): Likewise.
	* invoke.texi: Document -fdump-fortran-global.
	* lang.opt: Add -fdump-fortran-global.
	* parse.c (gfc_parse_file): Handle flag_dump_fortran_global.
	* symbol.c (gfc_traverse_gsymbol): New function.
	* trans-decl.c (sym_identifier): New function.
	(mangled_identifier): New function, doing most of the work
	of gfc_sym_mangled_identifier.
	(gfc_sym_mangled_identifier): Use mangled_identifier.  Add mangled
	identifier to global symbol table.
	(get_proc_pointer_decl): Use backend decl from global identifier
	if present.

2019-07-29  Thomas Koenig  <tkoenig@gcc.gnu.org>
	Paul Thomas <pault@gcc.gnu.org>

	Backport from trunk
	PR fortran/90786
	PR fortran/90813
	* gfortran.dg/proc_ptr_51.f90: New test.


Co-Authored-By: Paul Thomas <pault@gcc.gnu.org>

From-SVN: r273913
2019-07-30 19:11:03 +00:00
Jan Hubicka ea7e4625c4 backport: i386-common.c: Use PROCESSOR_ZNVER2 scheduler for znver2.
Backport from mainline
	2019-07-23  Jan Hubicka  <hubicka@ucw.cz>

	* i386-common.c: Use PROCESSOR_ZNVER2 scheduler for znver2.
	* config/i386/znver1.md: Enable patterns for znver2 and add store
	variants which use extra AGU unit.

From-SVN: r273904
2019-07-30 09:28:13 +00:00
Jan Hubicka c2db11bbb9 backport: i386.c (ix86_option_override_internal): Default PARAM_AVOID_FMA_MAX_BITS to 256 for znver2.
Backport from mainline
	2019-07-23  Jan Hubicka  <hubicka@ucw.cz>

	* config/i386/i386.c (ix86_option_override_internal): Default
	PARAM_AVOID_FMA_MAX_BITS to 256 for znver2.
	* config/i386/x86-tune.def (X86_TUNE_AVOID_256FMA_CHAINS): Set
	for ZNVER2.

From-SVN: r273901
2019-07-30 08:10:22 +00:00
Jan Hubicka 53e62cf48e backport: x86-tune-costs.h (znver2_memcpy): Update.
Backport from mainline
	2019-07-23  Jan Hubicka  <hubicka@ucw.cz>

	* config/i386/x86-tune-costs.h (znver2_memcpy): Update.
	(znver2_costs): Update 256 bit SSE costs and multiplication.

From-SVN: r273900
2019-07-30 08:03:43 +00:00
GCC Administrator dfbc2b3667 Daily bump.
From-SVN: r273895
2019-07-30 00:16:12 +00:00
GCC Administrator 79badaf403 Daily bump.
From-SVN: r273863
2019-07-29 00:16:16 +00:00
GCC Administrator 33d2e30038 Daily bump.
From-SVN: r273849
2019-07-28 00:16:55 +00:00
GCC Administrator 9d54b28366 Daily bump.
From-SVN: r273842
2019-07-27 00:16:28 +00:00
Jonathan Wakely 996a7c88b4 Define __cpp_lib_endian feature test macro
This macro was added as part of moving std::endian from <type_traits> to
<bit>.

Backport from mainline
2019-07-26  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/bit (__cpp_lib_endian): Define.
	* include/std/version (__cpp_lib_endian): Define.
	* testsuite/26_numerics/endian/2.cc: New.
	* testsuite/26_numerics/endian/3.cc: New.
	* testsuite/26_numerics/endian/4.cc: New.

From-SVN: r273838
2019-07-26 14:37:00 +01:00
Jonathan Wakely cdcfcb733b Relocate std::endian from <type_traits> to <bit>
This change to an early C++2a feature was just approved (P1612R1).

Backport from mainline
2019-07-25  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/bit (endian): Move definition here as per P1612R1.
	* include/std/type_traits (endian): Remove definition from here.
	* testsuite/20_util/endian/1.cc: Rename to ...
	* testsuite/26_numerics/endian/1.cc: ... here. Adjust header.

From-SVN: r273837
2019-07-26 14:36:56 +01:00
Jonathan Wakely 90889960ba Adjust std::rotl, std::rotr etc to match final P0553R4 proposal
This proposal has now been accepted for C++20, with a few changes. This
patch adjusts std::rotl and std::rotr to match the final specification
and declares the additions for C++2a mode even when __STRICT_ANSI__ is
defined.

Backport from mainline
2019-07-22  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/bit (__rotl, __rotr): Change second parameter from
	unsigned int to int and handle negative values.
	(rotl, rotr): Remove check for __STRICT_ANSI__. Change second
	parameter from unsigned int to int. Add nodiscard attribute.
	* testsuite/26_numerics/bit/bitops.rot/rotl.cc: Rename to ...
	* testsuite/26_numerics/bit/bit.rotate/rotl.cc: Here. Test negative
	shifts.
	* testsuite/26_numerics/bit/bitops.rot/rotr.cc: Rename to ...
	* testsuite/26_numerics/bit/bit.rotate/rotr.cc: Here. Test negative
	shifts.

From-SVN: r273836
2019-07-26 14:36:52 +01:00
Jonathan Wakely e72c873ac0 Change std::ceil2 to be undefined if the result can't be represented
Backport from mainline
2019-07-22  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/bit (__ceil2): Make unrepresentable results undefined,
	as per P1355R2. Add debug assertion. Perform one left shift, not two,
	so that out of range values cause undefined behaviour. Ensure that
	shift will still be undefined if left operand is promoted.
	* testsuite/26_numerics/bit/bit.pow.two/ceil2.cc: Replace checks for
	unrepresentable values with checks that they are not core constant
	expressions.
	* testsuite/26_numerics/bit/bit.pow.two/ceil2_neg.cc: New test.

From-SVN: r273835
2019-07-26 14:36:47 +01:00
Jonathan Wakely 4f3334246c Remove std::byte overloads from <bit>
The additional overloads for std::byte in <bit> were reviewed by LEWG
and considered undesirable, so this patch removes them.

Backport from mainline (partial)
2019-06-26  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/bit (rotl(byte, unsigned), rotr(byte, unsigned))
	(countl_zero(byte), countl_one(byte), countr_zero(byte))
	(countr_one(byte), popcount(byte), ispow2(byte), ceil2(byte))
	(floor2(byte), log2p1(byte)): Remove.
	* testsuite/26_numerics/bit/bit.pow.two/ceil2.cc: Remove test for
	std::byte overload.
	* testsuite/26_numerics/bit/bit.pow.two/floor2.cc: Likewise.
	* testsuite/26_numerics/bit/bit.pow.two/ispow2.cc: Likewise.
	* testsuite/26_numerics/bit/bit.pow.two/log2p1.cc: Likewise.
	* testsuite/26_numerics/bit/bitops.count/countl_one.cc: Likewise.
	* testsuite/26_numerics/bit/bitops.count/countl_zero.cc: Likewise.
	* testsuite/26_numerics/bit/bitops.count/countr_one.cc: Likewise.
	* testsuite/26_numerics/bit/bitops.count/countr_zero.cc: Likewise.
	* testsuite/26_numerics/bit/bitops.count/popcount.cc: Likewise.
	* testsuite/26_numerics/bit/bitops.rot/rotl.cc: Likewise.
	* testsuite/26_numerics/bit/bitops.rot/rotr.cc: Likewise.

From-SVN: r273834
2019-07-26 14:36:44 +01:00
Jonathan Wakely 2f1b34f9ff Add parens around constraint in <memory>.
C++20 concepts require parens around atomic constraints that are not
primary-expressions.

Backport from mainline
2019-07-16  Jason Merrill  <jason@redhat.com>

	* include/std/memory (uses_allocator_construction_args): Add parens
	around constraint.

From-SVN: r273833
2019-07-26 14:36:39 +01:00
Jonathan Wakely 02a1cdae58 Fix preprocessor checks for Clang builtins
Clang seems to define built-ins that start with "__builtin_" as
non-keywords, which means that we need to use __has_builtin to detect
them, not __is_identifier. The built-ins that don't start with
"__builtin_" are keywords, and can only be detected using
__is_identifier and not by __has_builtin.

Backport from mainline
2019-07-02  Jonathan Wakely  <jwakely@redhat.com>

	* include/bits/c++config (_GLIBCXX_HAVE_BUILTIN_LAUNDER)
	(_GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED): Use __has_builtin
	instead of __is_identifier to detect Clang support.

From-SVN: r273832
2019-07-26 14:36:36 +01:00
Jonathan Wakely 8852f119e4 Add missing feature test macro to C++17 status table
Backport from mainline
2019-05-23  Jonathan Wakely  <jwakely@redhat.com>

	* doc/xml/manual/status_cxx2017.xml: Add feature test macro for
	P0040R3.
	* doc/html/*: Regenerate.

From-SVN: r273831
2019-07-26 14:36:33 +01:00
Jonathan Wakely 7353cd4248 Fix outdated reference to C++17 draft in the docs
Backport from mainline
2019-06-20  Jonathan Wakely  <jwakely@redhat.com>

	* doc/xml/manual/status_cxx2017.xml: Fix outdated reference to
	C++17 working draft.

From-SVN: r273830
2019-07-26 14:36:29 +01:00
Jonathan Wakely 7b9f874f9a Fix std::midpoint for denormal values
Backport from mainline
2019-06-25  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/numeric (midpoint(T, T)): Avoid std::abs in constexpr
	function.

Backport from mainline
2019-06-24  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/numeric (midpoint(T, T)): Change implementation for
	floating-point types to avoid incorrect rounding of denormals.
	* testsuite/26_numerics/midpoint/floating.cc: Add check for correct
	rounding with denormals.
	* testsuite/26_numerics/gcd/gcd_neg.cc: Adjust dg-error line numbers.
	* testsuite/26_numerics/lcm/lcm_neg.cc: Likewise.

From-SVN: r273829
2019-07-26 14:36:25 +01:00
GCC Administrator 29978f368d Daily bump.
From-SVN: r273822
2019-07-26 00:16:21 +00:00
Richard Biener daa31aea30 re PR plugins/90924 (lto-plugin/lto-plugin.c heap memory corruption due to insufficient sanitization.)
2019-07-25  Richard Biener  <rguenther@suse.de>

	PR lto/90924
	Backport from mainline
	2019-07-12  Ren Kimura  <rkx1209dev@gmail.com>

	* simple-object-elf.c (simple_object_elf_match): Check zero value
	shstrndx.

From-SVN: r273793
2019-07-25 10:46:54 +00:00
GCC Administrator e58ac8a6a2 Daily bump.
From-SVN: r273781
2019-07-25 00:16:21 +00:00
Bin Cheng cb181d837e Fixup ChangeLog entry for revision 273754.
From-SVN: r273755
2019-07-24 01:32:59 +00:00
Bin Cheng 568b00c671 backport: re PR tree-optimization/91137 (Wrong code with -O3)
Backport from mainline
        2019-07-18  Bin Cheng  <bin.linux@linux.alibaba.com>

        PR tree-optimization/91137
        * tree-ssa-loop-ivopts.c (struct ivopts_data): New field.
        (tree_ssa_iv_optimize_init, alloc_iv, tree_ssa_iv_optimize_finalize):
        Init, use and fini the above new field.
        (determine_base_object_1): New function.
        (determine_base_object): Reimplement using walk_tree.

gcc/testsuite
        2019-07-18  Bin Cheng  <bin.linux@linux.alibaba.com>

        PR tree-optimization/91137
        * gcc.c-torture/execute/pr91137.c: New test.

From-SVN: r273754
2019-07-24 01:28:33 +00:00
GCC Administrator 025df40e59 Daily bump.
From-SVN: r273752
2019-07-24 00:16:20 +00:00
Matthew Beliveau 01e83a1087 re PR rtl-optimization/91173 (ICE: in int_mode_for_mode, at stor-layout.c:403)
PR rtl-optimization/91173

	Backported from mainline
	2019-07-16  Jeff Law  <law@redhat.com>
	
	PR rtl-optimization/91173
	* tree-ssa-address.c (addr_for_mem_ref): If the base is an
	SSA_NAME with a constant value, fold its value into the offset
	and clear the base before calling gen_addr_rtx.
	* g++.dg/pr91173.C: New test.

From-SVN: r273741
2019-07-23 15:56:22 +00:00
Richard Biener d312963104 re PR debug/91231 (ICE in dwarf2out_inline_entry, at dwarf2out.c:27642)
2019-07-23  Richard Biener  <rguenther@suse.de>

	PR debug/91231
	* lto-streamer-in.c (input_function): Drop inline-entry markers
	that ended up with an unknown location block.

From-SVN: r273734
2019-07-23 11:17:37 +00:00
Thomas Koenig 38a8ddce9b backport: re PR libfortran/91030 (Poor performance of I/O -fconvert=big-endian)
2019-07-23  Thomas König  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR libfortran/91030
	* gfortran.texi (GFORTRAN_FORMATTED_BUFFER_SIZE): Document.
	(GFORTRAN_UNFORMATTED_BUFFER_SIZE): Likewise.

2019-07-23  Thomas König  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR libfortran/91030
	* io/unix.c (BUFFER_SIZE): Delete.
	(BUFFER_FORMATTED_SIZE_DEFAULT): New variable.
	(BUFFER_UNFORMATTED_SIZE_DEFAULT): New variable.
	(unix_stream): Add buffer_size.
	(buf_read): Use s->buffer_size instead of BUFFER_SIZE.
	(buf_write): Likewise.
	(buf_init): Add argument unformatted.  Handle block sizes
	for unformatted vs. formatted, using defaults if provided.
	(fd_to_stream): Add argument unformatted in call to buf_init.
	* libgfortran.h (options_t): Add buffer_size_formatted and
	buffer_size_unformatted.
	* runtime/environ.c (variable_table): Add
	GFORTRAN_UNFORMATTED_BUFFER_SIZE and
	GFORTRAN_FORMATTED_BUFFER_SIZE.

From-SVN: r273727
2019-07-23 08:57:45 +00:00
GCC Administrator d63bda3433 Daily bump.
From-SVN: r273711
2019-07-23 00:16:25 +00:00
Paul A. Clarke a0cee637a0 [rs6000] Add _mm_blend_epi16 and _mm_blendv_epi8
Add compatibility implementations of _mm_blend_epi16 and _mm_blendv_epi8
intrinsics.

Respective test cases are copied almost verbatim (minor changes to
the dejagnu head lines) from i386.

2019-07-22  Paul A. Clarke  <pc@us.ibm.com>

[gcc]

	* config/rs6000/smmintrin.h (_mm_blend_epi16): New.
	(_mm_blendv_epi8): New.

[gcc/testsuite]

	* gcc.target/powerpc/sse4_1-check.h: New.
	* gcc.target/powerpc/sse4_1-pblendvb.c: New.
	* gcc.target/powerpc/sse4_1-pblendw.c: New.
	* gcc.target/powerpc/sse4_1-pblendw-2.c: New.

From-SVN: r273704
2019-07-22 16:32:37 +00:00
Martin Liska 883e30c4d9 Backport r273660
2019-07-22  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-07-22  Martin Liska  <mliska@suse.cz>

	PR driver/91172
	* opts-common.c (decode_cmdline_option): Decode
	argument of -Werror and check it for a wrong language.
	* opts-global.c (complain_wrong_lang): Remove such case.
2019-07-22  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-07-22  Martin Liska  <mliska@suse.cz>

	PR driver/91172
	* gcc.dg/pr91172.c: New test.

From-SVN: r273664
2019-07-22 09:37:18 +00:00
Claudiu Zissulescu b956e05c57 [ARC] Backport ix emitting TLS symbols.
From-SVN: r273658
2019-07-22 09:21:24 +02:00
GCC Administrator 79643baffe Daily bump.
From-SVN: r273655
2019-07-22 00:16:19 +00:00
GCC Administrator 8a7e07abf9 Daily bump.
From-SVN: r273639
2019-07-21 00:16:12 +00:00
Richard Sandiford 56544a47e0 Fix -Wreturn-type for static naked functions in C
This patch extends the fix for PR53633 to include static functions,
which were giving a bogus -Wreturn-type warning for C but not for C++.

2019-07-20  Richard Sandiford  <richard.sandiford@arm.com>

gcc/c/
	Backport from mainline
	2019-07-18  Richard Sandiford  <richard.sandiford@arm.com>

	PR c/53633
	* c-decl.c (finish_function): Check targetm.warn_func_return
	before issuing a -Wreturn-type warning.

gcc/testsuite/
	Backport from mainline
	2019-07-18  Richard Sandiford  <richard.sandiford@arm.com>

	* c-c++-common/pr53633-2.c: New test.

From-SVN: r273635
2019-07-20 18:50:20 +00:00
Richard Sandiford 76eeeaa4bb Fix folding of vector EQ/NE
For vector1 != vector2, we returned false if any elements were equal,
rather than if all elements were equal.

2019-07-20  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	Backport from mainline
	2019-07-10  Richard Sandiford  <richard.sandiford@arm.com>

	* fold-const.c (fold_relational_const): Fix folding of
	vector-to-scalar NE_EXPRs.
	(test_vector_folding): Add more tests.

From-SVN: r273634
2019-07-20 18:49:59 +00:00
GCC Administrator 9166fb6fa3 Daily bump.
From-SVN: r273614
2019-07-20 00:16:11 +00:00
Jason Merrill a0385e9b46 PR c++/90098 - partial specialization and class non-type parms.
A non-type template parameter of class type used in an expression has
const-qualified type; the pt.c hunks deal with this difference from the
unqualified type of the parameter declaration.  WAhen we use such a
parameter as an argument to another template, we don't want to confuse
things by copying it, we should pass it straight through.  And we might as
well skip copying other classes in constant evaluation context in a
template, too; we'll get the copy semantics at instantiation time.

	PR c++/90099
	PR c++/90101
	* call.c (build_converted_constant_expr_internal): Don't copy.
	* pt.c (process_partial_specialization): Allow VIEW_CONVERT_EXPR
	around class non-type parameter.
	(unify) [TEMPLATE_PARM_INDEX]: Ignore cv-quals.
	(invalid_nontype_parm_type_p): Check for dependent class type.

From-SVN: r273597
2019-07-19 04:53:07 -04:00
Jason Merrill 760811e5f5 PR c++/85552 - wrong instantiation of dtor for DMI.
* typeck2.c (digest_nsdmi_init): Set tf_no_cleanup for direct-init.

From-SVN: r273596
2019-07-19 04:52:58 -04:00
Nina Dinka Ranns 7a3f46d59e PR c++/63149 - wrong auto deduction from braced-init-list
2019-06-04  Nina Dinka Ranns  <dinka.ranns@gmail.com>

    gcc/cp/
    * pt.c (listify_autos): Use non cv qualified auto_node in
    std::initializer_list<auto>.

    testsuite/
    * g++.dg/cpp0x/initlist-deduce2.C: New test.

From-SVN: r273595
2019-07-19 04:52:50 -04:00
Jason Merrill 19aeedf7af PR c++/82081 - tail call optimization breaks noexcept
If a noexcept function calls a function that might throw, doing the tail
call optimization means that an exception thrown in the called function
will propagate out, breaking the noexcept specification.  So we need to
prevent the optimization in that case.

	* tree-tailcall.c (find_tail_calls): Don't turn a call from a
	nothrow function to a might-throw function into a tail call.

From-SVN: r273594
2019-07-19 04:52:41 -04:00
GCC Administrator 17c4ac32fb Daily bump.
From-SVN: r273589
2019-07-19 00:16:22 +00:00
Kito Cheng 7632aabc09 RISC-V: Fix splitter for 32-bit AND on 64-bit target.
Fixes github.com/riscv/riscv-gcc issue #161.  We were accidentally using
BITS_PER_WORD to compute shift counts when we should have been using the
bitsize of the operand modes.  This was wrong when we had an SImode shift
and a 64-bit target.

	Andrew Waterman  <andrew@sifive.com>
	gcc/
	* config/riscv/riscv.md (lshrsi3_zero_extend_3+1): Use operands[1]
	bitsize	instead of BITS_PER_WORD.
	gcc/testsuite/
	* gcc.target/riscv/shift-shift-2.c: Add one more test.

gcc/ChangeLog:
2019-07-18  Kito Cheng  <kito.cheng@sifive.com>

	Backport from mainline
	2019-07-08  Andrew Waterman  <andrew@sifive.com>
		    Jim Wilson  <jimw@sifive.com>

	* config/riscv/riscv.md (lshrsi3_zero_extend_3+1): Use operands[1]
	bitsize	instead of BITS_PER_WORD.
	gcc/testsuite/

gcc/testsuite/ChangeLog:
2019-07-18  Kito Cheng  <kito.cheng@sifive.com>

	Backport from mainline
	2019-07-08  Jim Wilson  <jimw@sifive.com>

	* gcc.target/riscv/shift-shift-2.c: Add one more test.

From-SVN: r273566
2019-07-18 07:00:32 +00:00
GCC Administrator 85a09b8dcb Daily bump.
From-SVN: r273561
2019-07-18 00:16:33 +00:00
John David Anglin cccbb4c6b0 pa.c (pa_som_asm_init_sections): Don't force all constant data into data section when generating PIC code.
* config/pa/pa.c (pa_som_asm_init_sections): Don't force all constant
	data into data section when generating PIC code.
	(pa_select_section): Use pa_reloc_rw_mask() to qualify relocs.
	(pa_reloc_rw_mask): Return 3 when generating PIC code and when
	generating code for SOM targets earlier than HP-UX 11.  Otherwise,
	return 2 for SOM and 0 for other targets.

From-SVN: r273558
2019-07-18 00:10:27 +00:00
Andreas Krebbel 9051978364 S/390: Fix vector shift count operand
We currently use subst definitions to handle the different variants of shift
count operands. Unfortunately, in the vector shift pattern the shift count
operand is used directly. Without it being adjusted for the 'subst' variants the
displacement value is omitted resulting in a wrong shift count being applied.

This patch needs to be applied to older branches as well.

gcc/ChangeLog:

2019-07-17  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2019-07-01  Andreas Krebbel  <krebbel@linux.ibm.com>

	* config/s390/vector.md: Fix shift count operand printing.

gcc/testsuite/ChangeLog:

2019-07-17  Andreas Krebbel  <krebbel@linux.ibm.com>

	Backport from mainline
	2019-07-01  Andreas Krebbel  <krebbel@linux.ibm.com>

	* gcc.target/s390/vector/vec-shift-2.c: New test.

From-SVN: r273546
2019-07-17 07:32:30 +00:00
GCC Administrator 486e0826b4 Daily bump.
From-SVN: r273540
2019-07-17 00:16:17 +00:00
Wilco Dijkstra 93750effc5 Fix alignment option parser (PR90684)
Fix the alignment option parser to always allow up to 4 alignments.
Now -falign-functions=16:8:8:8 no longer reports an error.

    gcc/
	PR driver/90684
	* gcc/opts.c (parse_and_check_align_values): Allow 4 alignment values.

From-SVN: r273533
2019-07-16 16:17:39 +00:00
Wilco Dijkstra 69f10e1a2c Add missing testcase for PR89190
testsuite/
	PR target/89190
	* gcc.target/arm/pr89190.c: New test.

From-SVN: r273525
2019-07-16 12:12:01 +00:00
Martin Liska f32b78d0bd Do not use -Werror in a test that has -frepo warning (PR testsuite/91175).
2019-07-16  Martin Liska  <mliska@suse.cz>

	PR testsuite/91175
	* g++.old-deja/g++.pt/instantiate4.C: Do not use -Werror.

From-SVN: r273521
2019-07-16 10:21:57 +00:00
GCC Administrator eecf5f680a Daily bump.
From-SVN: r273504
2019-07-16 00:16:44 +00:00
Martin Liska 1afd097373 Deprecate -frepo on gcc-9 branch (PR c++/91125).
2019-07-15  Martin Liska  <mliska@suse.cz>

	PR c++/91125
	* c-opts.c (c_common_handle_option): Warn the -frepo
	will be removed in the future.
2019-07-15  Martin Liska  <mliska@suse.cz>

	PR c++/91125
	* g++.dg/parse/repo1.C: Add scan for the new warning.
	* g++.dg/rtti/repo1.C: Likewise.
	* g++.dg/template/repo1.C: Likewise.
	* g++.dg/template/repo10.C: Likewise.
	* g++.dg/template/repo11.C: Likewise.
	* g++.dg/template/repo2.C: Likewise.
	* g++.dg/template/repo3.C: Likewise.
	* g++.dg/template/repo4.C: Likewise.
	* g++.dg/template/repo5.C: Likewise.
	* g++.dg/template/repo6.C: Likewise.
	* g++.dg/template/repo7.C: Likewise.
	* g++.dg/template/repo8.C: Likewise.
	* g++.dg/template/repo9.C: Likewise.
	* g++.old-deja/g++.pt/instantiate4.C: Likewise.
	* g++.old-deja/g++.pt/instantiate6.C: Likewise.
	* g++.old-deja/g++.pt/repo1.C: Likewise.
	* g++.old-deja/g++.pt/repo2.C: Likewise.
	* g++.old-deja/g++.pt/repo3.C: Likewise.
	* g++.old-deja/g++.pt/repo4.C: Likewise.

From-SVN: r273489
2019-07-15 04:11:43 +00:00
GCC Administrator 152c9293dc Daily bump.
From-SVN: r273487
2019-07-15 00:16:14 +00:00
Jakub Jelinek 02b466f44c backport: re PR c/91149 (GCC 9 and later incorrectly rejects OpenMP task reduction-modifier on target parallel combined construct)
Backported from mainline
	2019-07-13  Jakub Jelinek  <jakub@redhat.com>

	PR c/91149
	* c-omp.c (c_omp_split_clauses): Fix a pasto in
	OMP_CLAUSE_REDUCTION_TASK handling.

	* c-c++-common/gomp/reduction-task-3.c: New test.

From-SVN: r273478
2019-07-14 10:29:38 +02:00
Jakub Jelinek 803fcf21f4 backport: re PR middle-end/78884 ([7/8] ICE when gimplifying VLA in OpenMP SIMD region)
Backported from mainline
	2019-07-04  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/78884
	* gimplify.c (struct gimplify_omp_ctx): Add add_safelen1 member.
	(gimplify_bind_expr): If seeing TREE_ADDRESSABLE VLA inside of simd
	loop body, set ctx->add_safelen1 instead of making it GOVD_PRIVATE.
	(gimplify_adjust_omp_clauses): Add safelen (1) clause if
	ctx->add_safelen1 is set.

	* gcc.dg/gomp/pr78884.c: New test.

From-SVN: r273477
2019-07-14 10:28:06 +02:00
Jakub Jelinek 223d142ccb backport: re PR rtl-optimization/90756 (g++ ICE in convert_move, at expr.c:218 on i686 and s390x)
Backported from mainline
	2019-07-04  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/90756
	* explow.c (promote_ssa_mode): Always use TYPE_MODE, don't bypass it
	for VECTOR_TYPE_P.

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

From-SVN: r273476
2019-07-14 10:27:12 +02:00
GCC Administrator 7592365493 Daily bump.
From-SVN: r273473
2019-07-14 00:16:14 +00:00
GCC Administrator 8e6fdcaabe Daily bump.
From-SVN: r273462
2019-07-13 00:16:20 +00:00
Wilco Dijkstra da6e9b0c23 Turn off ipa-ra in builtins test (PR91059)
The gcc.c-torture/execute/builtins/lib directory contains a reimplementation
of many C library string functions, which causes non-trivial register allocation
bugs with LTO and static linked libraries.  To fix this long-standing test issue,
turn off ipa-ra which avoids the register corruption across calls.  All builtin
torture tests now pass on aarch64-none-elf.  Committed as obvious.
See PR78529 for more details.

    testsuite/
	PR testsuite/78529
	* gcc.c-torture/execute/builtins/builtins.exp: Add -fno-ipa-ra.

From-SVN: r273452
2019-07-12 17:00:40 +00:00
Richard Biener 9f2cfe108f Backport PRs 90369, 90900, 90914, 90972, 90982, 91004, 91062, 91063
2019-07-12  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-07-04  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/91063
	* tree-vect-stmts.c (vect_init_vector): Call gsi_remove to remove
	stmt from stmts sequence before calling vect_init_vector_1.
	Formatting fix.

	* gcc.dg/gomp/pr91063.c: New test.

	2019-07-04  Richard Biener  <rguenther@suse.de>

	PR ipa/91062
	* tree-pass.h (execute_all_ipa_transforms): Add a flag
	parameter whether to disable GC collection.
	* passes.c (execute_one_ipa_transform_pass): Likewise, and
	honor it.
	(execute_all_ipa_transforms): Likewise and pass it down.
	* cgraph.c (cgraph_node::get_body): Do not invoke garbage
	collection from applying IPA transforms.
	* cgraphunit.c (cgraph_node::expand): Allow garbage collection
	from applying IPA transforms.

	2019-06-27  Richard Biener  <rguenther@suse.de>

	PR testsuite/91004
	* g++.dg/torture/pr34850.C: Fix overly reduced testcase.

	2019-06-26  Richard Biener  <rguenther@suse.de>

	PR ipa/90982
	* tree-inline.c (remap_ssa_name): Copy SSA range info.

	* g++.dg/torture/pr90982.C: New testcase.

	2019-06-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90972
	* tree-vect-stmts.c (vect_init_vector): Handle CONSTANT_CLASS_P
	in common code, dealing with STRING_CST properly.

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

	2019-06-21  Richard Biener  <rguenther@suse.de>

	PR debug/90914
	* dwarf2out.c (prune_unused_types_walk): Always consider
	function-local extern declarations as used.

	* g++.dg/debug/pr90914.C: New testcase.

	2019-06-18  Richard Biener  <rguenther@suse.de>

	PR debug/90900
	* cfgexpand.c (expand_debug_expr): Treat NOTE_P DECL_RTL
	as if optimized away.

	* gcc.dg/gomp/pr90900.c: New testcase.

	2019-05-07  Richard Biener  <rguenther@suse.de>

	PR lto/90369
	* lto-wrapper.c (debug_objcopy): Use the original filename
	including archive offset for the filename used for -save-temps.

From-SVN: r273446
2019-07-12 14:42:14 +00:00
Eric Botcazou 72bc772092 re PR rtl-optimization/91136 (incorrect move of instruction to delay slot causes application crash in exception handling)
PR rtl-optimization/91136
	* df-core.c (ACCESSING REFS): Fix typos in comment.
	* resource.c (mark_target_live_reg): Add artificial defs that occur at
	the beginning of the block to the initial set of live registers.

From-SVN: r273437
2019-07-12 10:16:11 +00:00
GCC Administrator 7c0493dd82 Daily bump.
From-SVN: r273428
2019-07-12 00:16:13 +00:00
Uros Bizjak b0293479e5 backport: pr81563.c (dg-final): Check that no registers are restored from %esp.
Backported from mainline
	2019-06-18  Uroš Bizjak  <ubizjak@gmail.com>

	* gcc.target/i386/pr81563.c (dg-final): Check that no
	registers are restored from %esp.

From-SVN: r273423
2019-07-11 22:52:25 +02:00
Uros Bizjak 5ee0f4e7d9 backport: sse.md (*andnot<mode>3_bcst): Fix VI/VI48_AVX512VL typo.
Backported from mainline
	2019-07-06  Richard Sandiford  <richard.sandiford@arm.com>

	* config/i386/sse.md (*andnot<mode>3_bcst): Fix VI/VI48_AVX512VL typo.

From-SVN: r273422
2019-07-11 22:49:13 +02:00
Segher Boessenkool 54f3719d6d rs6000: Handle Modula-2 in the traceback table
This patch recognises Modula-2 as language for the traceback table,
fixing the problem shown in
https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00848.html .

	* config/rs6000/rs6000.c (rs6000_output_function_epilogue): Handle
	Modula-2.

From-SVN: r273412
2019-07-11 20:42:20 +02:00
GCC Administrator 9c657ecabd Daily bump.
From-SVN: r273374
2019-07-11 00:16:12 +00:00
GCC Administrator 77135e59cf Daily bump.
From-SVN: r273320
2019-07-10 00:16:16 +00:00
GCC Administrator c91c43f823 Daily bump.
From-SVN: r273259
2019-07-09 00:16:14 +00:00
Richard Biener 21c034217c re PR tree-optimization/91108 (Fails to pun through unions)
2019-07-08  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91108
	* tree-ssa-sccvn.c: Include builtins.h.
	(vn_reference_lookup_3): Use only alignment constraints to
	verify same-valued store disambiguation.

	* gcc.dg/tree-ssa/pr91091-1.c: New testcase.
	* gcc.dg/tree-ssa/ssa-fre-78.c: Likewise.

From-SVN: r273233
2019-07-08 11:48:48 +00:00
GCC Administrator d542f941ca Daily bump.
From-SVN: r273189
2019-07-08 00:16:19 +00:00
Paul Thomas e3b4dd5100 re PR fortran/91077 (Wrong indexing when using a pointer)
2019-07-07  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/91077
	* trans-array.c (gfc_conv_scalarized_array_ref) Delete code
	that gave symbol backend decl for subref arrays and deferred
	length variables.

2019-07-07  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/91077
	* gfortran.dg/pointer_array_11.f90 : New test.

From-SVN: r273177
2019-07-07 14:32:53 +00:00
GCC Administrator c2019cdb0b Daily bump.
From-SVN: r273172
2019-07-07 00:16:18 +00:00
GCC Administrator abc1c0ee6f Daily bump.
From-SVN: r273153
2019-07-06 00:16:31 +00:00
Szabolcs Nagy 183b10be03 aarch64: emit .variant_pcs for aarch64_vector_pcs symbol references
Backport r271869
Backport r271913
Backport r272414

A dynamic linker with lazy binding support may need to handle vector PCS
function symbols specially, so an ELF symbol table marking was
introduced for such symbols.

Function symbol references and definitions that follow the vector PCS
are marked in the generated assembly with .variant_pcs and then the
STO_AARCH64_VARIANT_PCS st_other flag is set on the symbol in the object
file.  The marking is propagated to the dynamic symbol table by the
static linker so a dynamic linker can handle such symbols specially.

For this to work, the assembler, the static linker and the dynamic
linker has to be updated on a system.  Old assembler does not support
the new .variant_pcs directive, so a toolchain with old binutils won't
be able to compile code that references vector PCS symbols.

gcc/ChangeLog:

	* config/aarch64/aarch64-protos.h (aarch64_asm_output_alias): Declare.
	(aarch64_asm_output_external): Declare.
	* config/aarch64/aarch64.c (aarch64_asm_output_variant_pcs): New.
	(aarch64_declare_function_name): Call aarch64_asm_output_variant_pcs.
	(aarch64_asm_output_alias): New.
	(aarch64_asm_output_external): New.
	* config/aarch64/aarch64.h (ASM_OUTPUT_DEF_FROM_DECLS): Define.
	(ASM_OUTPUT_EXTERNAL): Define.

gcc/testsuite/ChangeLog:

	* gcc.target/aarch64/pcs_attribute-2.c: New test.
	* gcc.target/aarch64/torture/simd-abi-4.c: Check .variant_pcs support.
	* lib/target-supports.exp (check_effective_target_aarch64_variant_pcs):
	New.

gcc/ChangeLog:

	* config/aarch64/aarch64-protos.h (aarch64_asm_output_external): Remove
	const.
	* config/aarch64/aarch64.c (aarch64_asm_output_external): Call
	default_elf_asm_output_external.

gcc/testsuite/ChangeLog:

	* gcc.target/aarch64/pcs_attribute-2.c: Remove ifunc usage.
	* gcc.target/aarch64/pcs_attribute-3.c: New test.

From-SVN: r273140
2019-07-05 15:06:11 +00:00
GCC Administrator c960b2a246 Daily bump.
From-SVN: r273099
2019-07-05 00:16:19 +00:00
James Clarke 678cb35949 s-osinte__kfreebsd-gnu.ads (clockid_t): Make type definition public.
2019-07-04  James Clarke <jrtc27@debian.org>

        * libgnarl/s-osinte__kfreebsd-gnu.ads (clockid_t): Make type
        definition public.
        (CLOCK_REALTIME): Make value public.

From-SVN: r273081
2019-07-04 13:36:08 +00:00
Martin Liska b098c7983c Backport r272993
2019-07-04  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-07-03  Martin Liska  <mliska@suse.cz>

	PR tree-optimization/90892
	* builtins.c (inline_expand_builtin_string_cmp): Handle '\0'
	in string constants.
2019-07-04  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-07-03  Martin Liska  <mliska@suse.cz>

	PR tree-optimization/90892
	* gcc.dg/pr90892.c: New test.

From-SVN: r273074
2019-07-04 09:03:56 +00:00
Martin Liska f62121b1ca Backport r272992
2019-07-04  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-07-03  Martin Liska  <mliska@suse.cz>

	PR middle-end/90899
	* multiple_target.c (create_dispatcher_calls): Add to comdat
	group only if set for ifunc.
2019-07-04  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-07-03  Martin Liska  <mliska@suse.cz>

	PR middle-end/90899
	* gcc.target/i386/pr90899.c: New test.

From-SVN: r273073
2019-07-04 09:03:40 +00:00
Chenghua Xu 0fadad4fb8 [MIPS][Testsuite] Specify msa-fmadd.c abis.
Backport from mainline for fix msa-fmadd.c.
gcc/testsuite/

        * gcc.target/mips/mips-fmadd.c: Rename to ...
        * gcc.target/mips/mips-fmadd-o32.c: ... Here; add abi=32.
        * gcc.target/mips/mips-fmadd-n64.c: New.

From-SVN: r273035
2019-07-04 02:39:58 +00:00
GCC Administrator beaa6403a1 Daily bump.
From-SVN: r273030
2019-07-04 00:16:17 +00:00
Jonathan Wakely 7eaccf3e29 PR libstdc++/91067 fix missing exports for filesystem iterators
The copy assignment operator for recursive_directory_iterator was not
exported despite being needed. The __shared_ptr default constructors are
not needed when compiling with GCC but Clang requires them for -O1.

	PR libstdc++/91067
	* acinclude.m4 (libtool_VERSION): Bump to 6:27:0.
	* configure: Regenerate.
	* config/abi/pre/gnu.ver (GLIBCXX_3.4.27): Add new version. Export
	missing symbols.
	* testsuite/27_io/filesystem/iterators/91067.cc: New test.
	* testsuite/util/testsuite_abi.cc: Add new symbol version.

From-SVN: r273025
2019-07-03 22:09:13 +01:00
Jonathan Wakely a3c822eb81 Fix preprocessor checks for Clang builtins
Clang seems to define built-ins that start with "__builtin_" as
non-keywords, which means that we need to use __has_builtin to detect
them, not __is_identifier. The built-ins that don't start with
"__builtin_" are keywords, and can only be detected using
__is_identifier and not by __has_builtin.

Backport from mainline
2019-07-02  Jonathan Wakely  <jwakely@redhat.com>

	* include/bits/c++config (_GLIBCXX_HAVE_BUILTIN_LAUNDER)
	(_GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED): Use __has_builtin
	instead of __is_identifier to detect Clang support.

From-SVN: r273024
2019-07-03 22:09:08 +01:00
Eric Botcazou 669c0e314c dwarf2out.c (add_scalar_info): Add back refererence to existing DIE if it has the DW_AT_data_member_location...
* dwarf2out.c (add_scalar_info): Add back refererence to existing DIE
	if it has the DW_AT_data_member_location attribute.

From-SVN: r273003
2019-07-03 12:01:30 +00:00
GCC Administrator 5196f31fbb Daily bump.
From-SVN: r272952
2019-07-03 00:16:12 +00:00
Andrew Stubbs 43806b822b Fix regrename ICE.
2019-07-02  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline:
	gcc/
	2019-07-02  Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn.md (movdi_symbol_save_scc): Convert to define_insn
	with inlined save and restore.

From-SVN: r272938
2019-07-02 13:57:56 +00:00
Marek Polacek 1e8aa13209 PR c++/90490 - fix decltype issues in noexcept-specifier.
* except.c (build_noexcept_spec): Call
	instantiate_non_dependent_expr_sfinae before
	build_converted_constant_expr instead of calling
	instantiate_non_dependent_expr after it.  Add
	processing_template_decl_sentinel.

	* g++.dg/cpp0x/noexcept43.C: New test.
	* g++.dg/cpp0x/noexcept44.C: New test.

From-SVN: r272918
2019-07-02 00:23:41 +00:00
Marek Polacek 7b966ac81e PR c++/60223 - ICE with T{} in non-deduced context.
* pt.c (unify): Allow COMPOUND_LITERAL_P in a non-deduced context.

	* g++.dg/cpp0x/nondeduced1.C: New test.
	* g++.dg/cpp0x/nondeduced2.C: New test.
	* g++.dg/cpp0x/nondeduced3.C: New test.
	* g++.dg/cpp0x/nondeduced4.C: New test.

From-SVN: r272917
2019-07-02 00:22:37 +00:00
GCC Administrator e2a5555a1e Daily bump.
From-SVN: r272915
2019-07-02 00:16:18 +00:00
Eric Botcazou 9c715fa905 re PR middle-end/64242 (Longjmp expansion incorrect)
PR middle-end/64242
	* config/sparc/sparc.md (nonlocal_goto): Restore frame pointer last.
	Add frame clobber and schedule blockage.

From-SVN: r272890
2019-07-01 16:27:06 +00:00
GCC Administrator afbaf20728 Daily bump.
From-SVN: r272838
2019-07-01 00:16:14 +00:00
GCC Administrator 07cee7b26d Daily bump.
From-SVN: r272830
2019-06-30 00:16:22 +00:00
Eric Botcazou 4d3ffbe204 decl.c (gnat_to_gnu_entity): Beep up comment on SAVED...
* gcc-interface/decl.c (gnat_to_gnu_entity): Beep up comment on SAVED,
	and tweak comment on the assertion about the scopes of Itypes.  Do not
	skip the regular processing for Itypes that are E_Record_Subtype with
	a Cloned_Subtype.  Get the Cloned_Subtype for every E_Record_Subtype
	if the type is dummy and hasn't got its own freeze node.
	<E_Record_Subtype>: Save again the DECL of the Cloned_Subtype, if any.
	<E_Access_Subtype>: Save again the DECL of the equivalent type.
	(Gigi_Equivalent_Type) <E_Access_Subtype>: New case.

From-SVN: r272823
2019-06-29 09:05:43 +00:00
Eric Botcazou 2fb065a173 trans.c (mark_visited_r): Set TYPE_SIZES_GIMPLIFIED on the main variant of a type, if any.
* gcc-interface/trans.c (mark_visited_r): Set TYPE_SIZES_GIMPLIFIED on
	the main variant of a type, if any.

From-SVN: r272816
2019-06-29 07:38:08 +00:00
Eric Botcazou ec90f35161 decl.c (set_nonaliased_component_on_array_type): Add missing guard for the presence of TYPE_CANONICAL.
* gcc-interface/decl.c (set_nonaliased_component_on_array_type): Add
	missing guard for the presence of TYPE_CANONICAL.
	(set_reverse_storage_order_on_array_type): Likewise.

From-SVN: r272812
2019-06-29 07:30:57 +00:00
GCC Administrator 5540f7f151 Daily bump.
From-SVN: r272807
2019-06-29 00:16:13 +00:00
Jakub Jelinek 0a4024807a backport: re PR c++/91024 (-Wimplicit-fallthrough is confused by likely/unlikely attributes)
Backported from mainline
	2019-06-27  Jakub Jelinek  <jakub@redhat.com>

	PR c++/91024
	* gimplify.c (collect_fallthrough_labels): Ignore GIMPLE_PREDICT
	statements.

	* g++.dg/warn/Wimplicit-fallthrough-4.C: New test.

From-SVN: r272804
2019-06-29 00:57:16 +02:00
Jakub Jelinek 11e313784f backport: re PR target/90991 (_mm_loadu_ps instrinsic translates to vmovaps in combination with _mm512_insertf32x4)
Backported from mainline
	2019-06-26  Jakub Jelinek  <jakub@redhat.com>

	PR target/90991
	* config/i386/sse.md
	(*<extract_type>_vinsert<shuffletype><extract_suf>_0): Use vmovupd,
	vmovups, vmovdqu, vmovdqu32 or vmovdqu64 instead of the aligned
	insns if operands[2] is misaligned_operand.

	* gcc.target/i386/avx512dq-pr90991-1.c: New test.

From-SVN: r272803
2019-06-29 00:56:27 +02:00
Jakub Jelinek f57330c00b backport: re PR sanitizer/90954 (ICE: combining undefined behavior sanitizer with openmp)
Backported from mainline
	2019-06-25  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/90954
	* c-omp.c (c_finish_omp_atomic): Allow tree_invariant_p in addition
	to SAVE_EXPR in first operand of a COMPOUND_EXPR.

	* c-c++-common/gomp/pr90954.c: New test.

From-SVN: r272802
2019-06-29 00:55:29 +02:00
Jakub Jelinek fe8665498d backport: re PR c++/90950 (OpenMP clause handling rejecting references to incomplete types in templates)
Backported from mainline
	2019-06-21  Jakub Jelinek  <jakub@redhat.com>

	PR c++/90950
	* semantics.c (finish_omp_clauses): Don't reject references to
	incomplete types if processing_template_decl.

	* g++.dg/gomp/lastprivate-1.C: New test.

From-SVN: r272801
2019-06-29 00:11:03 +02:00
Jakub Jelinek 03b70afb51 backport: re PR c/90760 (ICE on attributes section and alias in set_section, at symtab.c:1573)
Backported from mainline
	2019-06-12  Jakub Jelinek  <jakub@redhat.com>

	PR c/90760
	* symtab.c (symtab_node::set_section): Allow being called on aliases
	as long as they aren't analyzed yet.

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

From-SVN: r272800
2019-06-29 00:10:04 +02:00
Jeff Law a7c7481a07 re PR tree-optimization/90949 (null pointer check removed)
PR tree-optimization/90949
	* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
	* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.

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

From-SVN: r272793
2019-06-28 14:21:05 -06:00
Andrew Stubbs edbbdf0b8c Fix trampoline execution failures on GCN5.
2019-06-28  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline:
	2019-05-22  Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn.c (gcn_trampoline_init): Call "sorry" on GCN5.

From-SVN: r272788
2019-06-28 16:37:14 +00:00
GCC Administrator 13d140ccd6 Daily bump.
From-SVN: r272773
2019-06-28 00:16:12 +00:00
Jonathan Wakely 0e7ffed96c PR libstdc++/85494 use rand_s in std::random_device
This is a minimal fix for the use of a deterministic RNG on mingw-w64,
simply using rand_s unconditionally. The rest of the r271740 changes on
trunk are not included. That means that RDSEED and RDRAND are not
available for mingw-w64 and the token passed to the constructor is
ignored completely.

	PR libstdc++/85494 use rand_s in std::random_device
	* config/os/mingw32-w64/os_defines.h (_GLIBCXX_USE_CRT_RAND_S): Define.
	* src/c++11/cow-string-inst.cc (random_device::_M_init_pretr1)
	[_GLIBCXX_USE_CRT_RAND_S]: Do nothing if rand_s will be used.
	* src/c++11/random.cc [_GLIBCXX_USE_CRT_RAND_S] (__winxp_rand_s):
	Define new function.
	(random_device::_M_init_pretr1) [_GLIBCXX_USE_CRT_RAND_S]: Do nothing
	if rand_s will be used.
	(random_device::_M_getval_pretr1) [_GLIBCXX_USE_CRT_RAND_S]: Use
	__winxp_rand_s().
	* testsuite/26_numerics/random/random_device/85494.cc: New test.

From-SVN: r272748
2019-06-27 12:31:02 +01:00
Jonathan Wakely c8a25b30c6 PR libstdc++/91012 fixfilesystem_error::what() string
When I refactored the filesystem_error code I changed it to only use the
constructor parameter in the what() string, instead of the string
returned by system_error::what(). That meant it no longer included the
description of the error_code that system_error adds. This restores the
previous behaivour, as encouraged by the standard ("Implementations
should include the system_error::what() string and the pathnames of
path1 and path2 in the native format in the returned string").

	PR libstdc++/91012
	* src/c++17/fs_path.cc (filesystem_error::_Impl): Use a string_view
	for the what_arg parameters.
	(filesystem_error::filesystem_error): Pass system_error::what() to
	the _Impl constructor.
	* testsuite/27_io/filesystem/filesystem_error/cons.cc: Ensure that
	filesystem_error::what() contains system_error::what().

From-SVN: r272741
2019-06-27 11:06:09 +01:00
GCC Administrator e34f32d792 Daily bump.
From-SVN: r272722
2019-06-27 00:16:19 +00:00
Martin Jambor 7867b61fa3 [PR 90939] Remove outdated assert in ipcp_bits_lattice::meet_with
2019-06-26  Martin Jambor  <mjambor@suse.cz>

	PR ipa/90939
	* ipa-cp.c (ipcp_bits_lattice::meet_with): Remove assert.

	testsuite/
	* g++.dg/lto/pr90939_[01].C: New test.

From-SVN: r272689
2019-06-26 14:04:08 +02:00
Rainer Orth 1215a76ab5 Fix sanitizer_common/sanitizer_posix_libcdep.cc compilation on Solaris 11.5
* sanitizer_common/sanitizer_posix_libcdep.cc: Cherry-pick
	compiler-rt revision 363778.

From-SVN: r272686
2019-06-26 10:49:15 +00:00
Rainer Orth d1bb76b1f9 Remove support for alternative Solaris 11.4 ld -V output
Backport from mainline
	2019-06-17  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* configure.ac (ld_vers) <*-*-solaris2*>: Remove support for
	alternative Solaris 11.4 format.
	* configure: Regenerate.

From-SVN: r272676
2019-06-26 09:15:46 +00:00
GCC Administrator 707d4310d1 Daily bump.
From-SVN: r272664
2019-06-26 00:16:19 +00:00
Claudiu Zissulescu fcb73d173b [ARC] Backport fix PR89838
gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

        * config/arc/arc.c (arc_symbol_binds_local_p): New function.
        (arc_legitimize_pic_address): Simplify and cleanup the function.
        (SYMBOLIC_CONST): Remove.
        (prepare_pic_move): Likewise.
        (prepare_move_operands): Handle complex mov cases here.
        (arc_legitimize_address_0): Remove call to
        arc_legitimize_pic_address.
        (arc_legitimize_address): Remove call to
        arc_legitimize_tls_address.
        * config/arc/arc.md (movqi_insn): Allow Cm3 match.
        (movhi_insn): Likewise.

/gcc/testsuite
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com

From-SVN: r272645
2019-06-25 13:02:21 +02:00
Andrew Stubbs 47fd1a8347 GCN: Wait for exit value to write before exiting.
2019-06-25  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline
	2019-05-24  Andrew Stubbs  <ams@codesourcery.com>

	gcc/
	* config/gcn/gcn-run.c (main): Set a non-zero return value if the
	kernel does not exit cleanly.
	* config/gcn/gcn.md (gcn_return): Insert s_waitcnt before s_dcache_wb.

From-SVN: r272642
2019-06-25 09:47:15 +00:00
Andrew Stubbs 8abc773747 Fix 64-bit addition in prologue.
2019-06-25  Andrew Stubbs  <ams@codesourcery.com>

	Backport from mainline
	2019-05-24  Andrew Stubbs  <ams@codesourcery.com>

	gcc/
	* config/gcn/gcn.c (gcn_expand_prologue): Use gen_addsi3_scalar_carry
	for lo-part.

From-SVN: r272641
2019-06-25 09:47:09 +00:00
Richard Biener 4e4024c1f1 re PR tree-optimization/90930 (Excessive memory consumption)
2019-06-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90930
	* tree-ssa-reassoc.c (rewrite_expr_tree_parallel): Set visited
	flag on new stmts to avoid re-processing them.

From-SVN: r272636
2019-06-25 07:30:44 +00:00
GCC Administrator 322deb2391 Daily bump.
From-SVN: r272631
2019-06-25 00:16:13 +00:00
Richard Biener 69490dcd9e re PR tree-optimization/90930 (Excessive memory consumption)
2019-06-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90930
	PR tree-optimization/90316
	* tree-ssa-alias.c (walk_non_aliased_vuses): Add missing
	decrement of limit.

From-SVN: r272622
2019-06-24 17:19:36 +00:00
GCC Administrator b25e2648b4 Daily bump.
From-SVN: r272612
2019-06-24 00:16:13 +00:00
GCC Administrator 4c3fb1973b Daily bump.
From-SVN: r272598
2019-06-23 00:16:11 +00:00
GCC Administrator 60f3d34d03 Daily bump.
From-SVN: r272582
2019-06-22 00:16:13 +00:00
Thomas Koenig f21857aed5 backport: re PR fortran/90937 (ICE: in gfc_get_symbol_decl, at fortran/trans-decl.c:1538)
2019-06-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/90937
	* trans-types.c (get_formal_from_actual_arglist): Get symbol from
	current namespace so it will be freed later.  If symbol is of type
	character, get an empty character length.

2019-06-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/90937
	* gfortran.dg/external_procedure_4.f90: New test.

From-SVN: r272564
2019-06-21 19:28:54 +00:00
Jonathan Wakely 2c1623a911 PR libstdc++/90920 restore previous checks for empty ranges
The change in r263433 broke the contract of the __rotate functions, by no
longer accepting empty ranges. That means that callers which inlined the
old version of std::rotate (without checks) that end up linking to a new
definition of std::__rotate (also without checks) could perform a divide
by zero and crash.

This restores the old contract of the __rotate overloads.

Backport from mainline
2019-06-19  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90920 partially revert r263433
	* include/bits/stl_algo.h (__rotate): Restore checks for empty ranges.
	(rotate): Remove checks.
	* testsuite/25_algorithms/rotate/90920.cc: New test.

From-SVN: r272558
2019-06-21 18:37:07 +01:00
Steven G. Kargl ab7b24942d backport: re PR fortran/90290 (-std=f2008 should reject non-constant stop and error stop codes)
2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	PR fortran/90290
	* match.c (gfc_match_stopcode): Check F2008 condition on stop code.

2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	PR fortran/90290
	* gfortran.dg/pr90290.f90: New test.

From-SVN: r272541
2019-06-21 00:54:28 +00:00
Steven G. Kargl 2c5e6cf9ce backport: re PR fortran/90002 (ICE: free_expr0(): Bad expr type)
2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	PR fortran/90002
	* array.c (gfc_free_array_spec): When freeing an array-spec, avoid
	an ICE for assumed-shape coarrays 

2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	PR fortran/90002
	* gfortran.dg/pr90002.f90: New test.

From-SVN: r272540
2019-06-21 00:38:13 +00:00
Steven G. Kargl da03f4f5e8 backport: re PR fortran/89344 (uncaught programmer error: polymorphic variable is INTENT(IN) but assigned to without error)
2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	PR fortran/89344
	* expr.c (gfc_check_vardef_context): Check for INTENT(IN) variable
	in SELECT TYPE construct.

2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	PR fortran/89344
	* gfortran.dg/pr89344.f90: New test.

From-SVN: r272539
2019-06-21 00:24:53 +00:00
GCC Administrator c1088e3e93 Daily bump.
From-SVN: r272537
2019-06-21 00:16:16 +00:00
Steven G. Kargl 255aa82558 backport: re PR fortran/87907 (ICE in resolve_contained_fntype, at fortran/resolve.c:587)
2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	PR fortran/87907
	* resolve.c (resolve_contained_fntype): Do not dereference a NULL
	pointer.

2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	PR fortran/87907
	* gfortran.dg/pr87907.f90: New testcase.

From-SVN: r272534
2019-06-21 00:12:37 +00:00
Steven G. Kargl b17d5298f5 backport: re PR fortran/86587 (Derived-type with attributes BIND(C) and PRIVATE raises an error but standard accepts it)
2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	PR fortran/86587
	* symbol.c (verify_bind_c_derived_type): Remove erroneous error
	checking for BIND(C) and PRIVATE attributes.

2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	PR fortran/86587
	* gfortran.dg/pr86587.f90: New test.

From-SVN: r272533
2019-06-21 00:01:23 +00:00
Steven G. Kargl 57cdb4a670 backport: re PR fortran/77632 ([F08] Pointer initialisation does not quite work with arrays)
2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	PR fortran/77632
	* /decl.c (variable_decl): Mark a variable that is a target in pointer
	initialization when in PROGRAM, MODULE, or SUBMODULE scope with an
	implicit save.

2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	PR fortran/77632
	* gfortran.dg/pr77632_1.f90: New test.

From-SVN: r272532
2019-06-20 23:50:54 +00:00
Steven G. Kargl ccaf5f7bea backport: re PR fortran/69499 ([F03] ICE-on-invalid on combining select type with wrong statement)
2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	PR fortran/69499
	* match.c (gfc_match_select_type):  SELECT TYPE is an executable 
	statement, and cannot appear in MODULE or SUBMODULE scope.

2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	PR fortran/69499
	* gfortran.dg/pr69499.f90: New test.
	* gfortran.dg/module_error_1.f90: Update dg-error string.

From-SVN: r272531
2019-06-20 23:39:29 +00:00
Steven G. Kargl 3beb780272 backport: re PR fortran/69398 ([OOP] ICE on class with duplicate dimension attribute specified)
2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	PR fortran/69398
	* decl.c (attr_decl): Check for duplicate DIMENSION attribute for a
	CLASS entity.

2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	PR fortran/69398
	* gfortran.dg/pr69398.f90: New test.

From-SVN: r272530
2019-06-20 23:27:13 +00:00
Steven G. Kargl 8cb98c28f2 backport: re PR fortran/68544 (ICE trying to pass derived type constructor as a function)
2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	PR fortran/68544
	* resolve.c (is_dt_name): New function to compare symbol name against
	list of derived types.
	(resolve_actual_arglist): Use it to find wrong code.

2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	PR fortran/68544
	* gfortran.dg/pr68544.f90: New test.
	* gfortran.dg/pr85687.f90: Modify test for new error message.

From-SVN: r272529
2019-06-20 23:15:32 +00:00
Steven G. Kargl 72fbe222d4 backport: arith.c (arith_power): Rework overflow of an integer to an integer exponent.
2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	* arith.c (arith_power): Rework overflow of an integer to an integer
	exponent.

2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	Backport from mainline
	* gfortran.dg/integer_exponentiation_4.f90: Update test.
	* gfortran.dg/integer_exponentiation_5.F90: Ditto.
	* gfortran.dg/no_range_check_1.f90: Ditto.

From-SVN: r272528
2019-06-20 22:58:56 +00:00
GCC Administrator 837ecfe737 Daily bump.
From-SVN: r272494
2019-06-20 00:16:11 +00:00
GCC Administrator 462bde07de Daily bump.
From-SVN: r272463
2019-06-19 00:16:35 +00:00
Harald Anlauf 2182b5528e backport: re PR fortran/90577 (FAIL: gfortran.dg/lrshift_1.f90 with -O(2|3) and -flto)
2019-06-18  Harald Anlauf  <anlauf@gmx.de>

	Backport from mainline
	2019-06-14  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/90577
	PR fortran/90578
	* trans-intrinsic.c (gfc_conv_intrinsic_shift): Properly
	distinguish logical/arithmetic shifts.
	* intrinsic.texi: Update documentation for SHIFTR/SHIFTL/SHIFTA
	(Fortran 2008) and LSHIFT/RSHIFT (GNU extensions).

	PR fortran/90577
	PR fortran/90578
	* gfortran.dg/lrshift_1.f90: Adjust testcase.
	* gfortran.dg/shiftalr_3.f90: New testcase.

From-SVN: r272437
2019-06-18 20:21:47 +00:00
Arnaud Charlet a87f625992 re PR ada/80590 (non-bootstrap build failure of Ada runtime)
PR ada/80590

	* sem_ch5.adb (Analyze_Loop_Statement): Avoid exception propagation
	during normal processing.

From-SVN: r272416
2019-06-18 13:44:58 +02:00
GCC Administrator 37bf6eb739 Daily bump.
From-SVN: r272403
2019-06-18 00:16:17 +00:00
Jeff Law 4649f72c13 mips.c (mips_expand_builtin_insn): Swap the 1st and 3rd operands of the fmadd/fmsub/maddv builtin.
* config/mips/mips.c (mips_expand_builtin_insn): Swap the 1st
	and 3rd operands of the fmadd/fmsub/maddv builtin.

	* gcc.target/mips/msa-fmadd.c: New.

From-SVN: r272392
2019-06-17 11:27:30 -06:00
Jonathan Wakely 91756c4abc PR libstdc++/90281 Fix string conversions for filesystem::path
Fix several bugs in the encoding conversions for filesystem::path that
prevent conversion of Unicode characters outside the Basic Multilingual
Plane, and prevent returning basic_string specializations with
alternative allocator types.

The std::codecvt_utf8 class template is not suitable for UTF-16
conversions because it uses UCS-2 instead. For conversions between UTF-8
and UTF-16 either std::codecvt<C, char, mbstate> or
codecvt_utf8_utf16<C> must be used.

The __str_codecvt_in and __str_codecvt_out utilities do not
return false on a partial conversion (e.g. for invalid or incomplete
Unicode input). Add new helpers that treat partial conversions as
errors, and use them for all filesystem::path conversions.

	PR libstdc++/90281 Fix string conversions for filesystem::path
	* include/bits/fs_path.h (u8path) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]:
	Use codecvt_utf8_utf16 instead of codecvt_utf8. Use
	__str_codecvt_in_all to fail for partial conversions and throw on
	error.
	[!_GLIBCXX_FILESYSTEM_IS_WINDOWS && _GLIBCXX_USE_CHAR8_T]
	(path::_Cvt<char8_t>): Add explicit specialization.
	[_GLIBCXX_FILESYSTEM_IS_WINDOWS] (path::_Cvt::_S_wconvert): Remove
	overloads.
	[_GLIBCXX_FILESYSTEM_IS_WINDOWS] (path::_Cvt::_S_convert): Use
	if-constexpr instead of dispatching to _S_wconvert. Use codecvt
	instead of codecvt_utf8. Use __str_codecvt_in_all and
	__str_codecvt_out_all.
	[!_GLIBCXX_FILESYSTEM_IS_WINDOWS] (path::_Cvt::_S_convert): Use
	codecvt instead of codecvt_utf8. Use __str_codecvt_out_all.
	(path::_S_str_convert) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Use
	codecvt_utf8_utf16 instead of codecvt_utf8. Construct return values
	with allocator. Use __str_codecvt_out_all. Fallthrough to POSIX code
	after converting to UTF-8.
	(path::_S_str_convert): Use codecvt instead of codecvt_utf8. Use
	__str_codecvt_in_all.
	(path::string): Fix initialization of string types with different
	allocators.
	(path::u8string) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Use
	codecvt_utf8_utf16 instead of codecvt_utf8. Use __str_codecvt_out_all.
	* include/bits/locale_conv.h (__do_str_codecvt): Reorder static and
	runtime conditions.
	(__str_codecvt_out_all, __str_codecvt_in_all): New functions that
	return false for partial conversions.
	* include/experimental/bits/fs_path.h (u8path):
	[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Implement correctly for mingw.
	[_GLIBCXX_FILESYSTEM_IS_WINDOWS] (path::_Cvt::_S_wconvert): Add
	missing handling for char8_t. Use codecvt and codecvt_utf8_utf16
	instead of codecvt_utf8. Use __str_codecvt_in_all and
	__str_codecvt_out_all.
	[!_GLIBCXX_FILESYSTEM_IS_WINDOWS] (path::_Cvt::_S_convert): Use
	codecvt instead of codecvt_utf8. Use __str_codecvt_out_all.
	(path::string) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Use
	codecvt_utf8_utf16 instead of codecvt_utf8. Construct return values
	with allocator. Use __str_codecvt_out_all and __str_codecvt_in_all.
	(path::string) [!_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Use
	__str_codecvt_in_all.
	(path::u8string) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Use
	codecvt_utf8_utf16 instead of codecvt_utf8. Use __str_codecvt_out_all.
	* src/c++17/fs_path.cc (path::_S_convert_loc): Use
	__str_codecvt_in_all.
	* src/filesystem/path.cc (path::_S_convert_loc): Likewise.
	* testsuite/27_io/filesystem/path/construct/90281.cc: New test.
	* testsuite/27_io/filesystem/path/factory/u8path.cc: New test.
	* testsuite/27_io/filesystem/path/native/string.cc: Test with empty
	strings and with Unicode characters outside the basic multilingual
	plane.
	* testsuite/27_io/filesystem/path/native/alloc.cc: New test.
	* testsuite/experimental/filesystem/path/construct/90281.cc: New test.
	* testsuite/experimental/filesystem/path/factory/u8path.cc: New test.
	* testsuite/experimental/filesystem/path/native/alloc.cc: New test.
	* testsuite/experimental/filesystem/path/native/string.cc: Test with
	empty strings and with Unicode characters outside the basic
	multilingual plane.

From-SVN: r272389
2019-06-17 16:03:46 +01:00
Arnaud Charlet ab4fb49500 re PR ada/80590 (non-bootstrap build failure of Ada runtime)
PR ada/80590

	* exp_ch9.adb (Expand_N_Delay_Relative_Statement): Swap the two
	conditions to avoid a unnecessary exception propagation in the default
	case.

From-SVN: r272374
2019-06-17 09:35:02 +02:00
GCC Administrator efca85c1c5 Daily bump.
From-SVN: r272369
2019-06-17 00:16:20 +00:00
John David Anglin 28d9dbf10f re PR middle-end/64242 (Longjmp expansion incorrect)
PR middle-end/64242
	* config/pa/pa.md (nonlocal_goto): Restore frame pointer last.  Add
	frame clobbers and schedule block.
	(builtin_longjmp): Likewise.

From-SVN: r272362
2019-06-16 21:44:08 +00:00
GCC Administrator 114d9136c9 Daily bump.
From-SVN: r272336
2019-06-16 00:16:12 +00:00
GCC Administrator 8f6602c6ca Daily bump.
From-SVN: r272317
2019-06-15 00:16:13 +00:00
Jonathan Wakely 661fbea42f Reduce code instantiated by filesystem::path::_S_convert_loc
Jakub noted in https://gcc.gnu.org/ml/libstdc++/2019-04/msg00140.html
that an unwanted std::wstring::_M_replace_dispatch symbol has started to
be exported from the Fedora shared library. This symbol is triggered by
the instantiation of std::wstring::assign(const char*, const char*) from
std::__str_codecvt_in which is called from path::_S_convert_loc. The
branch that triggers that instantiation can't actually happen in that
case, because codecvt facets will only return noconv when the input and
output types are the same. Guarding the assign call with an if-constexpr
check that the types are the same avoids instantiating template
specializations that will never actually be needed.

Backport from mainline
2019-04-26  Jonathan Wakely  <jwakely@redhat.com>

	* config/abi/pre/gnu.ver (GLIBCXX_3.4): Replace wildcard that matches
	wstring::_M_replace_dispatch with more specific patterns.
	* include/bits/fs_path.h (path::_S_convert_loc<_InputIterator>):
	Create const std::string to avoid redundant call to _S_convert_loc
	with non-const pointers.
	* include/bits/locale_conv.h (__do_str_codecvt): Use if-constexpr to
	avoid unnecessary basic_string::assign instantiations.

From-SVN: r272306
2019-06-14 19:11:30 +01:00
Jonathan Wakely 16af62ebdb Remove redundant step in experimental::filesystem::path construction
Backport from mainline
2019-04-26  Jonathan Wakely  <jwakely@redhat.com>

	* include/experimental/bits/fs_path.h
	(path::_S_convert_loc<_InputIterator>): Create const std::string to
	avoid redundant call to _S_convert_loc with non-const pointers.

From-SVN: r272305
2019-06-14 19:11:26 +01:00
Jonathan Wakely e49b75413a PR libstdc++/88881 fix filesystem::symlink_status for Windows
The fix for PR 88881 only added a workaround to filesystem::status, but
filesystem::symlink_status is also affected by the _wstat bug and needs
the same workaround.

The recent change to optimize path::parent_path() means that the
workaround can be simplified to just use parent_path().

Backport from mainline
2019-05-29  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/88881
	* src/c++17/fs_ops.cc [_GLIBCXX_FILESYSTEM_IS_WINDOWS]
	(status(const path&, error_code&)): Use parent_path() to remove
	trailing slash.
	(symlink_status(const path&, error_code&)): Duplicate workaround for
	bug in _wstat for paths with trailing slash.
	* testsuite/27_io/filesystem/operations/remove_all.cc: Check path
	with trailing slash.
	* testsuite/27_io/filesystem/operations/status.cc: Likewise.
	* testsuite/27_io/filesystem/operations/symlink_status.cc: Likewise.

From-SVN: r272304
2019-06-14 19:11:22 +01:00
Jonathan Wakely 8735578207 Optimize filesystem::path::parent_path()
Parsing a complete string is more efficient than appending each
component one-by-one.

Backport from mainline
2019-05-29  Jonathan Wakely  <jwakely@redhat.com>

	* src/c++17/fs_path.cc (path::parent_path()): Create whole path at
	once instead of building it iteratively.

From-SVN: r272303
2019-06-14 19:11:17 +01:00
Jonathan Wakely 16eb07fd34 Fix incorrect DR numbers in libstdc++ manual
Backport from mainline
2019-05-07  Jonathan Wakely  <jwakely@redhat.com>

	* doc/xml/manual/intro.xml: Fix DR 2537 and DR 2566 confusion.

From-SVN: r272302
2019-06-14 19:11:13 +01:00
Jonathan Wakely 3061315a40 Add __cpp_lib_bind_front macro to <version> header
Backport from mainline
2019-06-14  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/version (__cpp_lib_bind_front): Add missing macro.

From-SVN: r272301
2019-06-14 19:11:09 +01:00
Jonathan Wakely 45df071ace Fix incorrect __cpp_lib_parallel_algorithm macro definitions
Backport from mainline
2019-06-12  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/algorithm (__cpp_lib_parallel_algorithm): Fix value.
	* include/std/memory (__cpp_lib_parallel_algorithm): Likewise.
	* include/std/numeric (__cpp_lib_parallel_algorithm): Likewise.
	* testsuite/25_algorithms/pstl/feature_test.cc: New test.

From-SVN: r272300
2019-06-14 19:11:02 +01:00
Jonathan Wakely aaadd96e71 PR libstdc++/90770 fix missing src/debug/Makefile
Backport from mainline
2019-06-07  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90770
	* src/Makefile.am (stamp-debug): Also test for missing makefile.
	* src/Makefile.in: Regenerate.

From-SVN: r272299
2019-06-14 19:10:57 +01:00
Jonathan Wakely 11441586ef PR libstdc++/90252 Check TBB version and ability to link with -ltbb
Backport from mainline
2019-05-21  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90252
	* testsuite/lib/libstdc++.exp (check_effective_target_tbb-backend):
	Use "additional_flags" to pass -ltbb to v3_target_compile command.
	Use check_v3_target_prop_cached to cache the result of the test.

Backport from mainline
2019-05-20  Thomas Rodgers  <trodgers@redhat.com>

	PR libstdc++/90252
	* testsuite/lib/libstdc++.exp (check_effective_target_tbb-backend):
	Changed v3_target_compile check from preprocess to executable.
	Added "-ltbb" to v3_target_compile flags.

Backport from mainline
2019-05-20  Thomas Rodgers  <trodgers@redhat.com>

	* testsuite/lib/libstdc++.exp (check_effective_target_tbb-backend):
	Add check for Thread Building Blocks 2018 or later.

From-SVN: r272298
2019-06-14 19:10:52 +01:00
Jonathan Wakely 01980fa678 Use tabs to indent in ChangeLog
From-SVN: r272293
2019-06-14 16:40:24 +01:00
Jonathan Wakely cb771a7783 Fix names of _Lock_policy constants in libstdc++ manual
Backport from mainline
2019-05-21  Jonathan Wakely  <jwakely@redhat.com>

	* doc/xml/manual/shared_ptr.xml: Fix names of lock policy constants.

From-SVN: r272292
2019-06-14 16:39:51 +01:00
GCC Administrator 60a0e54adf Daily bump.
From-SVN: r272279
2019-06-14 00:16:13 +00:00
Marek Polacek bc447852db PR c++/90825 - endless recursion when evaluating sizeof.
PR c++/90832 - endless recursion when evaluating sizeof.
	* constexpr.c (cxx_eval_constant_expression): Don't recurse on the
	result of fold_sizeof_expr if is returns a SIZEOF_EXPR.
	* typeck.c (cxx_sizeof_expr): Only return a SIZEOF_EXPR if the operand
	is instantiation-dependent.

	* g++.dg/cpp0x/constexpr-sizeof2.C: New test.
	* g++.dg/cpp0x/constexpr-sizeof3.C: New test.

From-SVN: r272229
2019-06-13 00:56:54 +00:00
GCC Administrator 68fcb6c48c Daily bump.
From-SVN: r272227
2019-06-13 00:16:12 +00:00
Marek Polacek cac965a908 PR c++/90736 - bogus error with alignof.
* constexpr.c (adjust_temp_type): Use cv_unqualified type.

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

From-SVN: r272219
2019-06-12 21:12:00 +00:00
GCC Administrator 0a643240ef Daily bump.
From-SVN: r272176
2019-06-12 00:16:11 +00:00
Thomas KoenigandTomáš Trnka 37227150d2 backport: re PR fortran/90744 (Bogus length for character temporaries passed to external procedures since r268992)
2019-06-11  Thomas Koenig  <tkoenig@gcc.gnu.org>
	Tomáš Trnka  <trnka@scm.com>

	Backport from trunk
	PR fortran/90744
	* trans-types.c (get_formal_from_actual_arglist): Unset typespec
	flags which make no sense for procedures without explicit
	interface.

2019-06-11  Thomas Koenig  <tkoenig@gcc.gnu.org>
	Tomáš Trnka  <trnka@scm.com>

	Backport from trunk
	PR fortran/90744
	* gfortran.dg/deferred_character_33.f90: New test.
	* gfortran.dg/deferred_character_33a.f90: New test.


Co-Authored-By: Tomáš Trnka <trnka@scm.com>

From-SVN: r272173
2019-06-11 22:04:10 +00:00
Jakub Jelinek bb0e2d2799 re PR target/90811 ([nvptx] ptxas error on OpenMP offloaded code)
PR target/90811
	* config/nvptx/nvptx.c (nvptx_output_softstack_switch): Use and.b%d
	instead of and.u%d.

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

From-SVN: r272162
2019-06-11 18:43:09 +02:00
Edward Smith-Rowland dfb5c204a7 Fix ConstexprIterator requirements tests - No constexpr algorithms!
2019-06-11  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Fix ConstexprIterator requirements tests - No constexpr algorithms!
	* testsuite/21_strings/basic_string_view/requirements/constexpr_iter.cc:
	Replace copy with hand-rolled loop.
	* testsuite/23_containers/array/requirements/constexpr_iter.cc:
	Ditto.

From-SVN: r272160
2019-06-11 16:36:21 +00:00
Jakub Jelinek a80c35cf56 re PR c++/90810 (Different intrinsics behavior on G++ 7.4 and G++ 8.3)
PR c++/90810
	* init.c (constant_value_1): Handle VECTOR_CST DECL_INITIAL for
	!DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P decls like CONSTRUCTOR.

	* g++.dg/ext/vector37.C: New test.

From-SVN: r272154
2019-06-11 15:08:47 +02:00
Richard Biener 9086af4531 toir.cc (pop_label): Only queue labels in a vector.
2019-06-11  Richard Biener  <rguenthe@suse.de>

	d/90778
	* toir.cc (pop_label): Only queue labels in a vector.
	(cmp_labels): Label decl comparator.
	(pop_binding_level): Pop labels in DECL_UID order to avoid
	debug info differences.

From-SVN: r272147
2019-06-11 08:31:09 +00:00
GCC Administrator b18225a6a8 Daily bump.
From-SVN: r272140
2019-06-11 00:16:13 +00:00
GCC Administrator a671e8cb8c Daily bump.
From-SVN: r272101
2019-06-10 00:16:18 +00:00
Edward Smith-Rowland 2f5b1cf10a Test for C++20 p0858 - ConstexprIterator requirements.
2019-06-09  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Test for C++20 p0858 - ConstexprIterator requirements.
	* testsuite/21_strings/basic_string_view/requirements/constexpr_iter.cc:
	New test.
	* testsuite/23_containers/array/requirements/constexpr_iter.cc:
	New test.

From-SVN: r272097
2019-06-09 21:43:55 +00:00
GCC Administrator c50403680a Daily bump.
From-SVN: r272088
2019-06-09 00:16:15 +00:00
GCC Administrator 0f04bb981d Daily bump.
From-SVN: r272066
2019-06-08 00:16:15 +00:00
John David Anglin d101a3765a scanasm.exp (dg-function-on-line): Add pattern for hppa*-*-linux*.
* lib/scanasm.exp (dg-function-on-line): Add pattern for hppa*-*-linux*.

From-SVN: r272062
2019-06-07 23:22:15 +00:00
John David Anglin 610ce528d7 re PR target/90751 (-fpatchtable-function-entry broken on hppa-linux-gnu-gcc/hppa64-linux-gnu-gcc)
PR target/90751
	* config/pa/pa-linux.h (ASM_DECLARE_FUNCTION_NAME): Update comment.
	Call pa_output_function_label.
	(TARGET_ASM_FUNCTION_PROLOGUE): define.
	* config/pa/pa-protos.h (pa_output_function_label): Declare.
	* config/pa/pa.c (pa_output_function_prologue): Add ATTRIBUTE_UNUSED
	to declaration.
	(pa_linux_output_function_prologue): Declare.
	(TARGET_ASM_FUNCTION_PROLOGUE): Delete define.
	(pa_output_function_label): New.
	(pa_output_function_prologue): Revise to use pa_output_function_label.
	(pa_linux_output_function_prologue): New.
	* config/pa/pa.h (TARGET_ASM_FUNCTION_PROLOGUE): Define.

From-SVN: r272061
2019-06-07 23:20:44 +00:00
GCC Administrator a24e8db469 Daily bump.
From-SVN: r272026
2019-06-07 00:16:15 +00:00
Joseph Myers ee78955ad9 * sv.po: Update.
From-SVN: r272020
2019-06-07 00:15:26 +01:00
Richard Biener 6ea3780cab Backport PRs 90328, 90402, 90450, 90474
2019-06-06  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-05-22  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90450
	* tree-ssa-loop-im.c (struct im_mem_ref): Add ref_decomposed.
	(mem_ref_hasher::equal): Check it.
	(mem_ref_alloc): Initialize it.
	(gather_mem_refs_stmt): Set it.

	2019-05-15  Richard Biener  <rguenther@suse.de>

	PR c/90474
	* c-common.c (c_common_mark_addressable_vec): Also mark
	a COMPOUND_LITERAL_EXPR_DECL addressable similar to
	c_mark_addressable.

	2019-05-13  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90402
	* tree-if-conv.c (tree_if_conversion): Value number only
	the loop body by making the latch an exit of the region
	as well.
	* tree-ssa-sccvn.c (process_bb): Add flag whether to skip
	processing PHIs.
	(do_rpo_vn): Deal with multiple edges into the entry block
	that are not backedges inside the region by skipping PHIs
	of the entry block.

	* gcc.dg/torture/pr90402-1.c: New testcase.

	2019-05-06  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90328
	* tree-data-ref.h (dr_may_alias_p): Pass in the actual loop nest.
	* tree-data-ref.c (dr_may_alias_p): Check whether the clique
	is valid in the loop nest before using it.
	(initialize_data_dependence_relation): Adjust.
	* graphite-scop-detection.c (build_alias_set): Pass the SCOP enclosing
	loop as loop-nest to dr_may_alias_p.

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

From-SVN: r271995
2019-06-06 11:06:45 +00:00
GCC Administrator 178bc11009 Daily bump.
From-SVN: r271981
2019-06-06 00:16:14 +00:00
Eric Botcazou 00acb8f17e fold-const.c (extract_muldiv_1): Do not distribute a multiplication by a power-of-two value.
* fold-const.c (extract_muldiv_1) <PLUS_EXPR>: Do not distribute a
	multiplication by a power-of-two value.
	(fold_plusminus_mult_expr): Use pow2p_hwi to spot a power-of-two value
	and turn the modulo operation into a masking operation.

From-SVN: r271964
2019-06-05 14:21:37 +00:00
Jakub Jelinek 2cb7bee247 re PR debug/90733 (ICE in simplify_subreg, at simplify-rtx.c:6440)
PR debug/90733
	* var-tracking.c (vt_expand_loc_callback): Don't create raw subregs
	with VOIDmode inner operands.

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

From-SVN: r271960
2019-06-05 14:22:22 +02:00
Jakub Jelinek 804b831eab backport: re PR c++/90598 (Return type of explicit destructor call wrong)
Backported from mainline
	2019-05-29  Jakub Jelinek  <jakub@redhat.com>

	PR c++/90598
	* tree.c (lvalue_kind): Return clk_none for expressions with
	with VOID_TYPE_P.

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

	2019-05-02  Jonathan Wakely  <jwakely@redhat.com>

	* testsuite/experimental/propagate_const/requirements2.cc: Adjust
	dg-error.

From-SVN: r271959
2019-06-05 14:21:27 +02:00
Jakub Jelinek 371a0cba5e backport: re PR libgomp/90641 (libgomp.c-c++-common/lastprivate-conditional-1.c etc FAIL)
Backported from mainline
	2019-05-27  Jakub Jelinek  <jakub@redhat.com>

	PR libgomp/90641
	* work.c (gomp_init_work_share): Instead of aligning final ordered
	value to multiples of long long alignment, align to that the
	first part (ordered team ids) and if inline_ordered_team_ids
	is not on a long long alignment boundary within the structure,
	use __alignof__ (long long) - 1 pad size always.
	* loop.c (GOMP_loop_start): Fix *mem computation if
	inline_ordered_team_ids is not aligned on long long alignment boundary
	within the structure.
	* loop-ull.c (GOMP_loop_ull_start): Likewise.
	* sections.c (GOMP_sections2_start): Likewise.

From-SVN: r271958
2019-06-05 14:19:00 +02:00
Jakub Jelinek aaaa6abfeb backport: re PR libgomp/90585 (libgomp hsa plugin ftbfs in the x32 multilib variant)
Backported from mainline
	2019-05-24  Jakub Jelinek  <jakub@redhat.com>

	PR libgomp/90585
	* plugin/plugin-hsa.c (print_kernel_dispatch, run_kernel): Use PRIu64
	macro instead of "lu".
	(release_kernel_dispatch): Likewise.  Cast shadow->debug to uintptr_t
	before casting to void *.

From-SVN: r271957
2019-06-05 14:18:23 +02:00
Iain Sandoe 1afda327df backport documentation for target supports (mfentry availability).
This was missed with the backport of the mfentry changes for
Darwin, and documents the target-supports addition only. (NFC).

Corrected ChangeLog

gcc/

2019-06-05  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-23  Iain Sandoe  <iain@sandoe.co.uk>
	* doc/sourcebuild.texi: Document mfentry target support.

From-SVN: r271951
2019-06-05 08:27:37 +00:00
GCC Administrator e8281ff16d Daily bump.
From-SVN: r271943
2019-06-05 00:16:16 +00:00
GCC Administrator 78f67f622e Daily bump.
From-SVN: r271898
2019-06-04 00:16:13 +00:00
Jonathan Wakely f390c64fac PR libstdc++/90700 Fix constructor constraint for std::tuple
* include/std/tuple
	(tuple(allocator_arg_t, const A&, const tuple<UTypes...>&)): Fix
	value category of template argument to _TC::_NonNestedTuple.
	* testsuite/20_util/tuple/cons/90700.cc: New test.

From-SVN: r271887
2019-06-03 23:31:45 +01:00
Joseph Myers b88c76903a * sv.po: Update.
From-SVN: r271886
2019-06-03 23:22:06 +01:00
Jonathan Wakely d9122e26d0 PR libstdc++/90686 update C++2a library status docs
PR libstdc++/90686
	* doc/xml/manual/status_cxx2014.xml: Document what's missing from
	<experimental/memory_resource>.
	* doc/xml/manual/status_cxx2020.xml: Document status of P0777R1,
	P0339R6, P0340R3, P1164R1 and P1357R1.
	* doc/html/*: Regenerate.

From-SVN: r271872
2019-06-03 15:05:50 +01:00
Jonathan Wakely 2a4405e3ba Implement missing piece of P0777R1 for std::make_from_tuple
* include/std/tuple (make_from_tuple): Use remove_reference_t instead
	of decay_t (P0777R1).

From-SVN: r271871
2019-06-03 15:05:46 +01:00
GCC Administrator 72481bc926 Daily bump.
From-SVN: r271851
2019-06-03 00:16:14 +00:00
GCC Administrator d642d046fe Daily bump.
From-SVN: r271842
2019-06-02 00:16:18 +00:00
GCC Administrator d7778634e8 Daily bump.
From-SVN: r271831
2019-06-01 00:16:13 +00:00
Joseph Myers 1ed080148c * fi.po, sv.po: Update.
From-SVN: r271797
2019-05-31 01:32:01 +01:00
GCC Administrator 446db06fc3 Daily bump.
From-SVN: r271794
2019-05-31 00:16:12 +00:00
Marek Polacek 2fda457ca1 * lang.opt (ftail-call-workaround): Fix a typo.
From-SVN: r271778
2019-05-30 12:19:40 +00:00
Jonathan Wakely 284da72604 Backport libstdc++ documentation updates from mainline
* doc/xml/manual/status_cxx2017.xml: Fix typo in documentation of
	implementation-defined support for [fs.conform.9945].
	* doc/xml/manual/status_cxx2020.xml: Add feature-test macro for
	P0811R3. Change status of P1353R0.
	* doc/html/*: Regenerate.

From-SVN: r271775
2019-05-30 11:34:44 +01:00
Jakub Jelinek 396d2098ee tree-predcom.c (is_inv_store_elimination_chain): Fix a typo - lenght to length.
* tree-predcom.c (is_inv_store_elimination_chain): Fix a typo - lenght
	to length.

	* lang.opt (ftail-call-workaround=): Fix a typo - lenghts to lengths.

From-SVN: r271771
2019-05-30 11:34:26 +02:00
Iain Sandoe f5f9cea667 Darwin, x86 - backport fix for mfentry test fails.
This will fix the cases by UNSUPPORTING for any target that cannot
support mfentry (including Linux -fpic -m32).

gcc/

2019-05-30  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-23  Iain Sandoe  <iain@sandoe.co.uk>

	* config/i386/darwin.h: Reject -mfentry*.
	* doc/sourcebuild.texi: Document mfentry target support.

gcc/testsuite/

2019-05-30  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-23  Iain Sandoe  <iain@sandoe.co.uk>

       * lib/target-supports.exp (check_effective_target_mfentry): New.
       * gcc.target/i386/fentry-override.c: Require effective target mfentry.
       * gcc.target/i386/fentry.c: Likewise
       * gcc.target/i386/fentryname1.c: Likewise
       * gcc.target/i386/fentryname2.c: Likewise
       * gcc.target/i386/fentryname3.c: Likewise
       * gcc.target/i386/nop-mcount.c: Likewise
       * gcc.target/i386/pr82699-2.c: Likewise
       * gcc.target/i386/pr82699-4.c: Likewise
       * gcc.target/i386/pr82699-5.c: Likewise
       * gcc.target/i386/pr82699-6.c: Likewise
       * gcc.target/i386/returninst1.c: Likewise
       * gcc.target/i386/returninst2.c: Likewise
       * gcc.target/i386/returninst3.c : Likewise

From-SVN: r271767
2019-05-30 08:06:38 +00:00
Iain Sandoe 6fbba0c7ce Darwin, backport fix for PR82920 part3 (other CET test fixes).
gcc/testsuite/

2019-05-30  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-15  Iain Sandoe  <iain@sandoe.co.uk>

	PR target/82920
	* g++.dg/cet-notrack-1.C: Adjust scan assembler for Darwin.
	* gcc.target/i386/cet-notrack-5a.c: Likewise.
	* gcc.target/i386/cet-notrack-5b.c: Likewise.
	* gcc.target/i386/cet-notrack-6b.c: Likewise.
	* gcc.target/i386/cet-notrack-icf-1.c: Likewise.
	* gcc.target/i386/cet-notrack-icf-2.c: Likewise.
	* gcc.target/i386/cet-notrack-icf-3.c: Likewise.
	* gcc.target/i386/cet-notrack-icf-4.c: Likewise.
	* gcc.target/i386/cet-sjlj-3.c: Likewise.
	* gcc.target/i386/cet-sjlj-5.c: Likewise.

From-SVN: r271766
2019-05-30 08:00:45 +00:00
Iain Sandoe 914ded4e81 Darwin, backport fix for PR82920 part2 (mx32 is not supported)
gcc/

2019-05-30  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-12  Iain Sandoe  <iain@sandoe.co.uk>

	PR target/82920
	* config/i386/darwin.h (CC1_SPEC): Report -mx32 as an error for
	Darwin.

gcc/testsuite/

2019-05-30  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-14  Iain Sandoe  <iain@sandoe.co.uk>

	PR target/82920
	* gcc.target/i386/cet-sjlj-6b.c: Require effective target x32.
	* gcc.target/i386/pr52146.c: Likewise.
	* gcc.target/i386/pr52698.c: Likewise.
	* gcc.target/i386/pr52857-1.c: Likewise.
	* gcc.target/i386/pr52857-2.c: Likewise.
	* gcc.target/i386/pr52876.c: Likewise.
	* gcc.target/i386/pr53698.c: Likewise.
	* gcc.target/i386/pr54157.c: Likewise.
	* gcc.target/i386/pr55049-1.c: Likewise.
	* gcc.target/i386/pr55093.c: Likewise.
	* gcc.target/i386/pr55116-1.c: Likewise.
	* gcc.target/i386/pr55116-2.c: Likewise.
	* gcc.target/i386/pr55597.c: Likewise.
	* gcc.target/i386/pr59929.c: Likewise.
	* gcc.target/i386/pr66470.c: Likewise.

From-SVN: r271765
2019-05-30 07:56:10 +00:00
Iain Sandoe 9b86c15f62 Darwin, backport fix for pr82920 (part1, code)
gcc/

2019-05-30  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-12  Iain Sandoe  <iain@sandoe.co.uk>

	PR target/82920
	* config/i386/i386.c (ix86_output_jmp_thunk_or_indirect): New.
	(ix86_output_indirect_branch_via_reg): Use output mechanism
	accounting for __USER_LABEL_PREFIX__.
	(ix86_output_indirect_branch_via_push): Likewise.
	(ix86_output_function_return): Likewise.
	(ix86_output_indirect_function_return): Likewise.

gcc/testsuite/

2019-05-30  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-12  Iain Sandoe  <iain@sandoe.co.uk>
	    Dominique d'Humieres  <dominiq@gcc.gnu.org>

	PR target/82920
	* gcc.target/i386/indirect-thunk-1.c: Adjust scan-asms for Darwin,
	do not use -fno-pic on Darwin.
	* gcc.target/i386/indirect-thunk-2.c: Likewise.
	* gcc.target/i386/indirect-thunk-3.c: Likewise.
	* gcc.target/i386/indirect-thunk-4.c: Likewise.
	* gcc.target/i386/indirect-thunk-7.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-1.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-2.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-3.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-4.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-5.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-6.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-7.c: Likewise.
	* gcc.target/i386/indirect-thunk-attr-8.c: Likewise.
	* gcc.target/i386/indirect-thunk-extern-1.c: Likewise.
	* gcc.target/i386/indirect-thunk-extern-2.c: Likewise.
	* gcc.target/i386/indirect-thunk-extern-3.c: Likewise.
	* gcc.target/i386/indirect-thunk-extern-4.c: Likewise.
	* gcc.target/i386/indirect-thunk-extern-7.c: Likewise.
	* gcc.target/i386/indirect-thunk-inline-1.c: Likewise.
	* gcc.target/i386/indirect-thunk-inline-2.c: Likewise.
	* gcc.target/i386/indirect-thunk-inline-3.c: Likewise.
	* gcc.target/i386/indirect-thunk-inline-4.c: Likewise.
	* gcc.target/i386/indirect-thunk-inline-7.c: Likewise.
	* gcc.target/i386/indirect-thunk-register-1.c: Likewise.
	* gcc.target/i386/indirect-thunk-register-2.c: Likewise.
	* gcc.target/i386/indirect-thunk-register-3.c: Likewise.
	* gcc.target/i386/indirect-thunk-register-4.c: Likewise.
	* gcc.target/i386/ret-thunk-1.c: Likewise.
	* gcc.target/i386/ret-thunk-10.c: Likewise.
	* gcc.target/i386/ret-thunk-11.c: Likewise.
	* gcc.target/i386/ret-thunk-12.c: Likewise.
	* gcc.target/i386/ret-thunk-13.c: Likewise.
	* gcc.target/i386/ret-thunk-14.c: Likewise.
	* gcc.target/i386/ret-thunk-15.c: Likewise.
	* gcc.target/i386/ret-thunk-16.c: Likewise.
	* gcc.target/i386/ret-thunk-2.c: Likewise.
	* gcc.target/i386/ret-thunk-22.c: Likewise.
	* gcc.target/i386/ret-thunk-23.c: Likewise.
	* gcc.target/i386/ret-thunk-24.c: Likewise.
	* gcc.target/i386/ret-thunk-3.c: Likewise.
	* gcc.target/i386/ret-thunk-4.c: Likewise.
	* gcc.target/i386/ret-thunk-5.c: Likewise.
	* gcc.target/i386/ret-thunk-6.c: Likewise.
	* gcc.target/i386/ret-thunk-7.c: Likewise.
	* gcc.target/i386/ret-thunk-8.c: Likewise.
	* gcc.target/i386/ret-thunk-9.c: Likewise.

From-SVN: r271764
2019-05-30 07:51:32 +00:00
GCC Administrator 931fdc2d70 Daily bump.
From-SVN: r271759
2019-05-30 00:16:13 +00:00
Jakub Jelinek ba33514340 re PR fortran/90329 (Incompatibility between gfortran and C lapack calls)
PR fortran/90329
	* lto-streamer.h (LTO_minor_version): Bump to 1.

	Backported from mainline
	2019-05-29  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/90329
	* lang.opt (fbroken-callers): Remove.
	(ftail-call-workaround, ftail-call-workaround=): New options.
	* gfortran.h (struct gfc_namespace): Add implicit_interface_calls.
	* interface.c (gfc_procedure_use): Set implicit_interface_calls
	for calls to implicit interface procedures.
	* trans-decl.c (create_function_arglist): Use flag_tail_call_workaround
	instead of flag_broken_callers.  If it is not 2, also require
	sym->ns->implicit_interface_calls.
	* invoke.texi (fbroken-callers): Remove documentation.
	(ftail-call-workaround, ftail-call-workaround=): Document.

	2019-05-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/90329
	* invoke.texi: Document -fbroken-callers.
	* lang.opt: Add -fbroken-callers.
	* trans-decl.c (create_function_arglist): Only set
	DECL_HIDDEN_STRING_LENGTH if flag_broken_callers is set.

	2019-05-16  Jakub Jelinek  <jakub@redhat.com>

	PR fortran/90329
	* tree-core.h (struct tree_decl_common): Document
	decl_nonshareable_flag for PARM_DECLs.
	* tree.h (DECL_HIDDEN_STRING_LENGTH): Define.
	* calls.c (expand_call): Don't try tail call if caller
	has any DECL_HIDDEN_STRING_LENGTH PARM_DECLs that are or might be
	passed on the stack and callee needs to pass any arguments on the
	stack.
	* tree-streamer-in.c (unpack_ts_decl_common_value_fields): Use
	else if instead of series of mutually exclusive ifs.  Handle
	DECL_HIDDEN_STRING_LENGTH for PARM_DECLs.
	* tree-streamer-out.c (pack_ts_decl_common_value_fields): Likewise.

	* trans-decl.c (create_function_arglist): Set
	DECL_HIDDEN_STRING_LENGTH on hidden string length PARM_DECLs if
	len is constant.

From-SVN: r271743
2019-05-29 17:55:12 +02:00
Jakub Jelinek 99bc5b3847 re PR bootstrap/90543 (Build failure on MINGW for gcc-9.1.0)
PR bootstrap/90543
	* optc-save-gen.awk: In cl_optimization_print, use correct condition
	for var_opt_string printing.  In cl_optimization_print_diff, print
	(null) instead of invoking undefined behavior if one of the
	var_opt_string pointers is NULL and use && instead of first || in the
	guarding condition.  For var_target_other options, handle const char *
	target variables similarly to const char * optimize node variables.

From-SVN: r271737
2019-05-29 11:35:34 +02:00
GCC Administrator 1f9190870c Daily bump.
From-SVN: r271725
2019-05-29 00:16:13 +00:00
John David Anglin bee4cbe6aa pa.c (hppa_profile_hook): Remove offset adjustment.
* config/pa/pa.c (hppa_profile_hook): Remove offset adjustment.

From-SVN: r271721
2019-05-28 23:28:02 +00:00
Jonathan Wakely f6c3f81830 PR libstdc++/90634 reduce allocations in filesystem::path construction
Backport from mainline
2019-05-28  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90634
	* include/experimental/bits/fs_path.h (path::path(path&&)): Only call
	_M_split_cmpts() for a path with multiple components.
	(path::_S_is_dir_sep()): Add missing 'static' keyword to function.
	* src/filesystem/path.cc (path::_M_split_cmpts()): Count number of
	components and reserve space in vector. Return early when there is
	only one component.
	* testsuite/27_io/filesystem/path/construct/90634.cc: New test.
	* testsuite/experimental/filesystem/path/construct/90634.cc: New test.

From-SVN: r271719
2019-05-28 21:48:31 +01:00
Jonathan Wakely 9c0c04ee74 Fix C++14-only code in testsuite utility
* testsuite/util/testsuite_fs.h (compare_paths): Use three-argument
	form of std::equals for C++11 compatibility.

From-SVN: r271718
2019-05-28 21:48:23 +01:00
Marek Polacek 8fcaf49b59 PR c++/90548 - ICE with generic lambda and empty pack.
* pt.c (tsubst_copy_and_build): Handle pack expansion properly.

	* g++.dg/cpp1y/lambda-generic-90548.C: New test.

From-SVN: r271708
2019-05-28 14:16:38 +00:00
Eric Botcazou 8751a970d7 trans.c (lvalue_required_for_attribute_p): Return 0 for 'Size too.
* gcc-interface/trans.c (lvalue_required_for_attribute_p): Return 0
	for 'Size too.
	(Identifier_to_gnu): Use the actual subtype for a reference to a
	packed array in a return statement.
	(Attribute_to_gnu) <Attr_Size>: Do not strip VIEW_CONVERT_EXPRs from
	the prefix in every case.

From-SVN: r271692
2019-05-28 08:25:45 +00:00
Eric Botcazou 54caef1543 trans.c (gnat_to_gnu): Remove superfluous tests on Backend_Overflow_Checks_On_Target and rework comments.
* gcc-interface/trans.c (gnat_to_gnu): Remove superfluous tests on
	Backend_Overflow_Checks_On_Target and rework comments.

From-SVN: r271690
2019-05-28 08:13:50 +00:00
Eric Botcazou 56bf2cee02 trans.c (walk_nesting_tree): New static function.
* gcc-interface/trans.c (walk_nesting_tree): New static function.
	(finalize_nrv): Use it to walk the entire nesting tree.

From-SVN: r271686
2019-05-28 08:03:08 +00:00
Eric Botcazou 837f293ffe decl.c (gnat_to_gnu_entity): Remove obsolete test on Is_For_Access_Subtype.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Subtype>: Remove
	obsolete test on Is_For_Access_Subtype.

From-SVN: r271684
2019-05-28 07:43:17 +00:00
Eric Botcazou 90a000b848 decl.c (components_to_record): Set a name on the type created for the REP part, if any.
* gcc-interface/decl.c (components_to_record): Set a name on the type
	created for the REP part, if any.
	* gcc-interface/utils.c (finish_record_type): Only take the maximum
	when merging sizes for a variant part at offset 0.
	(merge_sizes): Rename has_rep parameter into max.

From-SVN: r271682
2019-05-28 07:40:07 +00:00
GCC Administrator 6ca3289f80 Daily bump.
From-SVN: r271676
2019-05-28 00:16:16 +00:00
Eric Botcazou 1416fdb015 dwarf2out.c (resolve_args_picking_1): Deal with DW_OP_GNU_addr_index and DW_OP_GNU_const_index opcodes.
* dwarf2out.c (resolve_args_picking_1): Deal with DW_OP_GNU_addr_index
	and DW_OP_GNU_const_index opcodes.

From-SVN: r271665
2019-05-27 16:12:41 +00:00
Eric Botcazou ca805701be trans.c (Call_to_gnu): Do not initialize the temporary created out of addressability concerns if...
* gcc-interface/trans.c (Call_to_gnu): Do not initialize the temporary
	created out of addressability concerns if it's for the _Init parameter
	of an initialization procedure.

From-SVN: r271660
2019-05-27 11:44:05 +00:00
Eric Botcazou b8b0a7dc69 utils.c (maybe_pad_type): Issue the warning for the specific case of component types preferably.
* gcc-interface/utils.c (maybe_pad_type): Issue the warning for the
	specific case of component types preferably.

From-SVN: r271656
2019-05-27 11:12:57 +00:00
Eric Botcazou bab0c45bd7 trans.c (Identifier_to_gnu): Minor tweaks.
* gcc-interface/trans.c (Identifier_to_gnu): Minor tweaks.
	(gnat_to_gnu): Do not convert the result if it is a reference to an
	unconstrained array used as the prefix of an attribute reference that
	requires an lvalue.

From-SVN: r271654
2019-05-27 11:07:05 +00:00
Eric Botcazou 8408ade283 trans.c (Gigi_Types_Compatible): New predicate.
* gcc-interface/trans.c (Gigi_Types_Compatible): New predicate.
	(Identifier_to_gnu): Use it to assert that the type of the identifier
	and that of its entity are compatible for gigi.  Rename a couple of
	local variables and separate the processing of the result type.

From-SVN: r271651
2019-05-27 10:48:48 +00:00
Eric Botcazou d450e65582 trans.c (Call_to_gnu): Use the unpadded type when putting back an intermediate conversion the type of...
* gcc-interface/trans.c (Call_to_gnu): Use the unpadded type when
	putting back an intermediate conversion the type of the actuals.

From-SVN: r271648
2019-05-27 10:25:17 +00:00
GCC Administrator edb4ad30c8 Daily bump.
From-SVN: r271643
2019-05-27 00:16:15 +00:00
Ian Lance Taylor e1248f41ed re PR go/90635 (typo in libgo/configure.ac)
PR go/90635
    libgo: correct typo in USE_LIBFFI AM_CONDITIONAL
    
    Only affects the case of passing --without-libffi to configure.
    
    Fixes https://gcc.gnu.org/PR90635
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/178998

From-SVN: r271639
2019-05-27 00:13:52 +00:00
Ian Lance Taylor 53cc4f0042 re PR go/90614 (gcc-9.1.0/libgo/go/syscall/wait.c:54:22: error: unused parameter ‘w’ [-Werror=unused-parameter] Continued (uint32_t *w))
PR go/90614
    syscall: avoid unused parameter error if WIFCONTINUED not defined
    
    Fixes https://gcc.gnu.org/PR90614
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/178997

From-SVN: r271637
2019-05-27 00:10:22 +00:00
John David Anglin 3f1a94a570 linux-unwind.h (pa32_fallback_frame_state): Add cast.
* config/pa/linux-unwind.h (pa32_fallback_frame_state): Add cast.

From-SVN: r271632
2019-05-26 15:19:12 +00:00
GCC Administrator 21bf2b84af Daily bump.
From-SVN: r271626
2019-05-26 00:16:12 +00:00
Marek Polacek 3d39d5a63a PR c++/90572 - wrong disambiguation in friend declaration.
* parser.c (cp_parser_constructor_declarator_p): Don't allow missing
	typename for friend declarations.

	* g++.dg/cpp2a/typename16.C: New test.
	* g++.dg/parse/friend13.C: New test.

From-SVN: r271620
2019-05-25 14:46:15 +00:00
GCC Administrator ebf06049dd Daily bump.
From-SVN: r271617
2019-05-25 00:16:13 +00:00
John David Anglin 7a5e7df8d4 re PR target/90530 (Invalid SUBREG insn generated by reload)
PR target/90530
	* config/pa/pa.c (pa_can_change_mode_class): Accept mode changes from
	DImode to SImode in floating-point registers on 64-bit target.
	* config/pa/pa.md (umulsidi3): Change nonimmediate_operand to
	register_operand in xmpyu patterns.

From-SVN: r271612
2019-05-24 23:15:49 +00:00
Jonathan Wakely 75addbfa7f Fix std::midpoint(T*, T*) for reversed arguments
Backport from mainline
2019-05-24  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/numeric (midpoint(T*, T*)): Fix incorrect result.
	* testsuite/26_numerics/midpoint/pointer.cc: Change "compile" test
	to "run".

From-SVN: r271609
2019-05-24 17:09:37 +01:00
Jonathan Wakely 5a3cf0e5f9 Fix uses of non-reserved names for template parameters
Backport from mainline
2019-05-17  Jonathan Wakely  <jwakely@redhat.com>

	* include/bits/random.h (seed_seq::param): Fix non-reserved name.
	* include/experimental/type_traits (is_detected_exact)
	(is_detected_exact_v): Likewise.
	* include/pstl/execution_defs.h (is_execution_policy)
	(is_execution_policy_v, __enable_if_execution_policy): Likewise.
	* include/pstl/execution_impl.h (__policy_traits): Likewise.
	* testsuite/17_intro/names.cc: Check for more non-reserved names.
	* testsuite/experimental/names.cc: New test.

From-SVN: r271608
2019-05-24 17:09:33 +01:00
Jonathan Wakely 588a873a86 PR libstdc++/85965 move is_invocable assertions again
This is another attempt to reduce how often the assertions are
evaluated, so that code which doesn't try to use the function objects
doesn't need them to be invocable.

For _Rb_tree we access the _M_key_compare object directly, so can't put
the assertions in an accessor function for it. However, every invocation
of _M_key_compare is accompanied by a use of _S_key, so the assertions
can be put in there.  For _Hashtable there are member functions that are
consistently used to obtain a hash code or test for equality, so the
assertions can go in those members.

Backport from mainline
2019-05-17  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/85965
	* include/bits/hashtable.h (_Hashtable::~_Hashtable()): Remove static
	assertions from the destructor.
	* include/bits/hashtable_policy.h (_Hash_code_base::_M_hash_code):
	Move static_assert for hash function to here.
	(_Hash_table_base::_M_equals): Move static_assert for equality
	predicate to here.
	* include/bits/stl_tree.h (_Rb_tree::_S_key(_Const_Link_type)): Move
	assertions here. Access the value directly instead of calling _S_value.
	(_Rb_tree::_S_key(_Const_Base_ptr)): Do downcast and forward to
	_S_key(_Const_Link_type).
	* testsuite/23_containers/set/85965.cc: Check construction,
	destruction, assignment and size() do not trigger the assertions.
	* testsuite/23_containers/unordered_set/85965.cc: Likewise.
	* testsuite/23_containers/map/48101_neg.cc: Call find and adjust
	expected errors.
	* testsuite/23_containers/multimap/48101_neg.cc: Likewise.
	* testsuite/23_containers/multiset/48101_neg.cc: Likewise.
	* testsuite/23_containers/set/48101_neg.cc: Likewise.
	* testsuite/23_containers/unordered_map/48101_neg.cc: Likewise.
	* testsuite/23_containers/unordered_multimap/48101_neg.cc: Likewise.
	* testsuite/23_containers/unordered_multiset/48101_neg.cc: Likewise.
	* testsuite/23_containers/unordered_set/48101_neg.cc: Likewise.

From-SVN: r271607
2019-05-24 17:09:28 +01:00
Martin Liska b8e1dc7573 Backport r271548
2019-05-24  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-05-23  Martin Liska  <mliska@suse.cz>

	PR sanitizer/90570
	* gimplify.c (gimplify_target_expr): Skip TREE_STATIC target
	expression similarly to gimplify_decl_expr.
2019-05-24  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-05-23  Martin Liska  <mliska@suse.cz>

	PR sanitizer/90570
	* g++.dg/asan/pr90570.C: New test.

From-SVN: r271593
2019-05-24 07:43:48 +00:00
GCC Administrator 2afd1c6ba8 Daily bump.
From-SVN: r271587
2019-05-24 00:16:21 +00:00
Jonathan Wakely c7167c1b69 Make any_cast compare typeinfo as well as function pointers
It's possible for the function pointer comparison to fail even though
the type is correct, because the function could be defined multiple
times with different addresses when shared libraries are in use.

Retain the function pointer check for the common case where the check
succeeds, but compare typeinfo (if RTTI is enabled) if the first check
fails.

Backport from mainline
2019-05-23  Jonathan Wakely  <jwakely@redhat.com>

	* include/experimental/any (__any_caster): Use RTTI if comparing
	addresses fails, to support non-unique addresses in shared libraries.
	* include/std/any (__any_caster): Likewise.
	* testsuite/experimental/any/misc/any_cast_neg.cc: Use 0 for dg-error
	line number.

From-SVN: r271559
2019-05-23 15:18:18 +01:00
Jonathan Wakely 8e355a1c3b PR libstdc++/90220 fix experimental::any_cast for non-object types
This corresponds to the fixes done for std::any_cast, but has to be done
without if-constexpr. The dummy specialization of _Manager_internal<_Op>
is used to avoid instantiating the real _Manager_internal<T>::_S_manage
function just to compare its address.

Backport from mainline
2019-05-23  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90220
	* include/experimental/any (__any_caster): Constrain to only be
	callable for object types. Use remove_cv_t instead of decay_t.
	If the type decays or isn't copy constructible, compare the manager
	function to a dummy specialization.
	(__any_caster): Add overload constrained for non-object types.
	(any::_Manager_internal<_Op>): Add dummy specialization.
	* testsuite/experimental/any/misc/any_cast.cc: Test function types
	and array types.

From-SVN: r271558
2019-05-23 15:18:13 +01:00
Eric Botcazou dc172b9806 * c-ada-spec.c (compare_node): Compare the DECL_UIDs as a last resort.
From-SVN: r271550
2019-05-23 10:35:30 +00:00
Eric Botcazou 4e5d65da6f * gnat.dg/opt78.ad[sb]: New test.
From-SVN: r271546
2019-05-23 09:50:21 +00:00
GCC Administrator e026fa3459 Daily bump.
From-SVN: r271533
2019-05-23 00:16:14 +00:00
Jonathan Wakely 14c551fccf PR libstdc++/90557 fix path assignment that alters source
Backport from mainline
2019-05-22  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90557
	* src/c++17/fs_path.cc (path::_List::operator=(const _List&)): Fix
	reversed arguments to uninitialized_copy_n.
	* testsuite/27_io/filesystem/path/assign/copy.cc: Check that source
	is unchanged by copy assignment.
	* testsuite/util/testsuite_fs.h (compare_paths): Use std::equal to
	compare path components.

From-SVN: r271528
2019-05-22 23:36:21 +01:00
Uros Bizjak 6080857e5a backport: re PR target/90547 (ICE in gen_lowpart_general, at rtlhooks.c:63)
Backported from mainline
	2019-05-21  Uroš Bizjak  <ubizjak@gmail.com>

	* config/i386/cpuid.h (__cpuid): For 32bit targets, zero
	%ebx and %ecx bafore calling cpuid with leaf 1 or
	non-constant leaf argument.

	2019-05-21  Uroš Bizjak  <ubizjak@gmail.com>

	PR target/90547
	* config/i386/i386.md (anddi_1 to andsi_1_zext splitter):
	Avoid calling gen_lowpart with CONST operand.

testsuite/ChangeLog:

	Backported from mainline
	2019-05-21  Uroš Bizjak  <ubizjak@gmail.com>

	PR target/90547
	* gcc.target/i386/pr90547.c: New test.

From-SVN: r271516
2019-05-22 20:49:22 +02:00
GCC Administrator 1db5db214a Daily bump.
From-SVN: r271495
2019-05-22 00:16:18 +00:00
Janne Blomqvist 15ad66669e libfortran/90038: Document new wait=.false. implementation
2019-05-21  Janne Blomqvist  <jb@gcc.gnu.org>

       PR libfortran/90038
       * intrinsic.texi (EXECUTE_COMMAND_LINE): Explain new
       wait=.false. implementation.

From-SVN: r271470
2019-05-21 18:24:30 +03:00
Sebastian Huber 204d3f53c6 [RTEMS] Change multilibs for ARM
Account for Cortex-M3 Errata 602117.  The -mfix-cortex-m3-ldrd option is
enabled by default, if -mcpu=cortex-m3 is used.

gcc/

	* config/arm/t-rtems: Replace ARMv7-M multilibs with Cortex-M
	multilibs.

From-SVN: r271452
2019-05-21 04:41:23 +00:00
GCC Administrator 27fa84eae5 Daily bump.
From-SVN: r271448
2019-05-21 00:16:12 +00:00
Joseph Myers 7c236e894e * es.po, sv.po: Update.
From-SVN: r271444
2019-05-20 23:22:58 +01:00
Jakub Jelinek 357a67c1a7 re PR libgomp/90527 (alloc.c:72:7: error: implicit declaration of function ‘posix_memalign’)
PR libgomp/90527
	* alloc.c (_GNU_SOURCE): Define.

From-SVN: r271439
2019-05-20 23:29:49 +02:00
Jeff Law 13d9be956e mips.c (mips_dwarf_frame_reg_mode): Replace TARGET_FLOAT64 with !TARGET_FLOAT32, thus handling both fp64 and fpxx modes.
* config/mips/mips.c (mips_dwarf_frame_reg_mode): Replace
	TARGET_FLOAT64 with !TARGET_FLOAT32, thus handling both fp64
	and fpxx modes.

	* g++.dg/eh/o32-fp.C: New.
	* gcc.target/mips/dwarfregtable-1.c: New.
	* gcc.target/mips/dwarfregtable-2.c: New.
	* gcc.target/mips/dwarfregtable-3.c: New.
	* gcc.target/mips/dwarfregtable-4.c: New.
	* gcc.target/mips/dwarfregtable.h: New.

From-SVN: r271433
2019-05-20 13:08:18 -06:00
Janne Blomqvist 4bc35a9458 libfortran/90038 Use posix_spawn, reap dead children when wait=.false.
Backport from trunk.

When using posix_spawn or fork to launch a child process, the parent
needs to wait for the child, otherwise the dead child is left as a
zombie process. For this purpose one can install a signal handler for
SIGCHLD.

2019-05-20  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/90038
	* intrinsics/execute_command_line (sigchld_handler): New function.
        (execute_command_line): Install handler for SIGCHLD.
        * configure.ac: Check for presence of sigaction and waitpid.
        * config.h.in: Regenerated.
        * configure: Regenerated.

    
fork() semantics can be problematic.  Most unix style OS'es have
posix_spawn which can be used to replace fork + exec in many cases.
For more information see
e.g. https://www.microsoft.com/en-us/research/uploads/prod/2019/04/fork-hotos19.pdf
    
This replaces the one use of fork in libgfortran with posix_spawn.
    
2019-05-20  Janne Blomqvist  <jb@gcc.gnu.org>

        PR libfortran/90038
        * configure.ac (AC_CHECK_FUNCS_ONCE): Check for posix_spawn.
        * intrinsics/execute_command_line (execute_command_line): Use
        posix_spawn.
        * Makefile.in: Regenerated.
        * config.h.in: Regenerated.
        * configure: Regenerated.
    
Regtested on x86_64-pc-linux-gnu.

From-SVN: r271427
2019-05-20 20:43:05 +03:00
Jonathan Wakely d9940358fa PR c++/90532 Ensure __is_constructible(T[]) is false
An array of an unknown bound is an incomplete type, so no object of such
a type can be constructed. This means __is_constructible should always
be false for an array of unknown bound.

This patch also changes the std::is_default_constructible trait to use
std::is_constructible, which now gives the right answer for arrays of
unknown bound.

gcc/cp:

	Backported from mainline
	2019-05-20  Jonathan Wakely  <jwakely@redhat.com>

	PR c++/90532 Ensure __is_constructible(T[]) is false
	* method.c (is_xible_helper): Return error_mark_node for construction
	of an array of unknown bound.

gcc/testsuite:

	Backported from mainline
	2019-05-20  Jonathan Wakely  <jwakely@redhat.com>

	PR c++/90532 Ensure __is_constructible(T[]) is false
	* g++.dg/ext/90532.C: New test.

libstdc++-v3:

	Backported from mainline
	2019-05-20  Jonathan Wakely  <jwakely@redhat.com>

	PR c++/90532 Ensure __is_constructible(T[]) is false
	* include/std/type_traits (__do_is_default_constructible_impl)
	(__is_default_constructible_atom, __is_default_constructible_safe):
	Remove.
	(is_default_constructible): Use is_constructible.
	* testsuite/20_util/is_constructible/value.cc: Check int[] case.
	* testsuite/20_util/is_default_constructible/value.cc: Likewise.
	* testsuite/20_util/is_trivially_constructible/value.cc: Likewise.
	* testsuite/20_util/is_trivially_default_constructible/value.cc:
	Likewise.

From-SVN: r271417
2019-05-20 14:02:10 +01:00
GCC Administrator 955a6242cd Daily bump.
From-SVN: r271393
2019-05-20 00:16:42 +00:00
Paul Thomas 324470d4a2 re PR fortran/90498 (ICE with select type/associate and derived type argument containing class(*))
2019-05-19  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/90498
	* trans-stmt.c (trans_associate_var) Do not use the saved
	descriptor if the expression is a COMPONENT_REF.

2019-05-19  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/90498
	* gfortran.dg/associate_48.f90 : New test.

From-SVN: r271383
2019-05-19 18:08:28 +00:00
GCC Administrator 6c887c525c Daily bump.
From-SVN: r271374
2019-05-19 00:16:14 +00:00
GCC Administrator 2bb4c131fa Daily bump.
From-SVN: r271367
2019-05-18 00:16:12 +00:00
Jakub Jelinek 1d0679a129 re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=)
PR fortran/54613
	* gfortran.map (GFORTRAN_9.2): Export _gfortran_{,m,s}findloc{0,1}_r10.
	* Makefile.am (i_findloc0_c): Add $(srcdir)/generated/findloc0_r10.c.
	(i_findloc1_c): Add $(srcdir)/generated/findloc1_r10.c.
	* Makefile.in: Regenerated.
	* generated/findloc0_r10.c: Generated.
	* generated/findloc1_r10.c: Generated.

From-SVN: r271358
2019-05-17 21:56:14 +02:00
Jakub Jelinek d6a088c2a1 re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=)
PR fortran/54613
	* gfortran.map (GFORTRAN_9.2): New symbol version, export
	_gfortran_{,m,s}findloc0_i2 in it.

From-SVN: r271357
2019-05-17 21:54:46 +02:00
Jakub Jelinek 8dc08facbd backport: re PR c++/90484 (ICE in equal_mem_array_ref_p at gcc/tree-ssa-scopedtables.c:550 since r270433 on i586)
Backported from mainline
	2019-05-16  Jakub Jelinek  <jakub@redhat.com>

	PR c++/90484
	* tree-ssa-scopedtables.c (equal_mem_array_ref_p): Don't assert that
	sz0 is equal to sz1, instead return false in that case.

From-SVN: r271356
2019-05-17 21:54:15 +02:00
Jakub Jelinek a734d291f3 backport: omp-low.c (lower_rec_input_clauses): If OMP_CLAUSE_IF has non-constant expression...
Backported from mainline
	2019-05-16  Jakub Jelinek  <jakub@redhat.com>

	* omp-low.c (lower_rec_input_clauses): If OMP_CLAUSE_IF
	has non-constant expression, force sctx.lane and use two
	argument IFN_GOMP_SIMD_LANE instead of single argument.
	* tree-ssa-dce.c (eliminate_unnecessary_stmts): Don't DCE
	two argument IFN_GOMP_SIMD_LANE without lhs.
	* tree-vectorizer.h (struct _loop_vec_info): Add simd_if_cond
	member.
	(LOOP_VINFO_SIMD_IF_COND, LOOP_REQUIRES_VERSIONING_FOR_SIMD_IF_COND):
	Define.
	(LOOP_REQUIRES_VERSIONING): Or in
	LOOP_REQUIRES_VERSIONING_FOR_SIMD_IF_COND.
	* tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Initialize
	simd_if_cond.
	(vect_analyze_loop_2): Punt if LOOP_VINFO_SIMD_IF_COND is constant 0.
	* tree-vect-loop-manip.c (vect_loop_versioning): Add runtime check
	from simd if clause if needed.

	* gcc.dg/vect/vect-simd-1.c: New test.
	* gcc.dg/vect/vect-simd-2.c: New test.
	* gcc.dg/vect/vect-simd-3.c: New test.
	* gcc.dg/vect/vect-simd-4.c: New test.

From-SVN: r271355
2019-05-17 21:53:48 +02:00
Jakub Jelinek 0d50662086 backport: omp-low.c (lower_rec_input_clauses): For if (0) or simdlen (1) set max_vf to 1.
Backported from mainline
	2019-05-15  Jakub Jelinek  <jakub@redhat.com>

	* omp-low.c (lower_rec_input_clauses): For if (0) or simdlen (1) set
	max_vf to 1.
	* omp-expand.c (expand_omp_simd): For if (0) or simdlen (1) clear
	safelen_int and set loop->dont_vectorize.

	* c-c++-common/gomp/simd8.c: New test.

From-SVN: r271354
2019-05-17 21:52:55 +02:00
Jakub Jelinek 9ceaef52ee backport: re PR debug/90197 (Cannot step through simple loop at -O -g)
Backported from mainline
	2019-05-15  Jakub Jelinek  <jakub@redhat.com>

	PR debug/90197
	* cp-gimplify.c (genericize_cp_loop): Emit a DEBUG_BEGIN_STMT
	before the condition (or if missing or constant non-zero at the end
	of the loop.  Emit a DEBUG_BEGIN_STMT before the increment expression
	if any.  Don't call protected_set_expr_location on incr if it already
	has a location.

From-SVN: r271353
2019-05-17 21:52:06 +02:00
Jakub Jelinek b1abd54e2a backport: re PR tree-optimization/90385 (ICE: tree check: expected ssa_name, have real_cst in transform_to_exit_first_loop_alt, at tree-parloops.c:1772)
Backported from mainline
	2019-05-10  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/90385
	* tree-parloops.c (try_create_reduction_list): Punt on non-SSA_NAME
	arguments of the exit phis.

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

From-SVN: r271352
2019-05-17 21:51:32 +02:00
Jakub Jelinek 9708806882 backport: re PR c++/90383 (GCC generates invalid constexpr copy/move assignment operators for types with trailing padding. (Again))
Backported from mainline
	2019-05-10  Jakub Jelinek  <jakub@redhat.com>

	PR c++/90383
	* tree-inline.h (struct copy_body_data): Add do_not_fold member.
	* tree-inline.c (remap_gimple_op_r): Avoid folding expressions if
	id->do_not_fold.
	(copy_tree_body_r): Likewise.
	(copy_fn): Set id.do_not_fold to true.

	* g++.dg/cpp1y/constexpr-90383-1.C: New test.
	* g++.dg/cpp1y/constexpr-90383-2.C: New test.

From-SVN: r271351
2019-05-17 21:50:52 +02:00
Jakub Jelinek 37491dfb98 backport: re PR pch/90326 (Using any precompiled header breaks definition of FLT_MAX)
Backported from mainline
	2019-05-10  Jakub Jelinek  <jakub@redhat.com>

	PR pch/90326
cp/
	* config-lang.in (gtfiles): Remove c-family/c-lex.c, add
	c-family/c-cppbuiltin.c.
objc/
	* config-lang.in (gtfiles): Add c-family/c-format.c.
objcp/
	* config-lang.in (gtfiles): Don't add c-family/c-cppbuiltin.c.
testsuite/
	* g++.dg/pch/pr90326.C: New test.
	* g++.dg/pch/pr90326.Hs: New file.

From-SVN: r271350
2019-05-17 21:49:54 +02:00
Jakub Jelinek 3f888c29af backport: re PR tree-optimization/90303 (ICE in hash_odr_name with fastcall attribute starting with r267359)
Backported from mainline
	2019-05-03  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/90303
	* ipa-devirt.c (obj_type_ref_class, get_odr_type): Don't use
	TYPE_CANONICAL for TYPE_STRUCTURAL_EQUALITY_P types in !in_lto_p mode.

	* g++.target/i386/pr90303.C: New test.

From-SVN: r271349
2019-05-17 21:48:25 +02:00
Jakub Jelinek 90d816acfa backport: re PR debug/90197 (Cannot step through simple loop at -O -g)
Backported from mainline
	2019-04-26  Jakub Jelinek  <jakub@redhat.com>

	PR debug/90197
	* c-tree.h (c_finish_loop): Add 2 further location_t arguments.
	* c-parser.c (c_parser_while_statement): Adjust c_finish_loop caller.
	(c_parser_do_statement): Likewise.
	(c_parser_for_statement): Likewise.  Formatting fixes.
	* c-typeck.c (c_finish_loop): Add COND_LOCUS and INCR_LOCUS arguments,
	emit DEBUG_BEGIN_STMTs if needed.

From-SVN: r271348
2019-05-17 21:47:18 +02:00
Richard Biener 36f6476b80 backport: [multiple changes]
2019-05-17  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-05-07  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90316
	* tree-ssa-alias.h (get_continuation_for_phi): Take walking
	limit by reference.
	(walk_non_aliased_vuses): Take walking limit argument.
	* tree-ssa-alias.c (maybe_skip_until): Take limit and abort
	walking if it is reached instead of just counting.
	(get_continuation_for_phi): Likewise.
	(walk_non_aliased_vuses): Likewise, instead of leaving counter
	limiting to the callback.
	* tree-ssa-sccvn.c (vn_reference_lookup_2): Adjust.
	(vn_reference_lookup_3): Likewise.
	(vn_reference_lookup_pieces): Likewise.
	(vn_reference_lookup): Likewise.
	* tree-ssa-pre.c (translate_vuse_through_block): Limit walking.
	* tree-ssa-scopedtables.c (vuse_eq): Adjust.
	(avail_exprs_stack::lookup_avail_expr): Likewise.

	2019-05-06  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90316
	* tree-ssa-alias.c (maybe_skip_until): Pass in target BB,
	compute target on demand.
	(get_continuation_for_phi): Remove code walking stmts to
	get to a target virtual operand which could end up being
	quadratic.

From-SVN: r271314
2019-05-17 08:10:58 +00:00
GCC Administrator d61c3c1d52 Daily bump.
From-SVN: r271306
2019-05-17 00:16:11 +00:00
Jonathan Wakely c679489ec6 PR libstdc++/90299 make filesystem::absolute overloads consistent
In this implementation it is an error to pass the empty path to absolute,
because the empty path doesn't represent any file in the filesystem so
the function cannot meet its postcondition.

Currently the absolute(const path&, error_code&) overload reports an
error for the empty path, but using errc::no_such_file_or_directory, and
the other overload does not report an error. This patch makes them
consistntly report an errc::invalid_argument error for the empty path.

Backport from mainline
2019-05-04  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90299
	* src/c++17/fs_ops.cc (absolute(const path&)): Report an error if the
	argument is an empty path.
	(absolute(const path&, error_code&)): Use invalid_argument as error
	code instead of no_such_file_or_directory.
	* testsuite/27_io/filesystem/operations/absolute.cc: Check handling
	of non-existent paths and empty paths with both overloads of absolute.

Backport from mainline
2019-05-16  Jonathan Wakely  <jwakely@redhat.com>

	* src/c++17/fs_ops.cc (absolute(const path&, error_code&))
	[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Remove bogus assertion.

From-SVN: r271301
2019-05-17 00:00:26 +01:00
GCC Administrator d686768f11 Daily bump.
From-SVN: r271274
2019-05-16 00:16:21 +00:00
Janne Blomqvist 486923535c Remove translation string markers
C preprocessor definitions should not be translated.

2019-05-15  Janne Blomqvist  <jb@gcc.gnu.org>

        Backport from trunk
        * parse.c (gfc_parse_file): Remove translation string markers.

From-SVN: r271264
2019-05-15 22:38:46 +03:00
Jonathan Wakely aa5005a56c Fix filesystem::path tests
The root_path.cc test had some debugging macros left in accidentally, so
didn't FAIL correctly if an assertion failed.

The string-char8_t.cc tests didn't compile on Windows.

Backport from mainline
2019-04-30  Jonathan Wakely  <jwakely@redhat.com>

	* testsuite/27_io/filesystem/path/decompose/root_path.cc: Remove
	macros accidentally left in.
	* testsuite/27_io/filesystem/path/native/string-char8_t.cc: Remove
	unnecessary -lstdc++fs option. Fix test for mingw.
	* testsuite/experimental/filesystem/path/native/string-char8_t.cc:
	Fix test for mingw.

From-SVN: r271263
2019-05-15 20:38:42 +01:00
Jonathan Wakely b6721f2c47 PR libstdc++/90454.cc path construction from void*
Make the filesystem::path constructors SFINAE away for void* arguments,
instead of giving an error due to iterator_traits<void*>::reference.

Backport from mainline
2019-05-13  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90454.cc path construction from void*
	* include/bits/fs_path.h (path::_Path): Use remove_pointer so that
	pointers to void are rejected as well as void.
	* include/experimental/bits/fs_path.h (path::_Path): Likewise.
	* testsuite/27_io/filesystem/path/construct/80762.cc: Also check
	pointers to void.
	* testsuite/experimental/filesystem/path/construct/80762.cc: Likewise.

From-SVN: r271262
2019-05-15 20:34:59 +01:00
Li Jia He e993da13a0 Fix a typo in two_value_replacement function
2019-05-15  Li Jia He  <helijia@linux.ibm.com>

	Backport from mainline.
	2019-05-07  Li Jia He  <helijia@linux.ibm.com>

	* tree-ssa-phiopt.c (two_value_replacement): Fix a typo in parameter
	detection.
	* gcc.dg/tree-ssa/pr37508.c: Add the no-ssa-phiopt option to skip phi
	optimization.
	* gcc.dg/tree-ssa/pr88676-2.c: New testcase.

From-SVN: r271198
2019-05-15 05:20:02 +00:00
GCC Administrator 5859baf8a7 Daily bump.
From-SVN: r271196
2019-05-15 00:16:13 +00:00
Iain Sandoe 1d040c2034 darwin, testsuite, backport fixes for PR 81058
2019-05-14  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-11  Iain Sandoe  <iain@sandoe.co.uk>

	PR testsuite/81058
	* gcc.target/i386/avx512bw-vpmovswb-1.c: Use regular data section
	for variables on Darwin, rather than common.
	* gcc.target/i386/avx512bw-vpmovuswb-1.c: Likewise.
	* gcc.target/i386/avx512bw-vpmovwb-1.c: Likewise.

From-SVN: r271186
2019-05-14 17:41:36 +00:00
Iain Sandoe a6c086b89b darwin, testsuite, fix abi-avx512f.exp fails.
These need an asm shim to build.

2019-05-14  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-10  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.target/x86_64/abi/avx512f/abi-avx512f.exp: Darwin is
	now tested.
	* gcc.target/x86_64/abi/avx512f/asm-support-darwin.s: New.

From-SVN: r271178
2019-05-14 16:14:16 +00:00
Iain Sandoe ce9225d65b darwin, testsuite, backport fixes for section-attr-*
2019-05-14  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-02  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.dg/tree-prof/section-attr-1.c: Update scan-asm regex
	for cold section label.
	* gcc.dg/tree-prof/section-attr-2.c: Likewise.
	* gcc.dg/tree-prof/section-attr-3.c: Likewise.

From-SVN: r271177
2019-05-14 16:05:35 +00:00
Iain Sandoe c297c2deff darwin, backport fix for g++.dg/ext/instantiate2.C
2019-05-14  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-02  Iain Sandoe  <iain@sandoe.co.uk>

	* g++.dg/ext/instantiate2.C: Remove special-casing for Darwin.

From-SVN: r271176
2019-05-14 16:01:21 +00:00
Martin Liska e387342c67 Backport r271118
2019-05-14  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-05-13  Martin Liska  <mliska@suse.cz>

	PR tree-optimization/90416
	* tree-vect-stmts.c (vect_check_load_store_mask): Concatenate
	string instead of passing the second part as va_arg argument.

From-SVN: r271152
2019-05-14 08:47:40 +00:00
Martin Liska 1841ab40a2 Backport r271117
2019-05-14  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-05-13  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/90380
	* gcov.c (handle_cycle): Do not support zero cycle count,
	it should not be possible.
	(path_contains_zero_cycle_arc): New function.
	(circuit): Ignore zero cycle arc counts.

From-SVN: r271151
2019-05-14 08:46:35 +00:00
Martin Liska 8af68c6ffc Backport r271116
2019-05-14  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-05-13  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/90380
	* gcov.c (enum loop_type): Remove the enum and
	the operator.
	(handle_cycle): Assert that we should not reach
	a negative count.
	(circuit): Use loop_found instead of a tri-state loop_type.
	(get_cycles_count): Do not handle NEGATIVE_LOOP as it can't
	happen.

From-SVN: r271150
2019-05-14 08:46:27 +00:00
Chenghua Xu 1c0152ae21 Backport fix for PR90357.
2019-05-14  Chenghua Xu  <paul.hua.gm@gmail.com>
	
	PR target/90357
	* config/mips/mips.c (mips_split_move): Skip forward SRC into 
	next insn when the SRC reg is dead.

From-SVN: r271147
2019-05-14 03:25:38 +00:00
GCC Administrator 4803ac6b9f Daily bump.
From-SVN: r271143
2019-05-14 00:16:16 +00:00
Joseph Myers ef7ccb1234 * sv.po: Update.
From-SVN: r271140
2019-05-13 23:26:47 +01:00
Iain Sandoe 5a51d62692 backport fix for PR90379
2019-05-13  Iain Sandoe  <iain@sandoe.co.uk>

	Backport from mainline.
	2019-05-11  Iain Sandoe  <iain@sandoe.co.uk>

	PR target/90379
	PR bootstrap/89864
	* inclhack.def (darwin_ucred__Atomic): Do not supply test_text
	for wrap fixes.
	* fixincl.x: Regenerated.

From-SVN: r271136
2019-05-13 20:37:08 +00:00
Edward Smith-Rowland 68a25cb91b Document P0811R3 status in C++20 table
2019-05-13  Edward Smith-Rowland  <3dw4rd@verizon.net>

	* doc/xml/manual/status_cxx2020.xml: Document P0811R3 status.

From-SVN: r271123
2019-05-13 11:58:53 +01:00
GCC Administrator 7d3a63a26d Daily bump.
From-SVN: r271114
2019-05-13 00:16:19 +00:00
Janne Blomqvist 1906551ccc fortran: C++ support for generating C prototypes
When generating C prototypes for Fortran procedures with the
-fc-prototypes and -fc-prototypes-external options, print a snippet
defining macros for complex types, and add C++ support by suppressing
mangling.

fortran/ChangeLog:

2019-05-12  Janne Blomqvist  <jb@gcc.gnu.org>

	* dump-parse-tree.c (get_c_type_name): Use macros for complex type
	names.
	* parse.c (gfc_parse_file): Define complex macros, add CPP support
	when printing C prototypes.

From-SVN: r271109
2019-05-12 21:48:44 +03:00
GCC Administrator c32199acd1 Daily bump.
From-SVN: r271104
2019-05-12 00:16:27 +00:00
Andreas Tobler e2e9b7b30e backport: freebsd64.h: Add bits for 32-bit multilib support.
2019-05-11  Andreas Tobler <andreast@gcc.gnu.org>

	Backport from mainline.
	2019-04-25  Andreas Tobler  <andreast@gcc.gnu.org>

	* config/i386/freebsd64.h: Add bits for 32-bit multilib support.
	* config/i386/t-freebsd64: New file.
	* config.gcc: Add the t-freebsd64 for multilib support.

From-SVN: r271099
2019-05-11 22:43:00 +02:00
Jonathan Wakely a301651022 PR libstdc++/81266 fix std::thread::native_handle_type test
The test uses remove_pointer because in most cases native_handle_type is
a pointer to the actual type that the C++ class contains. However, for
std::thread, native_handle_type is the same type as the type contained
in std::thread, and so remove_pointer is not needed. On targets where
pthread_t is a pointer type remove_pointer<native_handle_type> is not a
no-op, instead it transforms pthread_t and causes the test to fail.

The fix is to not apply remove_pointer when testing std::thread.

Backport from mainline
2019-05-10  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/81266
	* testsuite/util/thread/all.h: Do not use remove_pointer for
	std::thread::native_handle_type.

From-SVN: r271094
2019-05-11 12:35:59 +01:00
Paul Thomas c4de183966 re PR fortran/90093 (Extended C interop: optional argument incorrectly identified as PRESENT)
2019-05-11  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/90093
	* gfortran.dg/ISO_Fortran_binding_12.f90: New test.
	* gfortran.dg/ISO_Fortran_binding_12.c: Supplementary code.

	PR fortran/90352
	* gfortran.dg/iso_c_binding_char_1.f90: New test.

	PR fortran/90355
	* gfortran.dg/ISO_Fortran_binding_4.f90: Add 'substr' to test
	the direct passing of substrings as descriptors to bind(C).
	* gfortran.dg/assign_10.f90: Increase the tree_dump count of
	'atmp' to account for the setting of the 'span' field.
	* gfortran.dg/transpose_optimization_2.f90: Ditto.

From-SVN: r271090
2019-05-11 07:49:52 +00:00
Paul Thomas 558b990911 re PR fortran/90093 (Extended C interop: optional argument incorrectly identified as PRESENT)
2019-05-11  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/90093
	* trans-decl.c (convert_CFI_desc): Test that the dummy is
	present before doing any of the conversions.

	PR fortran/90352
	* decl.c (gfc_verify_c_interop_param): Restore the error for
	charlen > 1 actual arguments passed to bind(C) procs.
	Clean up trailing white space.

	PR fortran/90355
	* trans-array.c (gfc_trans_create_temp_array): Set the 'span'
	field to the element length for all types.
	(gfc_conv_expr_descriptor): The force_no_tmp flag is used to
	prevent temporary creation, especially for substrings.
	* trans-decl.c (gfc_trans_deferred_vars): Rather than assert
	that the backend decl for the string length is non-null, use it
	as a condition before calling gfc_trans_vla_type_sizes.
	* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): 'force_no_tmp'
	is set before calling gfc_conv_expr_descriptor.
	* trans.c (get_array_span): Move the code for extracting 'span'
	from gfc_build_array_ref to this function. This is specific to
	descriptors that are component and indirect references.
	* trans.h : Add the force_no_tmp flag bitfield to gfc_se.

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

	PR fortran/90093
	* gfortran.dg/ISO_Fortran_binding_12.f90: New test.
	* gfortran.dg/ISO_Fortran_binding_12.c: Supplementary code.

	PR fortran/90352
	* gfortran.dg/iso_c_binding_char_1.f90: New test.

	PR fortran/90355
	* gfortran.dg/ISO_Fortran_binding_4.f90: Add 'substr' to test
	the direct passing of substrings as descriptors to bind(C).
	* gfortran.dg/assign_10.f90: Increase the tree_dump count of
	'atmp' to account for the setting of the 'span' field.
	* gfortran.dg/transpose_optimization_2.f90: Ditto.

From-SVN: r271089
2019-05-11 07:47:32 +00:00
GCC Administrator af514ba969 Daily bump.
From-SVN: r271086
2019-05-11 00:16:14 +00:00
Jonathan Wakely b7a51c8b9e PR libstdc++/90397 fix std::variant friend declaration
Clang diagnoses insert inconsistent noexcept-specifier on the friend
declaration of __get. Add .

	PR libstdc++/90397
	* include/std/variant (variant): Add noexcept to friend declaration.

From-SVN: r271083
2019-05-10 23:23:10 +01:00
Jonathan Wakely ad2c7788a9 Tweak C++2a uses-allocator construction utilities
The 20_util/scoped_allocator/69293_neg.cc test was failing in C++2a mode
because the expected static_assert text wasn't matched. The code is
still ill-formed in C++2a, but uses the new __uses_alloc_args function
and so fails a different static_assert. This patch adds the same string
to the new static_assert, so the test passes.

Now that G++ allows concepts to be declared without 'bool' we can use
the correct C++2a syntax for the _Std_pair concept used to constrain the
uses-allocator construction utilities.

Also add a new test to verify that pmr::polymorphic_allocator correctly
performs recursive uses-allocator construction for nested pairs in
C++2a.

Backport from mainline
2019-04-26  Jonathan Wakely  <jwakely@redhat.com>

	* include/std/memory (__uses_alloc_args): Add string-literal to
	static_assert, to match the one in __uses_alloc.
	[__cpp_concepts] (_Std_pair): Use C++2a syntax for concept.
	* testsuite/20_util/polymorphic_allocator/construct_c++2a.cc: Check
	for recursive uses-allocator construction of nested pairs.
	* testsuite/20_util/scoped_allocator/construct_pair_c++2a.cc:: Add
	comment.

From-SVN: r271082
2019-05-10 23:23:06 +01:00
Jonathan Wakely c252ffdb11 PR libstdc++/90239 use uses_allocator_construction_args in <scoped_allocator>
Backport from mainline
2019-04-25  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90239
	* doc/xml/manual/status_cxx2020.xml: Amend P0591R4 status.
	* include/std/scoped_allocator [__cplusplus > 201703L]
	(scoped_allocator_adaptor::construct): Define in terms of
	uses_allocator_construction_args, as per P0591R4.
	* testsuite/20_util/scoped_allocator/construct_pair_c++2a.cc: New test.
	* testsuite/util/testsuite_allocator.h: Remove name of unused
	parameter.
	* doc/html/*: Regenerate.

From-SVN: r271081
2019-05-10 23:23:01 +01:00
Marek Polacek 49cb28a4d1 PR c++/78010 - bogus -Wsuggest-override warning on final function.
* class.c (check_for_override): Don't warn for final functions.

	* g++.dg/warn/Wsuggest-override-2.C: New test.

From-SVN: r271066
2019-05-10 14:57:22 +00:00
Kelvin Nilsen 455ea3748a backport: re PR middle-end/89765 (Multiple problems with vec-insert implementation on PowerPC)
gcc/ChangeLog:

2019-05-10  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline.
	2019-05-07  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89765
	* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
	In handling of ALTIVEC_BUILTIN_VEC_INSERT, use modular arithmetic
	to compute vector element selector for both constant and variable
	operands.

gcc/testsuite/ChangeLog:

2019-05-10  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline.
	2019-05-07  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89765
	* gcc.target/powerpc/pr89765-mc.c: New test.
	* gcc.target/powerpc/vsx-builtin-10c.c: New test.
	* gcc.target/powerpc/vsx-builtin-10d.c: New test.
	* gcc.target/powerpc/vsx-builtin-11c.c: New test.
	* gcc.target/powerpc/vsx-builtin-11d.c: New test.
	* gcc.target/powerpc/vsx-builtin-12c.c: New test.
	* gcc.target/powerpc/vsx-builtin-12d.c: New test.
	* gcc.target/powerpc/vsx-builtin-13c.c: New test.
	* gcc.target/powerpc/vsx-builtin-13d.c: New test.
	* gcc.target/powerpc/vsx-builtin-14c.c: New test.
	* gcc.target/powerpc/vsx-builtin-14d.c: New test.
	* gcc.target/powerpc/vsx-builtin-15c.c: New test.
	* gcc.target/powerpc/vsx-builtin-15d.c: New test.
	* gcc.target/powerpc/vsx-builtin-16c.c: New test.
	* gcc.target/powerpc/vsx-builtin-16d.c: New test.
	* gcc.target/powerpc/vsx-builtin-17c.c: New test.
	* gcc.target/powerpc/vsx-builtin-17d.c: New test.
	* gcc.target/powerpc/vsx-builtin-18c.c: New test.
	* gcc.target/powerpc/vsx-builtin-18d.c: New test.
	* gcc.target/powerpc/vsx-builtin-19c.c: New test.
	* gcc.target/powerpc/vsx-builtin-19d.c: New test.
	* gcc.target/powerpc/vsx-builtin-20c.c: New test.
	* gcc.target/powerpc/vsx-builtin-20d.c: New test.
	* gcc.target/powerpc/vsx-builtin-9c.c: New test.
	* gcc.target/powerpc/vsx-builtin-9d.c: New test.

From-SVN: r271064
2019-05-10 14:00:17 +00:00
Richard Biener 2b4107b450 tree-ssa-sccvn.c (visit_reference_op_call): Initialize value-id.
2019-05-10  Richard Biener  <rguenther@suse.de>

	* tree-ssa-sccvn.c (visit_reference_op_call): Initialize value-id.
	(do_rpo_vn): Initialize next_value_id.

From-SVN: r271062
2019-05-10 12:01:47 +00:00
GCC Administrator 41112638d6 Daily bump.
From-SVN: r271050
2019-05-10 00:16:12 +00:00
Joseph Myers 49cddf87b6 * de.po, fr.po: Update.
From-SVN: r271046
2019-05-09 22:41:45 +01:00
Thomas Koenig 10e4cdb5a7 backport: re PR fortran/90351 (-fc-prototypes does not dump prototypes for external procedures)
2019-05-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

    Backport from trunk
    PR fortran/90351
    PR fortran/90329
    * gfortran.dg/dump-parse-tree.c: Include version.h.
    (gfc_dump_external_c_prototypes): New function.
    (get_c_type_name): Select "char" as a name for a simple char.
    Adjust to handling external functions. Also handle complex.
    (write_decl): Add argument bind_c. Adjust for dumping of external
    procedures.
    (write_proc): Likewise.
    (write_interop_decl): Add bind_c argument to call of write_proc.
    * gfortran.h: Add prototype for gfc_dump_external_c_prototypes.
    * lang.opt: Add -fc-prototypes-external flag.
    * parse.c (gfc_parse_file): Move dumping of BIND(C) prototypes.
    Call gfc_dump_external_c_prototypes if option is set.
    * invoke.texi: Document -fc-prototypes-external.

From-SVN: r271038
2019-05-09 17:40:30 +00:00
Thomas Schwinge 239b7733c5 Clean up MPX-related stuff: CIF_CHKP
..., which was forgotten in recent r268844.

	gcc/
	* cif-code.def (CHKP): Remove.

trunk r271029

From-SVN: r271030
2019-05-09 11:52:53 +02:00
GCC Administrator 4f7632fb30 Daily bump.
From-SVN: r271025
2019-05-09 00:16:14 +00:00
Thomas Schwinge efe5f7c5fa Address compiler diagnostics in libgomp.oacc-c-c++-common/pr87835.c
source-gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/pr87835.c: In function 'main':
    source-gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/pr87835.c:45: warning: ignoring #pragma loop gang [-Wunknown-pragmas]
       45 |     #pragma loop gang
          |
    source-gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/pr87835.c:19:7: warning: unused variable 'b' [-Wunused-variable]
       19 |   int b[n];
          |       ^

	libgomp/
	PR target/87835
	* testsuite/libgomp.oacc-c-c++-common/pr87835.c: Update.

trunk r271004

From-SVN: r271005
2019-05-08 12:03:04 +02:00
GCC Administrator 3c1c5def75 Daily bump.
From-SVN: r270996
2019-05-08 00:16:14 +00:00
Joseph Myers 4577993bc6 Update .po files.
* be.po, da.po, de.po, el.po, es.po, fi.po, fr.po, hr.po, id.po,
	ja.po, nl.po, ru.po, sr.po, sv.po, tr.po, uk.po, vi.po, zh_CN.po,
	zh_TW.po: Update.

From-SVN: r270992
2019-05-08 01:05:32 +01:00
Kelvin Nilsen 38ff331a38 backport: re PR target/89424 (__builtin_vec_ext_v1ti (v, i) results in ICE with variable i (RS6000))
gcc/ChangeLog:

2019-05-07  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline.
	2019-05-06  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89424
	* config/rs6000/rs6000.c (rs6000_expand_vector_extract): Add
	handling of V1TImode.

gcc/testsuite/ChangeLog:

2019-05-07  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	Backport from mainline.
	2019-05-06  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/89424
	* gcc.target/powerpc/pr89424-0.c: New test.
	* gcc.target/powerpc/vsx-builtin-13a.c: Define macro PR89424 to
	enable testing of newly patched capability.
	* gcc.target/powerpc/vsx-builtin-13b.c: Likewise.
	* gcc.target/powerpc/vsx-builtin-20a.c: Likewise.
	* gcc.target/powerpc/vsx-builtin-20b.c: Likewise.

From-SVN: r270969
2019-05-07 16:22:21 +00:00
Rainer Orth a4a0178a87 Fix make install-gcc-specs with empty GCC_SPECS_FILES
* gcc-interface/Makefile.in (install-gcc-specs): Use foreach.
	Honor DESTDIR.

From-SVN: r270948
2019-05-07 15:21:35 +00:00
GCC Administrator 505d7ec016 Daily bump.
From-SVN: r270932
2019-05-07 00:16:36 +00:00
Marek Polacek 6b58ebe4e5 PR c++/90265 - ICE with generic lambda.
* pt.c (tsubst_copy_and_build): Use a dedicated variable for the last
	element in the vector.

	* g++.dg/cpp1y/lambda-generic-90265.C: New test.

From-SVN: r270919
2019-05-06 17:08:08 +00:00
Paolo Carlini d1d20a924e re PR c++/90173 (ICE: Segmentation fault (in strip_declarator_types))
/cp
2019-05-06  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/90173
	* decl.c (grokdeclarator): Set type to error_mark_node
	upon error about template placeholder type non followed
	by a simple declarator-id.

/testsuite
2019-05-06  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/90173
	* g++.dg/cpp1z/class-deduction66.C: New.

From-SVN: r270915
2019-05-06 15:23:37 +00:00
Martin Liska 6df94d59ac Backport r270899
2019-05-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-05-06  Martin Liska  <mliska@suse.cz>

	PR sanitizer/90312
	* config/i386/i386-options.c (ix86_option_override_internal): Error only
	when -mabi is selected to a non-default version.
2019-05-06  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-05-06  Martin Liska  <mliska@suse.cz>

	PR sanitizer/90312
	* gcc.dg/asan/pr87930.c: Run the test only on *linux or *gnu
	systems.
	* gcc.dg/tsan/pr88017.c: Likewise.

From-SVN: r270912
2019-05-06 14:01:45 +00:00
GCC Administrator 4f27ebf02d Daily bump.
From-SVN: r270891
2019-05-06 00:16:12 +00:00
Michael Meissner 7983a8e85e Delete file created on the wrong branch
From-SVN: r270886
2019-05-05 23:31:14 +00:00
GCC Administrator 13b63df735 Daily bump.
From-SVN: r270880
2019-05-05 00:16:16 +00:00
Michael Meissner 37a457e395 Delete unintentional file from the wrong branch
From-SVN: r270876
2019-05-04 15:40:37 +00:00
Michael Meissner 2dea4b1e49 Delete unintentional file from the wrong branch
From-SVN: r270875
2019-05-04 15:39:52 +00:00
GCC Administrator 789f09736b Daily bump.
From-SVN: r270866
2019-05-04 00:16:12 +00:00
Michael Meissner 8cb953d5d2 setup branch
From-SVN: r270863
2019-05-03 22:33:10 +00:00
Ian Lance Taylor e7018d1c3d backport: os/user: disable TestGroupIds for AIX
Backport from trunk:

    os/user: disable TestGroupIds for AIX
    
    The corresponding Go Toolchain patch is CL 164039
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/175079

From-SVN: r270856
2019-05-03 17:15:42 +00:00
Richard Biener 32d365a18b re PR tree-optimization/90316 (large compile time increase in opt / alias stmt walking for Go example)
2019-05-03  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90316
	* tree-ssa-pre.c (pass_pre::execute): Re-compute DOM fast queries
	before running VN.

From-SVN: r270849
2019-05-03 11:22:33 +00:00
Jakub Jelinek 93d725e5ce * BASE-VER: Set to 9.1.1.
From-SVN: r270842
2019-05-03 10:47:02 +02:00
GCC Administrator c8913260b0 Update ChangeLog and version files for release
From-SVN: r270839
2019-05-03 07:59:54 +00:00
Jakub Jelinek e69f334131 * gennews (files): Add files for GCC 9.
From-SVN: r270838
2019-05-03 09:41:05 +02:00
GCC Administrator 0d15cc0869 Daily bump.
From-SVN: r270830
2019-05-03 00:16:17 +00:00
Joseph Myers d2f284727c * gcc.pot: Regenerate.
From-SVN: r270823
2019-05-02 21:30:48 +01:00
Maciej W. Rozycki 313b4f6242 libphobos: Correct my identity in the last ChangeLog entry
From-SVN: r270818
2019-05-02 17:16:04 +00:00
Maciej W. Rozycki e05a859cf6 libphobos: RISC-V: Fix soft-float build errors with IEEE exception flags
Fix assembly errors:

.../libphobos/src/std/math.d: Assembler messages:.../libphobos/src/std/math.d:4773: Error: unrecognized opcode `frflags a0'.../libphobos/src/std/math.d:4856: Error: unrecognized opcode `fsflags a5'.../libphobos/src/std/math.d:4856: Error: unrecognized opcode `fsflags a5'.../libphobos/src/std/math.d:4773: Error: unrecognized opcode `frflags a0'.../libphobos/src/std/math.d:5549: Error: unrecognized opcode `fscsr a5'.../libphobos/src/std/math.d:5456: Error: unrecognized opcode `frcsr a5'.../libphobos/src/std/math.d:5456: Error: unrecognized opcode `frcsr a5'.../libphobos/src/std/math.d:5549: Error: unrecognized opcode `fscsr a5'.../libphobos/src/std/math.d:5456: Error: unrecognized opcode `frcsr a5'.../libphobos/src/std/math.d:5549: Error: unrecognized opcode `fscsr a0'.../libphobos/src/std/math.d:5456: Error: unrecognized opcode `frcsr a0'.../libphobos/src/std/math.d:5456: Error: unrecognized opcode `frcsr a0'.../libphobos/src/std/math.d:5549: Error: unrecognized opcode `fscsr s2'make[8]: *** [Makefile:1119: std/math.lo] Error 1

triggered with the RISC-V lp64 multilib in a GCC build configured with 
`--enable-multilib --enable-languages=all --target=riscv64-linux-gnu'. 
This is due to unconditional explicit use of F extension instructions 
within inline assembly, to access IEEE exception flags.  The use of 
these instructions is not allowed when building for a soft-float ABI.

Correct the problem by wrapping said inline assembly into a conditional 
such that if `D_SoftFloat' is true, then reads from IEEE exception flags 
return 0 and writes are ignored instead, complementing r270522 
("libphobos: Add D support for RISC-V Linux"), which is an updated 
version of <https://gcc.gnu.org/ml/gcc-patches/2019-04/msg00325.html>, 
where the problematic code has originated from.

libphobos/ChangeLog:

2019-05-02  Maciej Rozycki  <macro@wdc.com>

	* std/math.d (IeeeFlags.getIeeeFlags): Handle RISC-V soft-float ABI.
	(IeeeFlags.resetIeeeFlags): Likewise.
	(FloatingPointControl.getControlState): Likewise.
	(FloatingPointControl.setControlState): Likewise.

From-SVN: r270816
2019-05-02 16:39:16 +00:00
Rainer Orth ad4952c887 Restrict gcc.target/i386/spellcheck-options-5.c to Linux targets
* gcc.target/i386/spellcheck-options-5.c: Restrict to Linux and
	GNU targets.

From-SVN: r270796
2019-05-02 13:33:02 +00:00
Jakub Jelinek eb60bcfe81 Makefile.am (gfor_cdir): Remove $(MULTISUBDIR).
* Makefile.am (gfor_cdir): Remove $(MULTISUBDIR).
	* Makefile.in: Regenerated.

From-SVN: r270794
2019-05-02 15:03:46 +02:00
GCC Administrator bc31725435 Daily bump.
From-SVN: r270785
2019-05-02 00:16:16 +00:00
Rainer Orth 85370ffdf6 Update Solaris baselines for GCC 9.1
* config/abi/post/i386-solaris2.10/baseline_symbols.txt: Regenerate.
	* config/abi/post/i386-solaris2.10/amd64/baseline_symbols.txt: Likewise.
	* config/abi/post/i386-solaris2.11/baseline_symbols.txt: Likewise.
	* config/abi/post/i386-solaris2.11/amd64/baseline_symbols.txt: Likewise.
	* config/abi/post/sparc-solaris2.10/baseline_symbols.txt: Likewise.
	* config/abi/post/sparc-solaris2.10/sparcv9/baseline_symbols.txt:
	Likewise.
	* config/abi/post/sparc-solaris2.11/baseline_symbols.txt: Likewise.
	* config/abi/post/sparc-solaris2.11/sparcv9/baseline_symbols.txt:
	Likewise.

From-SVN: r270774
2019-05-01 16:16:57 +00:00
GCC Administrator bcaa552890 Daily bump.
From-SVN: r270762
2019-05-01 00:16:11 +00:00
Joseph Myers 2365ff751c * de.po: Update.
From-SVN: r270710
2019-04-30 20:57:58 +01:00
Ramana Radhakrishnan 605dbfb0c4 [Patch AArch64] Add __ARM_FEATURE_ATOMICS
This keeps coming up repeatedly and the ACLE has finally added
__ARM_FEATURE_ATOMICS for the LSE feature in GCC. This is now part of
the latest ACLE release
(https://developer.arm.com/docs/101028/latest/5-feature-test-macros)

I know it's late for GCC-9 but this is a simple macro which need not
wait  for another year.

Ok for trunk and to backport to all release branches ?

Tested with a simple build and a smoke test.

Backport from mainline.
PR target/86538
* config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins): Define
__ARM_FEATURE_ATOMICS

From-SVN: r270689
2019-04-30 12:02:30 +00:00
Jakub Jelinek 9c594b6da1 gnu.ver (GLIBCXX_3.4.26): Change _Lock_policyE2 exports to _Lock_policyE[012].
* config/abi/pre/gnu.ver (GLIBCXX_3.4.26): Change _Lock_policyE2 exports
	to _Lock_policyE[012].
	* config/abi/post/riscv64-linux-gnu/baseline_symbols.txt: Update.

From-SVN: r270688
2019-04-30 13:41:28 +02:00
Jakub Jelinek 046f9fe835 * config/abi/post/riscv64-linux-gnu/baseline_symbols.txt: Update.
From-SVN: r270679
2019-04-30 10:56:01 +02:00
Martin Liska d020f96fa3 Subject: Backport r270675
2019-04-30  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-04-30  Martin Liska  <mliska@suse.cz>

	PR translation/90274
	* opts.c (print_filtered_help): Wrap string in _(...).

From-SVN: r270677
2019-04-30 08:51:23 +00:00
Martin Liska 9a0b2c5f5a Subject: Backport r270622
2019-04-30  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-04-27  Martin Liska  <mliska@suse.cz>

	PR middle-end/90258
	* opt-suggestions.c (option_proposer::build_option_suggestions):
	When get_valid_option_values returns empty values, add the
	misspelling candidate.
2019-04-30  Martin Liska  <mliska@suse.cz>

	Backport from mainline
	2019-04-27  Martin Liska  <mliska@suse.cz>

	PR middle-end/90258
	* gcc.dg/completion-5.c: New test.
	* gcc.target/i386/spellcheck-options-5.c: New test.

From-SVN: r270676
2019-04-30 08:35:28 +00:00
Richard Biener 889a8e2a6d re PR tree-optimization/90273 (GCC runs out of memory building Firefox)
PR tree-optimization/90273
	* tree-ssa-dce.c (eliminate_unnecessary_stmts): Eliminate
	useless debug stmts.

From-SVN: r270674
2019-04-30 09:40:06 +02:00
GCC Administrator 56045d0869 Daily bump.
From-SVN: r270671
2019-04-30 00:16:11 +00:00
Joseph Myers f72ea6bf88 * sv.po: Update.
From-SVN: r270668
2019-04-29 23:45:52 +01:00
Joseph Myers 03e5044285 * gcc.pot: Regenerate.
From-SVN: r270666
2019-04-29 23:28:09 +01:00
Iain Buclaw 92095b8ea2 libphobos: Fix multilib builds for s390x-linux-gnu
Merges upstream druntime aab44549, phobos 3dc363783.

Reviewed-on: https://github.com/dlang/druntime/pull/2590
	     https://github.com/dlang/phobos/pull/6983

libphobos/ChangeLog:

2019-04-28  Iain Buclaw  <ibuclaw@gdcproject.org>

	* libdruntime/gcc/sections/elf_shared.d (IBMZ_Any): Define when
	version S390 or SystemZ.  Use condition instead of SystemZ.
	(getTLSRange): Return null on GNU_EMUTLS targets.

From-SVN: r270640
2019-04-29 05:46:14 +00:00
GCC Administrator 42896ed44c Daily bump.
From-SVN: r270636
2019-04-29 00:16:13 +00:00
Iain Buclaw f069783899 [netbsd] d: Fix build failures on sparc*-netbsd
gcc/ChangeLog:

2019-04-27  Iain Buclaw  <ibuclaw@gdcproject.org>

	* config/netbsd-d.c: Include memmodel.h.  Remove unused tree.h,
	varasm.h, and netbsd-protos.h.

From-SVN: r270631
2019-04-28 08:02:10 +00:00
GCC Administrator 9d564422a9 Daily bump.
From-SVN: r270629
2019-04-28 00:16:16 +00:00
GCC Administrator 2702d8c2de Daily bump.
From-SVN: r270619
2019-04-27 00:16:28 +00:00
H.J. Lu 664fb394cc x32: Update baseline_symbols.txt
Backport from mainline
	* config/abi/post/x86_64-linux-gnu/x32/baseline_symbols.txt: Updated.

From-SVN: r270614
2019-04-26 10:04:18 -07:00
Jonathan Wakely 4f00a5492c Fix tests that fail with _GLIBCXX_USE_CXX11_ABI=0
The pmr::string typedef isn't available for the old COW string, so some
tests that use it were failing.

Backport from mainline
2019-04-26  Jonathan Wakely  <jwakely@redhat.com>

	* testsuite/20_util/variant/run.cc: Use a new Hashable type to test
	hashing, because pmr::string depends on _GLIBCXX_USE_CXX11_ABI==1.
	* testsuite/21_strings/basic_string/hash/hash.cc
	[!_GLIBCXX_USE_CXX11_ABI]: Don't test pmr strings.
	* testsuite/21_strings/basic_string/hash/hash_char8_t.cc
	[!_GLIBCXX_USE_CXX11_ABI]: Likewise.

From-SVN: r270612
2019-04-26 17:44:17 +01:00
Jonathan Wakely 06bbb71a2b Adjust linker script to stop exporting unwanted symbol in old version
As discussed in the thread starting at
https://gcc.gnu.org/ml/libstdc++/2019-04/msg00140.html

	* config/abi/pre/gnu.ver (GLIBCXX_3.4): Replace wildcard that matches
	wstring::_M_replace_dispatch with more specific patterns.

From-SVN: r270611
2019-04-26 17:44:12 +01:00
Segher Boessenkool d6ea820e70 revert r270484
I'm leaving the testsuite piece alone.

From-SVN: r270601
2019-04-26 15:49:53 +02:00
Jakub Jelinek 650e99729c baseline_symbols.txt: Update.
* config/abi/post/s390x-linux-gnu/32/baseline_symbols.txt: Update.
	* config/abi/post/s390-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/powerpc-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt: Update.

From-SVN: r270599
2019-04-26 14:09:40 +02:00
Jakub Jelinek ad74120952 baseline_symbols.txt: Update.
* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt: Update.
	* config/abi/post/i386-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/i486-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/aarch64-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/s390x-linux-gnu/baseline_symbols.txt: Update.
	* config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt: Update.

From-SVN: r270596
2019-04-26 13:15:38 +02:00
GCC Administrator d5b8a48bef Daily bump.
From-SVN: r270591
2019-04-26 00:16:12 +00:00
Jonathan Wakely 80fd3eed04 PR libstdc++/90239 Fix status of P0591R4 in C++2a support table
PR libstdc++/90239
	* doc/xml/manual/status_cxx2020.xml: Correct status of P0591R4.
	* doc/html/*: Regenerate.

From-SVN: r270587
2019-04-25 22:49:54 +01:00
Jakub Jelinek 7b37de5c0f re PR tree-optimization/90240 (ICE in try_improve_iv_set, at tree-ssa-loop-ivopts.c:6694)
PR tree-optimization/90240
	Revert:
	2019-04-23  Bin Cheng  <bin.cheng@linux.alibaba.com>
 
	PR tree-optimization/90078
	* tree-ssa-loop-ivopts.c (comp_cost::operator +,-,+=,-+,/=,*=): Add
	checks for infinite_cost overflow.

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

From-SVN: r270583
2019-04-25 20:08:14 +02:00
Jakub Jelinek 67647bd885 * DEV-PHASE: Set to prerelease.
From-SVN: r270582
2019-04-25 20:04:17 +02:00
1826 changed files with 274928 additions and 211085 deletions
+16
View File
@@ -1,3 +1,19 @@
2020-03-12 Release Manager
* GCC 9.3.0 released.
2019-08-12 Release Manager
* GCC 9.2.0 released.
2019-05-04 Michael Meissner <meissner@linux.ibm.com>
* ChangeLog.ibm: Delete unintentional commit on the wrong branch.
2019-05-03 Release Manager
* GCC 9.1.0 released.
2019-04-22 Roman Zhuykov <zhroma@ispras.ru>
* MAINTAINERS (Various Maintainers): Remove Ayal Zaks and add myself
+12
View File
@@ -1,3 +1,15 @@
2020-03-12 Release Manager
* GCC 9.3.0 released.
2019-08-12 Release Manager
* GCC 9.2.0 released.
2019-05-03 Release Manager
* GCC 9.1.0 released.
2019-04-16 Martin Liska <mliska@suse.cz>
* bootstrap-lto-lean.mk: Filter out -flto in STAGEtrain_CFLAGS.
+20
View File
@@ -1,3 +1,23 @@
2020-03-12 Release Manager
* GCC 9.3.0 released.
2019-08-16 Uros Bizjak <ubizjak@gmail.com>
* test_summary: Do not escape "=".
2019-08-12 Release Manager
* GCC 9.2.0 released.
2019-05-03 Release Manager
* GCC 9.1.0 released.
2019-05-03 Jakub Jelinek <jakub@redhat.com>
* gennews (files): Add files for GCC 9.
2019-04-19 Christophe Lyon <christophe.lyon@linaro.org>
PR translation/90118
+2 -1
View File
@@ -3,7 +3,7 @@
# Script to generate the NEWS file from online release notes.
# Contributed by Joseph Myers <jsm28@cam.ac.uk>.
#
# Copyright (C) 2000-2018 Free Software Foundation, Inc.
# Copyright (C) 2000-2019 Free Software Foundation, Inc.
# This file is part of GCC.
#
# GCC is free software; you can redistribute it and/or modify
@@ -23,6 +23,7 @@
website=http://gcc.gnu.org/
files="
gcc-9/index.html gcc-9/changes.html
gcc-8/index.html gcc-8/changes.html
gcc-7/index.html gcc-7/changes.html
gcc-6/index.html gcc-6/changes.html
+12
View File
@@ -1,3 +1,15 @@
2020-03-12 Release Manager
* GCC 9.3.0 released.
2019-08-12 Release Manager
* GCC 9.2.0 released.
2019-05-03 Release Manager
* GCC 9.1.0 released.
2017-07-02 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
+12
View File
@@ -1,3 +1,15 @@
2020-03-12 Release Manager
* GCC 9.3.0 released.
2019-08-12 Release Manager
* GCC 9.2.0 released.
2019-05-03 Release Manager
* GCC 9.1.0 released.
2010-06-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* bin/gcc-svn-ids: Fix unportable shell quoting.
+12
View File
@@ -1,3 +1,15 @@
2020-03-12 Release Manager
* GCC 9.3.0 released.
2019-08-12 Release Manager
* GCC 9.2.0 released.
2019-05-03 Release Manager
* GCC 9.1.0 released.
2012-08-26 Hans-Peter Nilsson <hp@axis.com>
* btest-gcc.sh (TESTLOGS): Make gfortran.sum optional.
+1 -1
View File
@@ -127,7 +127,7 @@ NR == 1 {
if (lang == "") lang = " "$2" "; else lang = " ";
}
$2 == "version" { save = $0; $1 = ""; $2 = ""; version = $0; gsub(/^ */, "", version); gsub(/\r$/, "", version); $0 = save; }
/\===.*Summary/ { print ""; print; blanks=1; }
/===.*Summary/ { print ""; print; blanks=1; }
/tests ===/ || /^(Target|Host|Native)/ || $2 == "version" { print; blanks=1; }
/^(XPASS|FAIL|UNRESOLVED|WARNING|ERROR|# of )/ { sub ("\r", ""); print; }
/^using:/ { print ""; print; print ""; }
+78
View File
@@ -1,3 +1,81 @@
2020-03-12 Release Manager
* GCC 9.3.0 released.
2020-02-26 Segher Boessenkool <segher@kernel.crashing.org>
Backport from trunk
2020-02-13 Matheus Castanho <msc@linux.ibm.com>
* fixinc.in: Skip machine_name fix on powerpc*-*-linux*.
2020-01-01 John David Anglin <danglin@gcc.gnu.org>
Backport from mainline
2019-12-30 John David Anglin <danglin@gcc.gnu.org>
PR libgomp/93066
* inclhack.def (hpux_c99_inttypes3): Fix defines for INTPTR_MAX
and UINTPTR_MAX, and missing define for SIZE_MAX.
* fixincl.x: Regenerate.
* tests/base/inttypes.h: Update for above fix.
2019-08-21 Iain Sandoe <iain@sandoe.co.uk>
Backport from mainline.
2019-08-18 C.G. Dogan <gcc+cgdogan.00@gmail.com>
Iain Sandoe <iain@sandoe.co.uk>
PR target/83531
* inclhack.def (darwin_api_availability): New; strip leading
underscores from API_XXXX defines.
* fixincl.x: Regenerate.
* tests/base/os/availability.h: New file.
2019-08-12 Release Manager
* GCC 9.2.0 released.
2019-08-03 Iain Sandoe <iain@sandoe.co.uk>
Backport from mainline.
2019-06-21 Iain Sandoe <iain@sandoe.co.uk>
* inclhack.def: Replace the complex test using __STRICT_ANSI__ and
__STDC_VERSION__ with a test using __DARWIN_NO_LONG_LONG.
Ensure that the top level math.h uses <> to wrap included headers
rather than "".
* fixincl.x: Regenerated.
* tests/base/architecture/ppc/math.h: Update test to include the
__DARWIN_NO_LONG_LONG case.
2019-08-03 Iain Sandoe <iain@sandoe.co.uk>
Backport from mainline.
2019-06-21 Iain Sandoe <iain@sandoe.co.uk>
* inclhack.def: Guard __has_attribute and __has_extension in
os/base.h.
Guard Apple blocks syntax in dispatch/object.h.
* fixincl.x: Regenerate.
* tests/base/dispatch/object.h: New file.
* tests/base/os/base.h: New file.
2019-05-13 Iain Sandoe <iain@sandoe.co.uk>
Backport from mainline.
2019-05-11 Iain Sandoe <iain@sandoe.co.uk>
PR target/90379
PR bootstrap/89864
* inclhack.def (darwin_ucred__Atomic): Do not supply test_text
for wrap fixes.
* fixincl.x: Regenerated.
2019-05-03 Release Manager
* GCC 9.1.0 released.
2019-04-18 Erik Schnetter <schnetter@gmail.com>
Jakub Jelinek <jakub@redhat.com>
Iain Sandoe <iain@sandoe.co.uk>
+1 -1
View File
@@ -136,7 +136,7 @@ fi
# disable the fix.
case "${target_canonical}" in
*-*-vxworks*)
*-*-vxworks* | powerpc*-*-linux*)
test -f ${MACRO_LIST} && echo > ${MACRO_LIST}
;;
esac
+251 -6
View File
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
* It has been AutoGen-ed April 16, 2019 at 09:32:25 AM by AutoGen 5.17.4
* It has been AutoGen-ed January 1, 2020 at 11:59:56 AM by AutoGen 5.18.16
* From the definitions inclhack.def
* and the template file fixincl
*/
/* DO NOT SVN-MERGE THIS FILE, EITHER Tue Apr 16 09:32:25 IST 2019
/* DO NOT SVN-MERGE THIS FILE, EITHER Wed Jan 1 11:59:56 EST 2020
*
* You must regenerate it. Use the ./genfixes script.
*
@@ -15,7 +15,7 @@
* certain ANSI-incompatible system header files which are fixed to work
* correctly with ANSI C and placed in a directory that GNU C will search.
*
* This file contains 252 fixup descriptions.
* This file contains 257 fixup descriptions.
*
* See README for more information.
*
@@ -267,6 +267,56 @@ static const char* apzAab_Darwin7_9_Long_Double_FuncsPatch[] = {
#endif /* __MATH__ */",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Darwin_Api_Availability fix
*/
tSCC zDarwin_Api_AvailabilityName[] =
"darwin_api_availability";
/*
* File name selection pattern
*/
tSCC zDarwin_Api_AvailabilityList[] =
"os/availability.h\0";
/*
* Machine/OS name selection pattern
*/
tSCC* apzDarwin_Api_AvailabilityMachs[] = {
"*-*-darwin*",
(const char*)NULL };
/*
* content selection pattern - do fix if pattern found
*/
tSCC zDarwin_Api_AvailabilitySelect0[] =
" *#define __API_AVAILABLE.*\n\
*#define __API_DEPRECATED.*\n\
*#define __API_DEPRECATED_WITH_REPLACEMENT.*\n\
*#define __API_UNAVAILABLE.*\n";
/*
* content bypass pattern - skip fix if pattern found
*/
tSCC zDarwin_Api_AvailabilityBypass0[] =
"__IPHONE_OS_VERSION_MIN_REQUIRED";
#define DARWIN_API_AVAILABILITY_TEST_CT 2
static tTestDesc aDarwin_Api_AvailabilityTests[] = {
{ TT_NEGREP, zDarwin_Api_AvailabilityBypass0, (regex_t*)NULL },
{ TT_EGREP, zDarwin_Api_AvailabilitySelect0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Darwin_Api_Availability
*/
static const char* apzDarwin_Api_AvailabilityPatch[] = {
"format",
" #define API_AVAILABLE(...)\n\
#define API_DEPRECATED(...)\n\
#define API_DEPRECATED_WITH_REPLACEMENT(...)\n\
#define API_UNAVAILABLE(...)\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Aab_Fd_Zero_Asm_Posix_Types_H fix
@@ -2650,7 +2700,7 @@ tSCC zDarwin_9_Long_Double_Funcs_2List[] =
* Machine/OS name selection pattern
*/
tSCC* apzDarwin_9_Long_Double_Funcs_2Machs[] = {
"*-*-darwin7.9*",
"*-*-darwin*",
(const char*)NULL };
/*
@@ -2754,6 +2804,42 @@ static const char* apzDarwin_Gcc4_BreakagePatch[] = {
"((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Darwin_Ll_Funcs_Avail fix
*/
tSCC zDarwin_Ll_Funcs_AvailName[] =
"darwin_ll_funcs_avail";
/*
* File name selection pattern
*/
tSCC zDarwin_Ll_Funcs_AvailList[] =
"architecture/ppc/math.h\0architecture/i386/math.h\0";
/*
* Machine/OS name selection pattern
*/
tSCC* apzDarwin_Ll_Funcs_AvailMachs[] = {
"*-*-darwin*",
(const char*)NULL };
/*
* content selection pattern - do fix if pattern found
*/
tSCC zDarwin_Ll_Funcs_AvailSelect0[] =
"#if[^_]*__STDC_VERSION__[^_]*__STDC_VERSION__[^1]*199901L[^_]*__STRICT_ANSI__[^_]*__GNUC__[^)]*";
#define DARWIN_LL_FUNCS_AVAIL_TEST_CT 1
static tTestDesc aDarwin_Ll_Funcs_AvailTests[] = {
{ TT_EGREP, zDarwin_Ll_Funcs_AvailSelect0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Darwin_Ll_Funcs_Avail
*/
static const char* apzDarwin_Ll_Funcs_AvailPatch[] = { sed_cmd_z,
"-e", "s/#if[^_]*__STDC_VERSION__[^_]*__STDC_VERSION__[^_]*199901L[^_]*__STRICT_ANSI__[^_]*__GNUC__[^\\)]*)/#if !(__DARWIN_NO_LONG_LONG)/",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Darwin_Longjmp_Noreturn fix
@@ -2916,6 +3002,86 @@ static const char* apzDarwin_Os_Trace_3Patch[] = {
#endif",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Darwin_Os_Base_1 fix
*/
tSCC zDarwin_Os_Base_1Name[] =
"darwin_os_base_1";
/*
* File name selection pattern
*/
tSCC zDarwin_Os_Base_1List[] =
"os/base.h\0";
/*
* Machine/OS name selection pattern
*/
tSCC* apzDarwin_Os_Base_1Machs[] = {
"*-*-darwin*",
(const char*)NULL };
/*
* content selection pattern - do fix if pattern found
*/
tSCC zDarwin_Os_Base_1Select0[] =
"#define __has_attribute.*\n\
#endif";
#define DARWIN_OS_BASE_1_TEST_CT 1
static tTestDesc aDarwin_Os_Base_1Tests[] = {
{ TT_EGREP, zDarwin_Os_Base_1Select0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Darwin_Os_Base_1
*/
static const char* apzDarwin_Os_Base_1Patch[] = {
"format",
"%0\n\
#ifndef __has_extension\n\
#define __has_extension(x) 0\n\
#endif",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Darwin_Dispatch_Object_1 fix
*/
tSCC zDarwin_Dispatch_Object_1Name[] =
"darwin_dispatch_object_1";
/*
* File name selection pattern
*/
tSCC zDarwin_Dispatch_Object_1List[] =
"dispatch/object.h\0";
/*
* Machine/OS name selection pattern
*/
tSCC* apzDarwin_Dispatch_Object_1Machs[] = {
"*-*-darwin*",
(const char*)NULL };
/*
* content selection pattern - do fix if pattern found
*/
tSCC zDarwin_Dispatch_Object_1Select0[] =
"typedef void.*\\^dispatch_block_t.*";
#define DARWIN_DISPATCH_OBJECT_1_TEST_CT 1
static tTestDesc aDarwin_Dispatch_Object_1Tests[] = {
{ TT_EGREP, zDarwin_Dispatch_Object_1Select0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Darwin_Dispatch_Object_1
*/
static const char* apzDarwin_Dispatch_Object_1Patch[] = {
"format",
"#if __BLOCKS__\n\
%0\n\
#endif",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Darwin_Private_Extern fix
@@ -4981,6 +5147,55 @@ static const char* apzHpux_C99_Inttypes2Patch[] = { sed_cmd_z,
"-e", "s@^[ \t]*#[ \t]*define[ \t]*UINT16_C(__c)[ \t]*((unsigned short)(__c))[ \t]*$@#define UINT16_C(__c) (__c)@",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Hpux_C99_Inttypes3 fix
*/
tSCC zHpux_C99_Inttypes3Name[] =
"hpux_c99_inttypes3";
/*
* File name selection pattern
*/
tSCC zHpux_C99_Inttypes3List[] =
"inttypes.h\0";
/*
* Machine/OS name selection pattern
*/
tSCC* apzHpux_C99_Inttypes3Machs[] = {
"hppa*-hp-hpux11*",
(const char*)NULL };
/*
* content selection pattern - do fix if pattern found
*/
tSCC zHpux_C99_Inttypes3Select0[] =
"#define[ \t]INTPTR_MAX[ \t]*\n\
#define[ \t]UINTPTR_MAX[ \t]*\n";
#define HPUX_C99_INTTYPES3_TEST_CT 1
static tTestDesc aHpux_C99_Inttypes3Tests[] = {
{ TT_EGREP, zHpux_C99_Inttypes3Select0, (regex_t*)NULL }, };
/*
* Fix Command Arguments for Hpux_C99_Inttypes3
*/
static const char* apzHpux_C99_Inttypes3Patch[] = {
"format",
"#undef SIZE_MAX\n\
#define SIZE_MAX __SIZE_MAX__\n\
#ifdef __INTPTR_MAX__\n\
# undef INTPTR_MAX\n\
# define INTPTR_MAX __INTPTR_MAX__\n\
# undef INTPTR_MIN\n\
# define INTPTR_MIN (-INTPTR_MAX - 1)\n\
#endif\n\
#ifdef __UINTPTR_MAX__\n\
# undef UINTPTR_MAX\n\
# define UINTPTR_MAX __UINTPTR_MAX__\n\
#endif\n",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Hpux_Ctype_Macros fix
@@ -10230,9 +10445,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
#define REGEX_COUNT 290
#define REGEX_COUNT 296
#define MACH_LIST_SIZE_LIMIT 187
#define FIX_COUNT 252
#define FIX_COUNT 257
/*
* Enumerate the fixes
@@ -10241,6 +10456,7 @@ typedef enum {
AAB_AIX_STDIO_FIXIDX,
AAB_AIX_FCNTL_FIXIDX,
AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_FIXIDX,
DARWIN_API_AVAILABILITY_FIXIDX,
AAB_FD_ZERO_ASM_POSIX_TYPES_H_FIXIDX,
AAB_FD_ZERO_GNU_TYPES_H_FIXIDX,
AAB_FD_ZERO_SELECTBITS_H_FIXIDX,
@@ -10303,10 +10519,13 @@ typedef enum {
DARWIN_9_LONG_DOUBLE_FUNCS_2_FIXIDX,
DARWIN_EXTERNC_FIXIDX,
DARWIN_GCC4_BREAKAGE_FIXIDX,
DARWIN_LL_FUNCS_AVAIL_FIXIDX,
DARWIN_LONGJMP_NORETURN_FIXIDX,
DARWIN_OS_TRACE_1_FIXIDX,
DARWIN_OS_TRACE_2_FIXIDX,
DARWIN_OS_TRACE_3_FIXIDX,
DARWIN_OS_BASE_1_FIXIDX,
DARWIN_DISPATCH_OBJECT_1_FIXIDX,
DARWIN_PRIVATE_EXTERN_FIXIDX,
DARWIN_STDINT_1_FIXIDX,
DARWIN_STDINT_2_FIXIDX,
@@ -10357,6 +10576,7 @@ typedef enum {
HPUX_C99_INTPTR_FIXIDX,
HPUX_C99_INTTYPES_FIXIDX,
HPUX_C99_INTTYPES2_FIXIDX,
HPUX_C99_INTTYPES3_FIXIDX,
HPUX_CTYPE_MACROS_FIXIDX,
HPUX_EXTERN_ERRNO_FIXIDX,
HPUX_HTONL_FIXIDX,
@@ -10508,6 +10728,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
aAab_Darwin7_9_Long_Double_FuncsTests, apzAab_Darwin7_9_Long_Double_FuncsPatch, 0 },
{ zDarwin_Api_AvailabilityName, zDarwin_Api_AvailabilityList,
apzDarwin_Api_AvailabilityMachs,
DARWIN_API_AVAILABILITY_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aDarwin_Api_AvailabilityTests, apzDarwin_Api_AvailabilityPatch, 0 },
{ zAab_Fd_Zero_Asm_Posix_Types_HName, zAab_Fd_Zero_Asm_Posix_Types_HList,
apzAab_Fd_Zero_Asm_Posix_Types_HMachs,
AAB_FD_ZERO_ASM_POSIX_TYPES_H_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
@@ -10818,6 +11043,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
DARWIN_GCC4_BREAKAGE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aDarwin_Gcc4_BreakageTests, apzDarwin_Gcc4_BreakagePatch, 0 },
{ zDarwin_Ll_Funcs_AvailName, zDarwin_Ll_Funcs_AvailList,
apzDarwin_Ll_Funcs_AvailMachs,
DARWIN_LL_FUNCS_AVAIL_TEST_CT, FD_MACH_ONLY,
aDarwin_Ll_Funcs_AvailTests, apzDarwin_Ll_Funcs_AvailPatch, 0 },
{ zDarwin_Longjmp_NoreturnName, zDarwin_Longjmp_NoreturnList,
apzDarwin_Longjmp_NoreturnMachs,
DARWIN_LONGJMP_NORETURN_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@@ -10838,6 +11068,16 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
DARWIN_OS_TRACE_3_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aDarwin_Os_Trace_3Tests, apzDarwin_Os_Trace_3Patch, 0 },
{ zDarwin_Os_Base_1Name, zDarwin_Os_Base_1List,
apzDarwin_Os_Base_1Machs,
DARWIN_OS_BASE_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aDarwin_Os_Base_1Tests, apzDarwin_Os_Base_1Patch, 0 },
{ zDarwin_Dispatch_Object_1Name, zDarwin_Dispatch_Object_1List,
apzDarwin_Dispatch_Object_1Machs,
DARWIN_DISPATCH_OBJECT_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aDarwin_Dispatch_Object_1Tests, apzDarwin_Dispatch_Object_1Patch, 0 },
{ zDarwin_Private_ExternName, zDarwin_Private_ExternList,
apzDarwin_Private_ExternMachs,
DARWIN_PRIVATE_EXTERN_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@@ -11088,6 +11328,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
HPUX_C99_INTTYPES2_TEST_CT, FD_MACH_ONLY,
aHpux_C99_Inttypes2Tests, apzHpux_C99_Inttypes2Patch, 0 },
{ zHpux_C99_Inttypes3Name, zHpux_C99_Inttypes3List,
apzHpux_C99_Inttypes3Machs,
HPUX_C99_INTTYPES3_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aHpux_C99_Inttypes3Tests, apzHpux_C99_Inttypes3Patch, 0 },
{ zHpux_Ctype_MacrosName, zHpux_Ctype_MacrosList,
apzHpux_Ctype_MacrosMachs,
HPUX_CTYPE_MACROS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+117 -5
View File
@@ -194,6 +194,33 @@ fix = {
_EndOfHeader_;
};
/*
* SDKs for 10.13 and 10.14 omit the definitions for API_AVAILABLE where
* __attribute__((availability)) is not supported.
*/
fix = {
hackname = darwin_api_availability;
mach = "*-*-darwin*";
files = os/availability.h;
bypass = "__IPHONE_OS_VERSION_MIN_REQUIRED";
select =
" *#define __API_AVAILABLE.*\n"
" *#define __API_DEPRECATED.*\n"
" *#define __API_DEPRECATED_WITH_REPLACEMENT.*\n"
" *#define __API_UNAVAILABLE.*\n";
c_fix = format;
c_fix_arg =
" #define API_AVAILABLE(...)\n"
" #define API_DEPRECATED(...)\n"
" #define API_DEPRECATED_WITH_REPLACEMENT(...)\n"
" #define API_UNAVAILABLE(...)\n";
test_text =
"#define __API_AVAILABLE(...)\n"
"#define __API_DEPRECATED(...)\n"
"#define __API_DEPRECATED_WITH_REPLACEMENT(...)\n"
"#define __API_UNAVAILABLE(...)\n";
};
/*
* This fixes __FD_ZERO bug for linux 2.x.y (x <= 2 && y <= some n)
*/
@@ -1298,12 +1325,12 @@ fix = {
};
/*
* For the AAB_darwin7_9_long_double_funcs fix to be useful,
* you have to not use "" includes.
* For the AAB_darwin7_9_long_double_funcs fix (and later fixes for long long)
* to be useful, the main math.h must use <> and not "" includes.
*/
fix = {
hackname = darwin_9_long_double_funcs_2;
mach = "*-*-darwin7.9*";
mach = "*-*-darwin*";
files = math.h;
select = '#include[ \t]+\"';
c_fix = format;
@@ -1311,7 +1338,7 @@ fix = {
c_fix_arg = '([ \t]*#[ \t]*include[ \t]+)"([a-z0-9/]+)\.h"';
test_text = '#include "architecture/ppc/math.h"';
test_text = '#include <architecture/ppc/math.h>';
};
/*
@@ -1354,6 +1381,22 @@ fix = {
"(__GNUC_MINOR__ >= 1)\n";
};
/*
* math.h hides the long long functions that are available on the system for
* 10.5 and 10.6 SDKs, we expect to use them in G++ without specifying a value
* for __STDC_VERSION__, or switching __STRICT_ANSI__ off.
*/
fix = {
hackname = darwin_ll_funcs_avail;
mach = "*-*-darwin*";
files = architecture/ppc/math.h, architecture/i386/math.h;
select = "#if[^_]*__STDC_VERSION__[^_]*__STDC_VERSION__[^1]*199901L[^_]*"
"__STRICT_ANSI__[^_]*__GNUC__[^\)]*";
sed = "s/#if[^_]*__STDC_VERSION__[^_]*__STDC_VERSION__[^_]*199901L[^_]*"
"__STRICT_ANSI__[^_]*__GNUC__[^\\)]*\)/#if\ !\(__DARWIN_NO_LONG_LONG\)/";
test_text = "#if\ !(__DARWIN_NO_LONG_LONG)";
};
/*
* Before Mac OS X 10.8 <i386/setjmp.h> doesn't mark longjump noreturn.
*/
@@ -1425,6 +1468,49 @@ fix = {
_EOText_;
};
/*
* In macOS 10.10 <os/base.h>, doesn't have __has_extension guarded.
*/
fix = {
hackname = darwin_os_base_1;
mach = "*-*-darwin*";
files = os/base.h;
select = <<- OS_BASE_1_SEL
#define __has_attribute.*
#endif
OS_BASE_1_SEL;
c_fix = format;
c_fix_arg = <<- OS_BASE_1_FIX
%0
#ifndef __has_extension
#define __has_extension(x) 0
#endif
OS_BASE_1_FIX;
test_text = <<- OS_BASE_1_TEST
#define __has_attribute(x) 0
#endif
#if __GNUC__
OS_BASE_1_TEST;
};
/*
* In macOS 10.10 <dispatch/object.h>, has unguarded block syntax.
*/
fix = {
hackname = darwin_dispatch_object_1;
mach = "*-*-darwin*";
files = dispatch/object.h;
select = "typedef void.*\\^dispatch_block_t.*";
c_fix = format;
c_fix_arg = "#if __BLOCKS__\n%0\n#endif";
test_text = <<- DISPATCH_OBJECT_1_TEST
typedef void (^dispatch_block_t)(void);
__BEGIN_DECLS
DISPATCH_OBJECT_1_TEST;
};
/*
* __private_extern__ doesn't exist in FSF GCC. Even if it did,
* why would you ever put it in a system header file?
@@ -1638,7 +1724,7 @@ fix = {
c_fix_arg = "#if (__STDC_VERSION__ < 201112L) || defined(__cplusplus)\n"
"# undef _Atomic\n"
"#endif\n";
test_text = "_Atomic";
test_text = ""; /* Don't provide this for wrap fixes. */
};
/*
@@ -2501,6 +2587,32 @@ fix = {
"# define UINT16_C(__c) ((unsigned short)(__c))\n";
};
/*
* Fix broken and missing defines in inttypes.h
*/
fix = {
hackname = hpux_c99_inttypes3;
mach = "hppa*-hp-hpux11*";
files = inttypes.h;
select = "#define[ \t]INTPTR_MAX[ \t]*\n"
"#define[ \t]UINTPTR_MAX[ \t]*\n";
c_fix = format;
c_fix_arg = "#undef SIZE_MAX\n"
"#define SIZE_MAX __SIZE_MAX__\n"
"#ifdef __INTPTR_MAX__\n"
"# undef INTPTR_MAX\n"
"# define INTPTR_MAX __INTPTR_MAX__\n"
"# undef INTPTR_MIN\n"
"# define INTPTR_MIN (-INTPTR_MAX - 1)\n"
"#endif\n"
"#ifdef __UINTPTR_MAX__\n"
"# undef UINTPTR_MAX\n"
"# define UINTPTR_MAX __UINTPTR_MAX__\n"
"#endif\n";
test_text = "#define INTPTR_MAX\n"
"#define UINTPTR_MAX\n";
};
/*
* Fix hpux broken ctype macros
*/
@@ -12,3 +12,8 @@
#if defined( BROKEN_NAN_CHECK )
#if 1
#endif /* BROKEN_NAN_CHECK */
#if defined( DARWIN_LL_FUNCS_AVAIL_CHECK )
#if !(__DARWIN_NO_LONG_LONG)
#endif /* DARWIN_LL_FUNCS_AVAIL_CHECK */
+18
View File
@@ -0,0 +1,18 @@
/* DO NOT EDIT THIS FILE.
It has been auto-edited by fixincludes from:
"fixinc/tests/inc/dispatch/object.h"
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#if defined( DARWIN_DISPATCH_OBJECT_1_CHECK )
#if __BLOCKS__
typedef void (^dispatch_block_t)(void);
#endif
__BEGIN_DECLS
#endif /* DARWIN_DISPATCH_OBJECT_1_CHECK */
+17
View File
@@ -16,3 +16,20 @@
#define UINT32_C(__c) __CONCAT__(__c,u)
#endif /* HPUX_C99_INTTYPES_CHECK */
#if defined( HPUX_C99_INTTYPES3_CHECK )
#undef SIZE_MAX
#define SIZE_MAX __SIZE_MAX__
#ifdef __INTPTR_MAX__
# undef INTPTR_MAX
# define INTPTR_MAX __INTPTR_MAX__
# undef INTPTR_MIN
# define INTPTR_MIN (-INTPTR_MAX - 1)
#endif
#ifdef __UINTPTR_MAX__
# undef UINTPTR_MAX
# define UINTPTR_MAX __UINTPTR_MAX__
#endif
#endif /* HPUX_C99_INTTYPES3_CHECK */
+18
View File
@@ -0,0 +1,18 @@
/* DO NOT EDIT THIS FILE.
It has been auto-edited by fixincludes from:
"fixinc/tests/inc/os/availability.h"
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#if defined( DARWIN_API_AVAILABILITY_CHECK )
#define API_AVAILABLE(...)
#define API_DEPRECATED(...)
#define API_DEPRECATED_WITH_REPLACEMENT(...)
#define API_UNAVAILABLE(...)
#endif /* DARWIN_API_AVAILABILITY_CHECK */
+20
View File
@@ -0,0 +1,20 @@
/* DO NOT EDIT THIS FILE.
It has been auto-edited by fixincludes from:
"fixinc/tests/inc/os/base.h"
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#if defined( DARWIN_OS_BASE_1_CHECK )
#define __has_attribute(x) 0
#endif
#ifndef __has_extension
#define __has_extension(x) 0
#endif
#if __GNUC__
#endif /* DARWIN_OS_BASE_1_CHECK */
+1 -1
View File
@@ -1 +1 @@
9.0.1
9.3.1
+3979
View File
File diff suppressed because it is too large Load Diff
+8
View File
@@ -0,0 +1,8 @@
2019-10-10 Joey Ye <joey.ye@arm.com>
Pickup patch rejected in trunk.
2019-09-11 Wilco Dijkstra <wdijkstr@arm.com>
PR tree-optimization/80155
* common/config/arm/arm-common.c (arm_option_optimization_table):
Enable -fcode-hoisting with -Os.
+1 -1
View File
@@ -1 +1 @@
20190425
20200408
-1
View File
@@ -1 +0,0 @@
experimental
+2 -1
View File
@@ -1120,6 +1120,7 @@ endif
# Support for additional languages (other than C).
# C can be supported this way too (leave for later).
LANG_CONFIGUREFRAGS = @all_lang_configurefrags@
LANG_MAKEFRAGS = @all_lang_makefrags@
# Used by gcc/jit/Make-lang.in
@@ -1894,7 +1895,7 @@ cstamp-h: config.in config.status
# Really, really stupid make features, such as SUN's KEEP_STATE, may force
# a target to build even if it is up-to-date. So we must verify that
# config.status does not exist before failing.
config.status: $(srcdir)/configure $(srcdir)/config.gcc
config.status: $(srcdir)/configure $(srcdir)/config.gcc $(LANG_CONFIGUREFRAGS)
@if [ ! -f config.status ] ; then \
echo You must configure gcc. Look at http://gcc.gnu.org/install/ for details.; \
false; \
+198
View File
@@ -1,3 +1,201 @@
2020-03-12 Release Manager
* GCC 9.3.0 released.
2020-03-11 Richard Wai <richard@annexi-strayline.com>
* gcc-interface/decl.c (gnat_to_gnu_entity): Also test Is_Public on
the Alias of the entitiy, if it is present, in the main assertion.
2019-11-29 Eric Botcazou <ebotcazou@adacore.com>
PR ada/92489
Backport from mainline
2019-07-01 Ed Schonberg <schonberg@adacore.com>
* exp_attr.adb (Expand_Attribute_Reference, case Invalid_Value):
Resolve result of call to Get_Simple_Init_Val, which may be a
conversion of a literal.
2019-11-25 Eric Botcazou <ebotcazou@adacore.com>
PR ada/92362
* gcc-interface/trans.c (gnat_to_gnu) <N_Attribute_Definition_Clause>:
Use a temporary instead of clobbering the result with a freeze node.
2019-11-25 Eric Botcazou <ebotcazou@adacore.com>
PR ada/92575
* expect.c (__gnat_expect_poll [VMS, HPUX]): Fix typo.
2019-11-08 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2019-10-27 Jakub Jelinek <jakub@redhat.com>
* locales.c (iso_3166): Add missing comma after "United-States".
2019-10-12 Eric Botcazou <ebotcazou@adacore.com>
PR ada/91995
* sem_ch8.adb (Chain_Use_Clause): Remove second argument in calls
to Defining_Entity.
* sem_elab.adb (Find_Unit_Entity): Likewise. Deal with N_Subunit
here in lieu of in Defining_Entity.
* sem_spark.adb (Check_Callable_Body): Likewise.
(Check_Package_Body): Likewise.
* sem_util.ads (Defining_Entity): Remove 2nd and 3th parameters.
* sem_util.adb (Defining_Entity): Remove 2nd and 3th parameters,
and adjust accordingly. Deal with N_Compilation_Unit.
2019-10-11 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (annotate_value) <INTEGER_CST>: Really test the
sign of the value when deciding to build a NEGATE_EXPR.
<PLUS_EXPR>: Remove redundant line.
<BIT_AND_EXPR>: Do the negation here.
2019-09-23 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Attribute_to_gnu): Test Can_Use_Internal_Rep
on the underlying type of the node.
(Call_to_gnu): Likewise with the type of the prefix.
2019-08-12 Release Manager
* GCC 9.2.0 released.
2019-08-05 Iain Sandoe <iain@sandoe.co.uk>
Backport from mainline.
2019-07-02 Iain Sandoe <iain@sandoe.co.uk>
* libgnat/system-darwin-ppc.ads: Set Stack_Check_Probes True for
PPC Darwin.
2019-08-05 Iain Sandoe <iain@sandoe.co.uk>
Backport from mainline.
2019-06-30 Iain Sandoe <iain@sandoe.co.uk>
* gnatlink.adb (Link_Step): Remove duplicate -static-libgcc switches.
Push -shared-libgcc explicitly, when it is the target default (unless
overidden by the static flag).
When the user has put an instance of shared/static-libgcc do not push
a duplicate of this.
2019-07-04 James Clarke <jrtc27@debian.org>
* libgnarl/s-osinte__kfreebsd-gnu.ads (clockid_t): Make type
definition public.
(CLOCK_REALTIME): Make value public.
2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity): Beep up comment on SAVED,
and tweak comment on the assertion about the scopes of Itypes. Do not
skip the regular processing for Itypes that are E_Record_Subtype with
a Cloned_Subtype. Get the Cloned_Subtype for every E_Record_Subtype
if the type is dummy and hasn't got its own freeze node.
<E_Record_Subtype>: Save again the DECL of the Cloned_Subtype, if any.
<E_Access_Subtype>: Save again the DECL of the equivalent type.
(Gigi_Equivalent_Type) <E_Access_Subtype>: New case.
2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (mark_visited_r): Set TYPE_SIZES_GIMPLIFIED on
the main variant of a type, if any.
2019-06-29 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (set_nonaliased_component_on_array_type): Add
missing guard for the presence of TYPE_CANONICAL.
(set_reverse_storage_order_on_array_type): Likewise.
2019-06-18 Arnaud Charlet <charlet@adacore.com>
PR ada/80590
* sem_ch5.adb (Analyze_Loop_Statement): Avoid exception propagation
during normal processing.
2019-06-17 Arnaud Charlet <charlet@adacore.com>
PR ada/80590
* exp_ch9.adb (Expand_N_Delay_Relative_Statement): Swap the two
conditions to avoid a unnecessary exception propagation in the default
case.
2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (lvalue_required_for_attribute_p): Return 0
for 'Size too.
(Identifier_to_gnu): Use the actual subtype for a reference to a
packed array in a return statement.
(Attribute_to_gnu) <Attr_Size>: Do not strip VIEW_CONVERT_EXPRs from
the prefix in every case.
2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (gnat_to_gnu): Remove superfluous tests on
Backend_Overflow_Checks_On_Target and rework comments.
2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (walk_nesting_tree): New static function.
(finalize_nrv): Use it to walk the entire nesting tree.
2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Subtype>: Remove
obsolete test on Is_For_Access_Subtype.
2019-05-28 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (components_to_record): Set a name on the type
created for the REP part, if any.
* gcc-interface/utils.c (finish_record_type): Only take the maximum
when merging sizes for a variant part at offset 0.
(merge_sizes): Rename has_rep parameter into max.
2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Call_to_gnu): Do not initialize the temporary
created out of addressability concerns if it's for the _Init parameter
of an initialization procedure.
2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils.c (maybe_pad_type): Issue the warning for the
specific case of component types preferably.
2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Identifier_to_gnu): Minor tweaks.
(gnat_to_gnu): Do not convert the result if it is a reference to an
unconstrained array used as the prefix of an attribute reference that
requires an lvalue.
2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Gigi_Types_Compatible): New predicate.
(Identifier_to_gnu): Use it to assert that the type of the identifier
and that of its entity are compatible for gigi. Rename a couple of
local variables and separate the processing of the result type.
2019-05-27 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Call_to_gnu): Use the unpadded type when
putting back an intermediate conversion the type of the actuals.
2019-05-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* gcc-interface/Makefile.in (install-gcc-specs): Use foreach.
Honor DESTDIR.
2019-05-03 Release Manager
* GCC 9.1.0 released.
2019-04-24 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Bernd Edlinger <bernd.edlinger@hotmail.de>
Jakub Jelinek <jakub@redhat.com>
+5
View File
@@ -4242,6 +4242,11 @@ package body Exp_Attr is
when Attribute_Invalid_Value =>
Rewrite (N, Get_Simple_Init_Val (Ptyp, N));
-- The value produced may be a conversion of a literal, which
-- must be resolved to establish its proper type.
Analyze_And_Resolve (N);
----------
-- Last --
----------
+7 -8
View File
@@ -8258,18 +8258,17 @@ package body Exp_Ch9 is
Proc : Entity_Id;
begin
-- Try to use System.Relative_Delays.Delay_For only if available. This
-- is the implementation used on restricted platforms when Ada.Calendar
-- is not available.
-- Try to use Ada.Calendar.Delays.Delay_For if available.
if RTE_Available (RO_RD_Delay_For) then
Proc := RTE (RO_RD_Delay_For);
if RTE_Available (RO_CA_Delay_For) then
Proc := RTE (RO_CA_Delay_For);
-- Otherwise, use Ada.Calendar.Delays.Delay_For and emit an error
-- message if not available.
-- Otherwise, use System.Relative_Delays.Delay_For and emit an error
-- message if not available. This is the implementation used on
-- restricted platforms when Ada.Calendar is not available.
else
Proc := RTE (RO_CA_Delay_For);
Proc := RTE (RO_RD_Delay_For);
end if;
Rewrite (N,
+2 -2
View File
@@ -265,7 +265,7 @@ __gnat_expect_poll (int *fd,
if ((status & 1) != 1)
{
ready = -1;
dead_process = i + 1;
*dead_process = i + 1;
return ready;
}
}
@@ -450,7 +450,7 @@ __gnat_expect_poll (int *fd,
if (ei.request == TIOCCLOSE)
{
ioctl (fd[i], TIOCREQSET, &ei);
dead_process = i + 1;
*dead_process = i + 1;
return -1;
}
+2 -3
View File
@@ -505,9 +505,8 @@ gnatlink-re: ../stamp-tools gnatmake-re
install-gcc-specs:
# Install all the requested GCC spec files.
for f in $(GCC_SPEC_FILES); do \
$(INSTALL_DATA_DATE) $(srcdir)/ada/$$f $(libsubdir)/; \
done
$(foreach f,$(GCC_SPEC_FILES), \
$(INSTALL_DATA_DATE) $(srcdir)/ada/$(f) $(DESTDIR)$(libsubdir)/;)
install-gnatlib: ../stamp-gnatlib-$(RTSDIR) install-gcc-specs
$(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
+58 -28
View File
@@ -308,7 +308,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
tree gnu_size = NULL_TREE;
/* Contains the GCC name to be used for the GCC node. */
tree gnu_entity_name;
/* True if we have already saved gnu_decl as a GNAT association. */
/* True if we have already saved gnu_decl as a GNAT association. This can
also be used to purposely avoid making such an association but this use
case ought not to be applied to types because it can break the deferral
mechanism implemented for access types. */
bool saved = false;
/* True if we incremented defer_incomplete_level. */
bool this_deferred = false;
@@ -325,14 +328,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
/* Since a use of an Itype is a definition, process it as such if it is in
the main unit, except for E_Access_Subtype because it's actually a use
of its base type, and for E_Record_Subtype with cloned subtype because
it's actually a use of the cloned subtype, see below. */
of its base type, see below. */
if (!definition
&& is_type
&& Is_Itype (gnat_entity)
&& !(kind == E_Access_Subtype
|| (kind == E_Record_Subtype
&& Present (Cloned_Subtype (gnat_entity))))
&& Ekind (gnat_entity) != E_Access_Subtype
&& !present_gnu_tree (gnat_entity)
&& In_Extended_Main_Code_Unit (gnat_entity))
{
@@ -375,7 +375,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
}
/* This abort means the Itype has an incorrect scope, i.e. that its
scope does not correspond to the subprogram it is declared in. */
scope does not correspond to the subprogram it is first used in. */
gcc_unreachable ();
}
@@ -384,7 +384,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
In that case, we will abort below when we try to save a new GCC tree
for this object. We also need to handle the case of getting a dummy
type when a Full_View exists but be careful so as not to trigger its
premature elaboration. */
premature elaboration. Likewise for a cloned subtype without its own
freeze node, which typically happens when a generic gets instantiated
on an incomplete or private type. */
if ((!definition || (is_type && imported_p))
&& present_gnu_tree (gnat_entity))
{
@@ -398,7 +400,23 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
|| No (Freeze_Node (Full_View (gnat_entity)))))
{
gnu_decl
= gnat_to_gnu_entity (Full_View (gnat_entity), NULL_TREE, false);
= gnat_to_gnu_entity (Full_View (gnat_entity), NULL_TREE,
false);
save_gnu_tree (gnat_entity, NULL_TREE, false);
save_gnu_tree (gnat_entity, gnu_decl, false);
}
if (TREE_CODE (gnu_decl) == TYPE_DECL
&& TYPE_IS_DUMMY_P (TREE_TYPE (gnu_decl))
&& Ekind (gnat_entity) == E_Record_Subtype
&& No (Freeze_Node (gnat_entity))
&& Present (Cloned_Subtype (gnat_entity))
&& (present_gnu_tree (Cloned_Subtype (gnat_entity))
|| No (Freeze_Node (Cloned_Subtype (gnat_entity)))))
{
gnu_decl
= gnat_to_gnu_entity (Cloned_Subtype (gnat_entity), NULL_TREE,
false);
save_gnu_tree (gnat_entity, NULL_TREE, false);
save_gnu_tree (gnat_entity, gnu_decl, false);
}
@@ -427,15 +445,22 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
/* If we get here, it means we have not yet done anything with this entity.
If we are not defining it, it must be a type or an entity that is defined
elsewhere or externally, otherwise we should have defined it already. */
elsewhere or externally, otherwise we should have defined it already.
One exception is for an entity, typically an inherited operation, which is
a local alias for the parent's operation. It is neither defined, since it
is an inherited operation, nor public, since it is declared in the current
compilation unit, so we test Is_Public on the Alias entity instead. */
gcc_assert (definition
|| type_annotate_only
|| is_type
|| kind == E_Discriminant
|| kind == E_Component
|| kind == E_Label
|| (kind == E_Constant && Present (Full_View (gnat_entity)))
|| Is_Public (gnat_entity));
|| Is_Public (gnat_entity)
|| (Present (Alias (gnat_entity))
&& Is_Public (Alias (gnat_entity)))
|| type_annotate_only);
/* Get the name of the entity and set up the line number and filename of
the original definition for use in any decl we make. Make sure we do
@@ -3331,14 +3356,14 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
case E_Record_Subtype:
/* If Cloned_Subtype is Present it means this record subtype has
identical layout to that type or subtype and we should use
that GCC type for this one. The front end guarantees that
that GCC type for this one. The front-end guarantees that
the component list is shared. */
if (Present (Cloned_Subtype (gnat_entity)))
{
gnu_decl = gnat_to_gnu_entity (Cloned_Subtype (gnat_entity),
NULL_TREE, false);
gnat_annotate_type = Cloned_Subtype (gnat_entity);
saved = true;
maybe_present = true;
break;
}
@@ -3373,7 +3398,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
Unchecked_Union (it must be an Itype), just return the type. */
if (Has_Discriminants (gnat_entity)
&& Stored_Constraint (gnat_entity) != No_Elist
&& !Is_For_Access_Subtype (gnat_entity)
&& Is_Record_Type (gnat_base_type)
&& !Is_Unchecked_Union (gnat_base_type))
{
@@ -3752,8 +3776,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
case E_Access_Subtype:
/* We treat this as identical to its base type; any constraint is
meaningful only to the front-end. */
gnu_decl = gnat_to_gnu_entity (Etype (gnat_entity), NULL_TREE, false);
saved = true;
gnu_decl = gnat_to_gnu_entity (gnat_equiv_type, NULL_TREE, false);
maybe_present = true;
/* The designated subtype must be elaborated as well, if it does
not have its own freeze node. But designated subtypes created
@@ -4978,6 +5002,10 @@ Gigi_Equivalent_Type (Entity_Id gnat_entity)
gnat_equiv = Equivalent_Type (gnat_entity);
break;
case E_Access_Subtype:
gnat_equiv = Etype (gnat_entity);
break;
case E_Class_Wide_Type:
gnat_equiv = Root_Type (gnat_entity);
break;
@@ -6148,7 +6176,8 @@ static void
set_nonaliased_component_on_array_type (tree type)
{
TYPE_NONALIASED_COMPONENT (type) = 1;
TYPE_NONALIASED_COMPONENT (TYPE_CANONICAL (type)) = 1;
if (TYPE_CANONICAL (type))
TYPE_NONALIASED_COMPONENT (TYPE_CANONICAL (type)) = 1;
}
/* Set TYPE_REVERSE_STORAGE_ORDER on an array type built by means of
@@ -6158,7 +6187,8 @@ static void
set_reverse_storage_order_on_array_type (tree type)
{
TYPE_REVERSE_STORAGE_ORDER (type) = 1;
TYPE_REVERSE_STORAGE_ORDER (TYPE_CANONICAL (type)) = 1;
if (TYPE_CANONICAL (type))
TYPE_REVERSE_STORAGE_ORDER (TYPE_CANONICAL (type)) = 1;
}
/* Return true if DISCR1 and DISCR2 represent the same discriminant. */
@@ -8162,6 +8192,8 @@ components_to_record (Node_Id gnat_component_list, Entity_Id gnat_record_type,
gnu_field_list = gnu_rep_list;
else
{
TYPE_NAME (gnu_rep_type)
= create_concat_name (gnat_record_type, "REP");
TYPE_REVERSE_STORAGE_ORDER (gnu_rep_type)
= TYPE_REVERSE_STORAGE_ORDER (gnu_record_type);
finish_record_type (gnu_rep_type, gnu_rep_list, 1, debug_info);
@@ -8230,9 +8262,8 @@ annotate_value (tree gnu_size)
{
case INTEGER_CST:
/* For negative values, build NEGATE_EXPR of the opposite. Such values
can appear for discriminants in expressions for variants. Note that,
sizetype being unsigned, we don't directly use tree_int_cst_sgn. */
if (tree_int_cst_sign_bit (gnu_size))
can appear for discriminants in expressions for variants. */
if (tree_int_cst_sgn (gnu_size) < 0)
{
tree t = wide_int_to_tree (sizetype, -wi::to_wide (gnu_size));
tcode = Negate_Expr;
@@ -8310,9 +8341,8 @@ annotate_value (tree gnu_size)
&& tree_int_cst_sign_bit (TREE_OPERAND (gnu_size, 1)))
{
tcode = Minus_Expr;
ops[0] = annotate_value (TREE_OPERAND (gnu_size, 0));
wide_int op1 = -wi::to_wide (TREE_OPERAND (gnu_size, 1));
ops[1] = annotate_value (wide_int_to_tree (sizetype, op1));
wide_int wop1 = -wi::to_wide (TREE_OPERAND (gnu_size, 1));
ops[1] = annotate_value (wide_int_to_tree (sizetype, wop1));
break;
}
@@ -8353,9 +8383,9 @@ annotate_value (tree gnu_size)
Such values can appear in expressions with aligning patterns. */
if (TREE_CODE (TREE_OPERAND (gnu_size, 1)) == INTEGER_CST)
{
wide_int op1 = wi::sext (wi::to_wide (TREE_OPERAND (gnu_size, 1)),
TYPE_PRECISION (sizetype));
ops[1] = annotate_value (wide_int_to_tree (sizetype, op1));
wide_int wop1 = -wi::to_wide (TREE_OPERAND (gnu_size, 1));
tree op1 = wide_int_to_tree (sizetype, wop1);
ops[1] = annotate_value (build1 (NEGATE_EXPR, sizetype, op1));
}
break;
+195 -150
View File
@@ -778,6 +778,7 @@ lvalue_required_for_attribute_p (Node_Id gnat_node)
case Attr_Range_Length:
case Attr_Length:
case Attr_Object_Size:
case Attr_Size:
case Attr_Value_Size:
case Attr_Component_Size:
case Attr_Descriptor_Size:
@@ -797,7 +798,6 @@ lvalue_required_for_attribute_p (Node_Id gnat_node)
case Attr_Unrestricted_Access:
case Attr_Code_Address:
case Attr_Pool_Address:
case Attr_Size:
case Attr_Alignment:
case Attr_Bit_Position:
case Attr_Position:
@@ -1021,6 +1021,42 @@ fold_constant_decl_in_expr (tree exp)
gcc_unreachable ();
}
/* Return true if TYPE and DEF_TYPE are compatible GNAT types for Gigi. */
static bool
Gigi_Types_Compatible (Entity_Id type, Entity_Id def_type)
{
/* The trivial case. */
if (type == def_type)
return true;
/* A class-wide type is equivalent to a subtype of itself. */
if (Is_Class_Wide_Type (type))
return true;
/* A packed array type is compatible with its implementation type. */
if (Is_Packed (def_type) && type == Packed_Array_Impl_Type (def_type))
return true;
/* If both types are Itypes, one may be a copy of the other. */
if (Is_Itype (def_type) && Is_Itype (type))
return true;
/* If the type is incomplete and comes from a limited context, then also
consider its non-limited view. */
if (Is_Incomplete_Type (def_type)
&& From_Limited_With (def_type)
&& Present (Non_Limited_View (def_type)))
return Gigi_Types_Compatible (type, Non_Limited_View (def_type));
/* If the type is incomplete/private, then also consider its full view. */
if (Is_Incomplete_Or_Private_Type (def_type)
&& Present (Full_View (def_type)))
return Gigi_Types_Compatible (type, Full_View (def_type));
return false;
}
/* Subroutine of gnat_to_gnu to translate gnat_node, an N_Identifier,
to a GCC tree, which is returned. GNU_RESULT_TYPE_P is a pointer
to where we should place the result type. */
@@ -1028,55 +1064,31 @@ fold_constant_decl_in_expr (tree exp)
static tree
Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
{
Node_Id gnat_temp, gnat_temp_type;
tree gnu_result, gnu_result_type;
/* Whether we should require an lvalue for GNAT_NODE. Needed in
specific circumstances only, so evaluated lazily. < 0 means
unknown, > 0 means known true, 0 means known false. */
int require_lvalue = -1;
/* The entity of GNAT_NODE and its type. */
Node_Id gnat_entity = (Nkind (gnat_node) == N_Defining_Identifier
|| Nkind (gnat_node) == N_Defining_Operator_Symbol)
? gnat_node : Entity (gnat_node);
Node_Id gnat_entity_type = Etype (gnat_entity);
/* If GNAT_NODE is a constant, whether we should use the initialization
value instead of the constant entity, typically for scalars with an
address clause when the parent doesn't require an lvalue. */
bool use_constant_initializer = false;
/* Whether we should require an lvalue for GNAT_NODE. Needed in
specific circumstances only, so evaluated lazily. < 0 means
unknown, > 0 means known true, 0 means known false. */
int require_lvalue = -1;
Node_Id gnat_result_type;
tree gnu_result, gnu_result_type;
/* If the Etype of this node is not the same as that of the Entity, then
something went wrong, probably in generic instantiation. However, this
does not apply to types. Since we sometime have strange Ekind's, just
do this test for objects. Moreover, if the Etype of the Entity is private
or incomplete coming from a limited context, the Etype of the N_Identifier
is allowed to be the full/non-limited view and we also consider a packed
array type to be the same as the original type. Similarly, a CW type is
equivalent to a subtype of itself. Finally, if the types are Itypes, one
may be a copy of the other, which is also legal. */
gnat_temp = ((Nkind (gnat_node) == N_Defining_Identifier
|| Nkind (gnat_node) == N_Defining_Operator_Symbol)
? gnat_node : Entity (gnat_node));
gnat_temp_type = Etype (gnat_temp);
gcc_assert (Etype (gnat_node) == gnat_temp_type
|| (Is_Packed (gnat_temp_type)
&& (Etype (gnat_node)
== Packed_Array_Impl_Type (gnat_temp_type)))
|| (Is_Class_Wide_Type (Etype (gnat_node)))
|| (Is_Incomplete_Or_Private_Type (gnat_temp_type)
&& Present (Full_View (gnat_temp_type))
&& ((Etype (gnat_node) == Full_View (gnat_temp_type))
|| (Is_Packed (Full_View (gnat_temp_type))
&& (Etype (gnat_node)
== Packed_Array_Impl_Type
(Full_View (gnat_temp_type))))))
|| (Is_Incomplete_Type (gnat_temp_type)
&& From_Limited_With (gnat_temp_type)
&& Present (Non_Limited_View (gnat_temp_type))
&& Etype (gnat_node) == Non_Limited_View (gnat_temp_type))
|| (Is_Itype (Etype (gnat_node)) && Is_Itype (gnat_temp_type))
|| !(Ekind (gnat_temp) == E_Variable
|| Ekind (gnat_temp) == E_Component
|| Ekind (gnat_temp) == E_Constant
|| Ekind (gnat_temp) == E_Loop_Parameter
|| Is_Formal (gnat_temp)));
do this test for objects, except for discriminants because their type
may have been changed to a subtype by Exp_Ch3.Adjust_Discriminants. */
gcc_assert (!Is_Object (gnat_entity)
|| Ekind (gnat_entity) == E_Discriminant
|| Etype (gnat_node) == gnat_entity_type
|| Gigi_Types_Compatible (Etype (gnat_node), gnat_entity_type));
/* If this is a reference to a deferred constant whose partial view is an
unconstrained private type, the proper type is on the full view of the
@@ -1086,36 +1098,40 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
attribute Position, generated for dispatching code (see Make_DT in
exp_disp,adb). In that case we need the type itself, not is parent,
in particular if it is a derived type */
if (Ekind (gnat_temp) == E_Constant
&& Is_Private_Type (gnat_temp_type)
&& (Has_Unknown_Discriminants (gnat_temp_type)
|| (Present (Full_View (gnat_temp_type))
&& Has_Discriminants (Full_View (gnat_temp_type))))
&& Present (Full_View (gnat_temp)))
if (Ekind (gnat_entity) == E_Constant
&& Is_Private_Type (gnat_entity_type)
&& (Has_Unknown_Discriminants (gnat_entity_type)
|| (Present (Full_View (gnat_entity_type))
&& Has_Discriminants (Full_View (gnat_entity_type))))
&& Present (Full_View (gnat_entity)))
{
gnat_temp = Full_View (gnat_temp);
gnat_temp_type = Etype (gnat_temp);
gnat_entity = Full_View (gnat_entity);
gnat_result_type = Etype (gnat_entity);
}
else
{
/* We want to use the Actual_Subtype if it has already been elaborated,
otherwise the Etype. Avoid using Actual_Subtype for packed arrays to
simplify things. */
if ((Ekind (gnat_temp) == E_Constant
|| Ekind (gnat_temp) == E_Variable || Is_Formal (gnat_temp))
&& !(Is_Array_Type (Etype (gnat_temp))
&& Present (Packed_Array_Impl_Type (Etype (gnat_temp))))
&& Present (Actual_Subtype (gnat_temp))
&& present_gnu_tree (Actual_Subtype (gnat_temp)))
gnat_temp_type = Actual_Subtype (gnat_temp);
/* We use the Actual_Subtype only if it has already been elaborated,
as we may be invoked precisely during its elaboration, otherwise
the Etype. Avoid using it for packed arrays to simplify things,
except in a return statement because we need the actual size and
the front-end does not make it explicit in this case. */
if ((Ekind (gnat_entity) == E_Constant
|| Ekind (gnat_entity) == E_Variable
|| Is_Formal (gnat_entity))
&& !(Is_Array_Type (Etype (gnat_entity))
&& Present (Packed_Array_Impl_Type (Etype (gnat_entity)))
&& Nkind (Parent (gnat_node)) != N_Simple_Return_Statement)
&& Present (Actual_Subtype (gnat_entity))
&& present_gnu_tree (Actual_Subtype (gnat_entity)))
gnat_result_type = Actual_Subtype (gnat_entity);
else
gnat_temp_type = Etype (gnat_node);
gnat_result_type = Etype (gnat_node);
}
/* Expand the type of this identifier first, in case it is an enumeral
literal, which only get made when the type is expanded. There is no
order-of-elaboration issue here. */
gnu_result_type = get_unpadded_type (gnat_temp_type);
gnu_result_type = get_unpadded_type (gnat_result_type);
/* If this is a non-imported elementary constant with an address clause,
retrieve the value instead of a pointer to be dereferenced unless
@@ -1125,10 +1141,10 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
statement alternative or a record discriminant. There is no possible
volatile-ness short-circuit here since Volatile constants must be
imported per C.6. */
if (Ekind (gnat_temp) == E_Constant
&& Is_Elementary_Type (gnat_temp_type)
&& !Is_Imported (gnat_temp)
&& Present (Address_Clause (gnat_temp)))
if (Ekind (gnat_entity) == E_Constant
&& Is_Elementary_Type (gnat_result_type)
&& !Is_Imported (gnat_entity)
&& Present (Address_Clause (gnat_entity)))
{
require_lvalue
= lvalue_required_p (gnat_node, gnu_result_type, true, false);
@@ -1139,13 +1155,13 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
{
/* If this is a deferred constant, the initializer is attached to
the full view. */
if (Present (Full_View (gnat_temp)))
gnat_temp = Full_View (gnat_temp);
if (Present (Full_View (gnat_entity)))
gnat_entity = Full_View (gnat_entity);
gnu_result = gnat_to_gnu (Expression (Declaration_Node (gnat_temp)));
gnu_result = gnat_to_gnu (Expression (Declaration_Node (gnat_entity)));
}
else
gnu_result = gnat_to_gnu_entity (gnat_temp, NULL_TREE, false);
gnu_result = gnat_to_gnu_entity (gnat_entity, NULL_TREE, false);
/* Some objects (such as parameters passed by reference, globals of
variable size, and renamed objects) actually represent the address
@@ -1184,7 +1200,7 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
if ((TREE_CODE (gnu_result) == INDIRECT_REF
|| TREE_CODE (gnu_result) == UNCONSTRAINED_ARRAY_REF)
&& No (Address_Clause (gnat_temp)))
&& No (Address_Clause (gnat_entity)))
TREE_THIS_NOTRAP (gnu_result) = 1;
if (read_only)
@@ -1218,9 +1234,9 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
/* But for a constant renaming we couldn't do that incrementally for its
definition because of the need to return an lvalue so, if the present
context doesn't itself require an lvalue, we try again here. */
else if (Ekind (gnat_temp) == E_Constant
&& Is_Elementary_Type (gnat_temp_type)
&& Present (Renamed_Object (gnat_temp)))
else if (Ekind (gnat_entity) == E_Constant
&& Is_Elementary_Type (gnat_result_type)
&& Present (Renamed_Object (gnat_entity)))
{
if (require_lvalue < 0)
require_lvalue
@@ -1236,10 +1252,10 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
avoid problematic conversions to the nominal subtype. But remove any
padding from the resulting type. */
if (FUNC_OR_METHOD_TYPE_P (TREE_TYPE (gnu_result))
|| Is_Constr_Subt_For_UN_Aliased (gnat_temp_type)
|| (Ekind (gnat_temp) == E_Constant
&& Present (Full_View (gnat_temp))
&& Has_Discriminants (gnat_temp_type)
|| Is_Constr_Subt_For_UN_Aliased (gnat_result_type)
|| (Ekind (gnat_entity) == E_Constant
&& Present (Full_View (gnat_entity))
&& Has_Discriminants (gnat_result_type)
&& TREE_CODE (gnu_result) == CONSTRUCTOR))
{
gnu_result_type = TREE_TYPE (gnu_result);
@@ -2232,32 +2248,29 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
/* For other address attributes applied to a nested function,
find an inner ADDR_EXPR and annotate it so that we can issue
a useful warning with -Wtrampolines. */
else if (FUNC_OR_METHOD_TYPE_P (TREE_TYPE (gnu_prefix)))
else if (FUNC_OR_METHOD_TYPE_P (TREE_TYPE (gnu_prefix))
&& (gnu_expr = remove_conversions (gnu_result, false))
&& TREE_CODE (gnu_expr) == ADDR_EXPR
&& decl_function_context (TREE_OPERAND (gnu_expr, 0)))
{
gnu_expr = remove_conversions (gnu_result, false);
set_expr_location_from_node (gnu_expr, gnat_node);
if (TREE_CODE (gnu_expr) == ADDR_EXPR
&& decl_function_context (TREE_OPERAND (gnu_expr, 0)))
{
set_expr_location_from_node (gnu_expr, gnat_node);
/* Also check the inlining status. */
check_inlining_for_nested_subprog (TREE_OPERAND (gnu_expr, 0));
/* Also check the inlining status. */
check_inlining_for_nested_subprog (TREE_OPERAND (gnu_expr, 0));
/* Moreover, for 'Access or 'Unrestricted_Access with non-
foreign-compatible representation, mark the ADDR_EXPR so
that we can build a descriptor instead of a trampoline. */
if ((attribute == Attr_Access
|| attribute == Attr_Unrestricted_Access)
&& targetm.calls.custom_function_descriptors > 0
&& Can_Use_Internal_Rep (Underlying_Type (Etype (gnat_node))))
FUNC_ADDR_BY_DESCRIPTOR (gnu_expr) = 1;
/* Moreover, for 'Access or 'Unrestricted_Access with non-
foreign-compatible representation, mark the ADDR_EXPR so
that we can build a descriptor instead of a trampoline. */
if ((attribute == Attr_Access
|| attribute == Attr_Unrestricted_Access)
&& targetm.calls.custom_function_descriptors > 0
&& Can_Use_Internal_Rep (Etype (gnat_node)))
FUNC_ADDR_BY_DESCRIPTOR (gnu_expr) = 1;
/* Otherwise, we need to check that we are not violating the
No_Implicit_Dynamic_Code restriction. */
else if (targetm.calls.custom_function_descriptors != 0)
Check_Implicit_Dynamic_Code_Allowed (gnat_node);
}
/* Otherwise, we need to check that we are not violating the
No_Implicit_Dynamic_Code restriction. */
else if (targetm.calls.custom_function_descriptors != 0)
Check_Implicit_Dynamic_Code_Allowed (gnat_node);
}
break;
@@ -2300,21 +2313,24 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
case Attr_Object_Size:
case Attr_Value_Size:
case Attr_Max_Size_In_Storage_Elements:
gnu_expr = gnu_prefix;
/* Remove NOPs and conversions between original and packable version
from GNU_EXPR, and conversions from GNU_PREFIX. We use GNU_EXPR
to see if a COMPONENT_REF was involved. */
while (TREE_CODE (gnu_expr) == NOP_EXPR
|| (TREE_CODE (gnu_expr) == VIEW_CONVERT_EXPR
&& TREE_CODE (TREE_TYPE (gnu_expr)) == RECORD_TYPE
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (gnu_expr, 0)))
/* Strip NOPs, conversions between original and packable versions, and
unpadding from GNU_PREFIX. Note that we cannot simply strip every
VIEW_CONVERT_EXPR because some of them may give the actual size, e.g.
for nominally unconstrained packed array. We use GNU_EXPR to see
if a COMPONENT_REF was involved. */
while (CONVERT_EXPR_P (gnu_prefix)
|| TREE_CODE (gnu_prefix) == NON_LVALUE_EXPR
|| (TREE_CODE (gnu_prefix) == VIEW_CONVERT_EXPR
&& TREE_CODE (TREE_TYPE (gnu_prefix)) == RECORD_TYPE
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (gnu_prefix, 0)))
== RECORD_TYPE
&& TYPE_NAME (TREE_TYPE (gnu_expr))
== TYPE_NAME (TREE_TYPE (TREE_OPERAND (gnu_expr, 0)))))
gnu_expr = TREE_OPERAND (gnu_expr, 0);
gnu_prefix = remove_conversions (gnu_prefix, true);
&& TYPE_NAME (TREE_TYPE (gnu_prefix))
== TYPE_NAME (TREE_TYPE (TREE_OPERAND (gnu_prefix, 0)))))
gnu_prefix = TREE_OPERAND (gnu_prefix, 0);
gnu_expr = gnu_prefix;
if (TREE_CODE (gnu_prefix) == COMPONENT_REF
&& TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_prefix, 0))))
gnu_prefix = TREE_OPERAND (gnu_prefix, 0);
prefix_unused = true;
gnu_type = TREE_TYPE (gnu_prefix);
@@ -2377,7 +2393,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
/* Deal with a self-referential size by qualifying the size with the
object or returning the maximum size for a type. */
if (TREE_CODE (gnu_prefix) != TYPE_DECL)
gnu_result = SUBSTITUTE_PLACEHOLDER_IN_EXPR (gnu_result, gnu_expr);
gnu_result = SUBSTITUTE_PLACEHOLDER_IN_EXPR (gnu_result, gnu_prefix);
else if (CONTAINS_PLACEHOLDER_P (gnu_result))
gnu_result = max_size (gnu_result, true);
@@ -4266,6 +4282,20 @@ finalize_nrv_unc_r (tree *tp, int *walk_subtrees, void *data)
return NULL_TREE;
}
/* Apply FUNC to all the sub-trees of nested functions in NODE. FUNC is called
with the DATA and the address of each sub-tree. If FUNC returns a non-NULL
value, the traversal is stopped. */
static void
walk_nesting_tree (struct cgraph_node *node, walk_tree_fn func, void *data)
{
for (node = node->nested; node; node = node->next_nested)
{
walk_tree_without_duplicates (&DECL_SAVED_TREE (node->decl), func, data);
walk_nesting_tree (node, func, data);
}
}
/* Finalize the Named Return Value optimization for FNDECL. The NRV bitmap
contains the candidates for Named Return Value and OTHER is a list of
the other return values. GNAT_RET is a representative return node. */
@@ -4273,7 +4303,6 @@ finalize_nrv_unc_r (tree *tp, int *walk_subtrees, void *data)
static void
finalize_nrv (tree fndecl, bitmap nrv, vec<tree, va_gc> *other, Node_Id gnat_ret)
{
struct cgraph_node *node;
struct nrv_data data;
walk_tree_fn func;
unsigned int i;
@@ -4294,10 +4323,7 @@ finalize_nrv (tree fndecl, bitmap nrv, vec<tree, va_gc> *other, Node_Id gnat_ret
return;
/* Prune also the candidates that are referenced by nested functions. */
node = cgraph_node::get_create (fndecl);
for (node = node->nested; node; node = node->next_nested)
walk_tree_without_duplicates (&DECL_SAVED_TREE (node->decl), prune_nrv_r,
&data);
walk_nesting_tree (cgraph_node::get_create (fndecl), prune_nrv_r, &data);
if (bitmap_empty_p (nrv))
return;
@@ -5074,7 +5100,8 @@ Call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target,
/* If the access type doesn't require foreign-compatible representation,
be prepared for descriptors. */
if (targetm.calls.custom_function_descriptors > 0
&& Can_Use_Internal_Rep (Etype (Prefix (Name (gnat_node)))))
&& Can_Use_Internal_Rep
(Underlying_Type (Etype (Prefix (Name (gnat_node))))))
by_descriptor = true;
}
else if (Nkind (Name (gnat_node)) == N_Attribute_Reference)
@@ -5297,13 +5324,23 @@ Call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target,
/* Create an explicit temporary holding the copy. */
if (atomic_p)
gnu_name = build_atomic_load (gnu_name, sync);
gnu_temp
= create_init_temporary ("A", gnu_name, &gnu_stmt, gnat_actual);
/* But initialize it on the fly like for an implicit temporary as
we aren't necessarily having a statement list. */
gnu_name = build_compound_expr (TREE_TYPE (gnu_name), gnu_stmt,
gnu_temp);
/* Do not initialize it for the _Init parameter of an initialization
procedure since no data is meant to be passed in. */
if (Ekind (gnat_formal) == E_Out_Parameter
&& Is_Entity_Name (Name (gnat_node))
&& Is_Init_Proc (Entity (Name (gnat_node))))
gnu_name = gnu_temp = create_temporary ("A", TREE_TYPE (gnu_name));
/* Initialize it on the fly like for an implicit temporary in the
other cases, as we don't necessarily have a statement list. */
else
{
gnu_temp = create_init_temporary ("A", gnu_name, &gnu_stmt,
gnat_actual);
gnu_name = build_compound_expr (TREE_TYPE (gnu_name), gnu_stmt,
gnu_temp);
}
/* Set up to move the copy back to the original if needed. */
if (!in_param)
@@ -5354,7 +5391,7 @@ Call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target,
since the parent is a procedure call, so put it back here. Note that
we might have a dummy type here if the actual is the dereference of a
pointer to it, but that's OK if the formal is passed by reference. */
tree gnu_actual_type = gnat_to_gnu_type (Etype (gnat_actual));
tree gnu_actual_type = get_unpadded_type (Etype (gnat_actual));
if (TYPE_IS_DUMMY_P (gnu_actual_type))
gcc_assert (is_true_formal_parm && DECL_BY_REF_P (gnu_formal));
else if (suppress_type_conversion
@@ -7512,16 +7549,15 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_rhs = convert (gnu_type, gnu_rhs);
}
/* Instead of expanding overflow checks for addition, subtraction
and multiplication itself, the front end will leave this to
the back end when Backend_Overflow_Checks_On_Target is set. */
/* For signed integer addition, subtraction and multiplication, do an
overflow check if required. */
if (Do_Overflow_Check (gnat_node)
&& Backend_Overflow_Checks_On_Target
&& (code == PLUS_EXPR || code == MINUS_EXPR || code == MULT_EXPR)
&& !TYPE_UNSIGNED (gnu_type)
&& !FLOAT_TYPE_P (gnu_type))
gnu_result = build_binary_op_trapv (code, gnu_type,
gnu_lhs, gnu_rhs, gnat_node);
gnu_result
= build_binary_op_trapv (code, gnu_type, gnu_lhs, gnu_rhs,
gnat_node);
else
{
/* Some operations, e.g. comparisons of arrays, generate complex
@@ -7585,19 +7621,17 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_expr = gnat_to_gnu (Right_Opnd (gnat_node));
gnu_result_type = get_unpadded_type (Etype (gnat_node));
/* Instead of expanding overflow checks for negation and absolute
value itself, the front end will leave this to the back end
when Backend_Overflow_Checks_On_Target is set. */
/* For signed integer negation and absolute value, do an overflow check
if required. */
if (Do_Overflow_Check (gnat_node)
&& Backend_Overflow_Checks_On_Target
&& !TYPE_UNSIGNED (gnu_result_type)
&& !FLOAT_TYPE_P (gnu_result_type))
gnu_result
= build_unary_op_trapv (gnu_codes[kind],
gnu_result_type, gnu_expr, gnat_node);
= build_unary_op_trapv (gnu_codes[kind], gnu_result_type, gnu_expr,
gnat_node);
else
gnu_result = build_unary_op (gnu_codes[kind],
gnu_result_type, gnu_expr);
gnu_result
= build_unary_op (gnu_codes[kind], gnu_result_type, gnu_expr);
break;
case N_Allocator:
@@ -8274,7 +8308,7 @@ gnat_to_gnu (Node_Id gnat_node)
gnat_temp = Entity (Name (gnat_node));
if (Freeze_Node (gnat_temp))
{
tree gnu_address = gnat_to_gnu (Expression (gnat_node));
tree gnu_address = gnat_to_gnu (Expression (gnat_node)), gnu_temp;
/* Get the value to use as the address and save it as the equivalent
for the object; when it is frozen, gnat_to_gnu_entity will do the
@@ -8284,7 +8318,7 @@ gnat_to_gnu (Node_Id gnat_node)
of the object is limited and it is initialized with the result of
a function call. */
if (Is_Subprogram (gnat_temp))
gnu_result = gnu_address;
gnu_temp = gnu_address;
else
{
tree gnu_type = gnat_to_gnu_type (Etype (gnat_temp));
@@ -8293,11 +8327,11 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_type
= build_reference_type_for_mode (gnu_type, ptr_mode, true);
gnu_address = convert (gnu_type, gnu_address);
gnu_result
gnu_temp
= build_unary_op (INDIRECT_REF, NULL_TREE, gnu_address);
}
save_gnu_tree (gnat_temp, gnu_result, true);
save_gnu_tree (gnat_temp, gnu_temp, true);
}
break;
@@ -8669,7 +8703,11 @@ gnat_to_gnu (Node_Id gnat_node)
declaration, return the result unmodified because we want to use the
return slot optimization in this case.
5. Finally, if the type of the result is already correct. */
5. If this is a reference to an unconstrained array which is used as the
prefix of an attribute reference that requires an lvalue, return the
result unmodified because we want return the original bounds.
6. Finally, if the type of the result is already correct. */
if (Present (Parent (gnat_node))
&& (lhs_or_actual_p (gnat_node)
@@ -8718,13 +8756,19 @@ gnat_to_gnu (Node_Id gnat_node)
else if (gnu_result == error_mark_node || gnu_result_type == void_type_node)
gnu_result = error_mark_node;
else if (Present (Parent (gnat_node))
else if (TREE_CODE (gnu_result) == CALL_EXPR
&& Present (Parent (gnat_node))
&& (Nkind (Parent (gnat_node)) == N_Object_Declaration
|| Nkind (Parent (gnat_node)) == N_Object_Renaming_Declaration)
&& TREE_CODE (gnu_result) == CALL_EXPR
&& return_type_with_variable_size_p (TREE_TYPE (gnu_result)))
;
else if (TREE_CODE (gnu_result) == UNCONSTRAINED_ARRAY_REF
&& Present (Parent (gnat_node))
&& Nkind (Parent (gnat_node)) == N_Attribute_Reference
&& lvalue_required_for_attribute_p (Parent (gnat_node)))
;
else if (TREE_TYPE (gnu_result) != gnu_result_type)
gnu_result = convert (gnu_result_type, gnu_result);
@@ -8957,8 +9001,9 @@ mark_visited_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
else if (!TYPE_IS_DUMMY_P (t))
TREE_VISITED (t) = 1;
/* The test in gimplify_type_sizes is on the main variant. */
if (TYPE_P (t))
TYPE_SIZES_GIMPLIFIED (t) = 1;
TYPE_SIZES_GIMPLIFIED (TYPE_MAIN_VARIANT (t)) = 1;
return NULL_TREE;
}
+24 -24
View File
@@ -1530,14 +1530,14 @@ built:
generated for some other corresponding source entity. */
if (Comes_From_Source (gnat_entity))
{
if (Present (gnat_error_node))
post_error_ne_tree ("{^ }bits of & unused?",
gnat_error_node, gnat_entity,
size_diffop (size, orig_size));
else if (is_component_type)
if (is_component_type)
post_error_ne_tree ("component of& padded{ by ^ bits}?",
gnat_entity, gnat_entity,
size_diffop (size, orig_size));
else if (Present (gnat_error_node))
post_error_ne_tree ("{^ }bits of & unused?",
gnat_error_node, gnat_entity,
size_diffop (size, orig_size));
}
}
@@ -1860,6 +1860,9 @@ finish_record_type (tree record_type, tree field_list, int rep_level,
else
this_ada_size = this_size;
const bool variant_part = (TREE_CODE (type) == QUAL_UNION_TYPE);
const bool variant_part_at_zero = variant_part && integer_zerop (pos);
/* Clear DECL_BIT_FIELD for the cases layout_decl does not handle. */
if (DECL_BIT_FIELD (field)
&& operand_equal_p (this_size, TYPE_SIZE (type), 0))
@@ -1901,9 +1904,7 @@ finish_record_type (tree record_type, tree field_list, int rep_level,
/* Clear DECL_BIT_FIELD_TYPE for a variant part at offset 0, it's simply
not supported by the DECL_BIT_FIELD_REPRESENTATIVE machinery because
the variant part is always the last field in the list. */
if (DECL_INTERNAL_P (field)
&& TREE_CODE (TREE_TYPE (field)) == QUAL_UNION_TYPE
&& integer_zerop (pos))
if (variant_part_at_zero)
DECL_BIT_FIELD_TYPE (field) = NULL_TREE;
/* If we still have DECL_BIT_FIELD set at this point, we know that the
@@ -1938,18 +1939,18 @@ finish_record_type (tree record_type, tree field_list, int rep_level,
case RECORD_TYPE:
/* Since we know here that all fields are sorted in order of
increasing bit position, the size of the record is one
higher than the ending bit of the last field processed
unless we have a rep clause, since in that case we might
have a field outside a QUAL_UNION_TYPE that has a higher ending
position. So use a MAX in that case. Also, if this field is a
QUAL_UNION_TYPE, we need to take into account the previous size in
the case of empty variants. */
higher than the ending bit of the last field processed,
unless we have a variant part at offset 0, since in this
case we might have a field outside the variant part that
has a higher ending position; so use a MAX in this case.
Also, if this field is a QUAL_UNION_TYPE, we need to take
into account the previous size in the case of empty variants. */
ada_size
= merge_sizes (ada_size, pos, this_ada_size,
TREE_CODE (type) == QUAL_UNION_TYPE, rep_level > 0);
= merge_sizes (ada_size, pos, this_ada_size, variant_part,
variant_part_at_zero);
size
= merge_sizes (size, pos, this_size,
TREE_CODE (type) == QUAL_UNION_TYPE, rep_level > 0);
= merge_sizes (size, pos, this_size, variant_part,
variant_part_at_zero);
break;
default:
@@ -2230,13 +2231,12 @@ rest_of_record_type_compilation (tree record_type)
/* Utility function of above to merge LAST_SIZE, the previous size of a record
with FIRST_BIT and SIZE that describe a field. SPECIAL is true if this
represents a QUAL_UNION_TYPE in which case we must look for COND_EXPRs and
replace a value of zero with the old size. If HAS_REP is true, we take the
replace a value of zero with the old size. If MAX is true, we take the
MAX of the end position of this field with LAST_SIZE. In all other cases,
we use FIRST_BIT plus SIZE. Return an expression for the size. */
static tree
merge_sizes (tree last_size, tree first_bit, tree size, bool special,
bool has_rep)
merge_sizes (tree last_size, tree first_bit, tree size, bool special, bool max)
{
tree type = TREE_TYPE (last_size);
tree new_size;
@@ -2244,7 +2244,7 @@ merge_sizes (tree last_size, tree first_bit, tree size, bool special,
if (!special || TREE_CODE (size) != COND_EXPR)
{
new_size = size_binop (PLUS_EXPR, first_bit, size);
if (has_rep)
if (max)
new_size = size_binop (MAX_EXPR, last_size, new_size);
}
@@ -2253,11 +2253,11 @@ merge_sizes (tree last_size, tree first_bit, tree size, bool special,
integer_zerop (TREE_OPERAND (size, 1))
? last_size : merge_sizes (last_size, first_bit,
TREE_OPERAND (size, 1),
1, has_rep),
1, max),
integer_zerop (TREE_OPERAND (size, 2))
? last_size : merge_sizes (last_size, first_bit,
TREE_OPERAND (size, 2),
1, has_rep));
1, max));
/* We don't need any NON_VALUE_EXPRs and they can confuse us (especially
when fed through SUBSTITUTE_IN_EXPR) into thinking that a constant
+29 -1
View File
@@ -1884,6 +1884,7 @@ begin
Clean_Link_Option_Set : declare
J : Natural;
Shared_Libgcc_Seen : Boolean := False;
Static_Libgcc_Seen : Boolean := False;
begin
J := Linker_Options.First;
@@ -1905,7 +1906,7 @@ begin
end if;
end if;
-- Remove duplicate -shared-libgcc switch
-- Remove duplicate -shared-libgcc switches
if Linker_Options.Table (J).all = Shared_Libgcc_String then
if Shared_Libgcc_Seen then
@@ -1919,6 +1920,20 @@ begin
end if;
end if;
-- Remove duplicate -static-libgcc switches
if Linker_Options.Table (J).all = Static_Libgcc_String then
if Static_Libgcc_Seen then
Linker_Options.Table (J .. Linker_Options.Last - 1) :=
Linker_Options.Table (J + 1 .. Linker_Options.Last);
Linker_Options.Decrement_Last;
Num_Args := Num_Args - 1;
else
Static_Libgcc_Seen := True;
end if;
end if;
-- Here we just check for a canonical form that matches the
-- pragma Linker_Options set in the NT runtime.
@@ -1950,14 +1965,27 @@ begin
-- libgcc, if gcc is not called with -shared-libgcc, call it
-- with -static-libgcc, as there are some platforms where one
-- of these two switches is compulsory to link.
-- Don't push extra switches if we already saw one.
if Shared_Libgcc_Default = 'T'
and then not Shared_Libgcc_Seen
and then not Static_Libgcc_Seen
then
Linker_Options.Increment_Last;
Linker_Options.Table (Linker_Options.Last) := Static_Libgcc;
Num_Args := Num_Args + 1;
end if;
-- Likewise, the reverse.
if Shared_Libgcc_Default = 'H'
and then not Static_Libgcc_Seen
and then not Shared_Libgcc_Seen
then
Linker_Options.Increment_Last;
Linker_Options.Table (Linker_Options.Last) := Shared_Libgcc;
Num_Args := Num_Args + 1;
end if;
end if;
end Clean_Link_Option_Set;
+2 -6
View File
@@ -206,9 +206,8 @@ package System.OS_Interface is
function nanosleep (rqtp, rmtp : access timespec) return int;
pragma Import (C, nanosleep, "nanosleep");
type clockid_t is private;
CLOCK_REALTIME : constant clockid_t;
type clockid_t is new int;
CLOCK_REALTIME : constant clockid_t := 0;
function clock_gettime
(clock_id : clockid_t;
@@ -607,9 +606,6 @@ private
end record;
pragma Convention (C, timespec);
type clockid_t is new int;
CLOCK_REALTIME : constant clockid_t := 0;
type pthread_attr_t is record
detachstate : int;
schedpolicy : int;
+1 -1
View File
@@ -158,7 +158,7 @@ private
Preallocated_Stacks : constant Boolean := False;
Signed_Zeros : constant Boolean := True;
Stack_Check_Default : constant Boolean := False;
Stack_Check_Probes : constant Boolean := False;
Stack_Check_Probes : constant Boolean := True;
Stack_Check_Limits : constant Boolean := False;
Support_Aggregates : constant Boolean := True;
Support_Atomic_Primitives : constant Boolean := Word_Size = 64;
+1 -1
View File
@@ -529,7 +529,7 @@ static char* iso_3166[] =
"UM", "United States Minor Outlying Islands",
"US", "United States",
"US", "United States of America",
"US", "United-States"
"US", "United-States",
"UY", "Uruguay",
"UZ", "Uzbekistan",
+48 -27
View File
@@ -3359,8 +3359,6 @@ package body Sem_Ch5 is
-- The following exception is raised by routine Prepare_Loop_Statement
-- to avoid further analysis of a transformed loop.
Skip_Analysis : exception;
function Disable_Constant (N : Node_Id) return Traverse_Result;
-- If N represents an E_Variable entity, set Is_True_Constant To False
@@ -3368,11 +3366,12 @@ package body Sem_Ch5 is
-- Helper for Analyze_Loop_Statement, to unset Is_True_Constant on
-- variables referenced within an OpenACC construct.
procedure Prepare_Loop_Statement (Iter : Node_Id);
procedure Prepare_Loop_Statement
(Iter : Node_Id;
Stop_Processing : out Boolean);
-- Determine whether loop statement N with iteration scheme Iter must be
-- transformed prior to analysis, and if so, perform it. The routine
-- raises Skip_Analysis to prevent further analysis of the transformed
-- loop.
-- transformed prior to analysis, and if so, perform it.
-- If Stop_Processing is set to True, should stop further processing.
----------------------
-- Disable_Constant --
@@ -3394,7 +3393,10 @@ package body Sem_Ch5 is
-- Prepare_Loop_Statement --
----------------------------
procedure Prepare_Loop_Statement (Iter : Node_Id) is
procedure Prepare_Loop_Statement
(Iter : Node_Id;
Stop_Processing : out Boolean)
is
function Has_Sec_Stack_Default_Iterator
(Cont_Typ : Entity_Id) return Boolean;
pragma Inline (Has_Sec_Stack_Default_Iterator);
@@ -3414,21 +3416,27 @@ package body Sem_Ch5 is
-- Determine whether arbitrary statement Stmt is the sole statement
-- wrapped within some block, excluding pragmas.
procedure Prepare_Iterator_Loop (Iter_Spec : Node_Id);
procedure Prepare_Iterator_Loop
(Iter_Spec : Node_Id;
Stop_Processing : out Boolean);
pragma Inline (Prepare_Iterator_Loop);
-- Prepare an iterator loop with iteration specification Iter_Spec
-- for transformation if needed.
-- If Stop_Processing is set to True, should stop further processing.
procedure Prepare_Param_Spec_Loop (Param_Spec : Node_Id);
procedure Prepare_Param_Spec_Loop
(Param_Spec : Node_Id;
Stop_Processing : out Boolean);
pragma Inline (Prepare_Param_Spec_Loop);
-- Prepare a discrete loop with parameter specification Param_Spec
-- for transformation if needed.
-- If Stop_Processing is set to True, should stop further processing.
procedure Wrap_Loop_Statement (Manage_Sec_Stack : Boolean);
pragma Inline (Wrap_Loop_Statement);
pragma No_Return (Wrap_Loop_Statement);
pragma Inline (Wrap_Loop_Statement);
-- Wrap loop statement N within a block. Flag Manage_Sec_Stack must
-- be set when the block must mark and release the secondary stack.
-- Should stop further processing after calling this procedure.
------------------------------------
-- Has_Sec_Stack_Default_Iterator --
@@ -3504,12 +3512,17 @@ package body Sem_Ch5 is
-- Prepare_Iterator_Loop --
---------------------------
procedure Prepare_Iterator_Loop (Iter_Spec : Node_Id) is
procedure Prepare_Iterator_Loop
(Iter_Spec : Node_Id;
Stop_Processing : out Boolean)
is
Cont_Typ : Entity_Id;
Nam : Node_Id;
Nam_Copy : Node_Id;
begin
Stop_Processing := False;
-- The iterator specification has syntactic errors. Transform the
-- loop into an infinite loop in order to safely perform at least
-- some minor analysis. This check must come first.
@@ -3517,8 +3530,7 @@ package body Sem_Ch5 is
if Error_Posted (Iter_Spec) then
Set_Iteration_Scheme (N, Empty);
Analyze (N);
raise Skip_Analysis;
Stop_Processing := True;
-- Nothing to do when the loop is already wrapped in a block
@@ -3578,6 +3590,7 @@ package body Sem_Ch5 is
(Cont_Typ, Name_First)
or else Is_Sec_Stack_Iteration_Primitive
(Cont_Typ, Name_Next));
Stop_Processing := True;
end if;
end if;
end Prepare_Iterator_Loop;
@@ -3586,7 +3599,10 @@ package body Sem_Ch5 is
-- Prepare_Param_Spec_Loop --
-----------------------------
procedure Prepare_Param_Spec_Loop (Param_Spec : Node_Id) is
procedure Prepare_Param_Spec_Loop
(Param_Spec : Node_Id;
Stop_Processing : out Boolean)
is
High : Node_Id;
Low : Node_Id;
Rng : Node_Id;
@@ -3594,6 +3610,7 @@ package body Sem_Ch5 is
Rng_Typ : Entity_Id;
begin
Stop_Processing := False;
Rng := Discrete_Subtype_Definition (Param_Spec);
-- Nothing to do when the loop is already wrapped in a block
@@ -3622,11 +3639,10 @@ package body Sem_Ch5 is
-- on the secondary stack. Note that the loop must be wrapped
-- only when such a call exists.
if Has_Sec_Stack_Call (Low)
or else
Has_Sec_Stack_Call (High)
if Has_Sec_Stack_Call (Low) or else Has_Sec_Stack_Call (High)
then
Wrap_Loop_Statement (Manage_Sec_Stack => True);
Stop_Processing := True;
end if;
-- Otherwise the parameter specification appears in the form
@@ -3663,6 +3679,7 @@ package body Sem_Ch5 is
and then Needs_Finalization (Rng_Typ))
then
Wrap_Loop_Statement (Manage_Sec_Stack => True);
Stop_Processing := True;
end if;
end if;
end Prepare_Param_Spec_Loop;
@@ -3690,8 +3707,6 @@ package body Sem_Ch5 is
Rewrite (N, Blk);
Analyze (N);
raise Skip_Analysis;
end Wrap_Loop_Statement;
-- Local variables
@@ -3702,11 +3717,13 @@ package body Sem_Ch5 is
-- Start of processing for Prepare_Loop_Statement
begin
Stop_Processing := False;
if Present (Iter_Spec) then
Prepare_Iterator_Loop (Iter_Spec);
Prepare_Iterator_Loop (Iter_Spec, Stop_Processing);
elsif Present (Param_Spec) then
Prepare_Param_Spec_Loop (Param_Spec);
Prepare_Param_Spec_Loop (Param_Spec, Stop_Processing);
end if;
end Prepare_Loop_Statement;
@@ -3805,7 +3822,15 @@ package body Sem_Ch5 is
-- wrapped within a block in order to manage the secondary stack.
if Present (Iter) then
Prepare_Loop_Statement (Iter);
declare
Stop_Processing : Boolean;
begin
Prepare_Loop_Statement (Iter, Stop_Processing);
if Stop_Processing then
return;
end if;
end;
end if;
-- Kill current values on entry to loop, since statements in the body of
@@ -3979,10 +4004,6 @@ package body Sem_Ch5 is
if Is_OpenAcc_Environment (Stmt) then
Disable_Constants (Stmt);
end if;
exception
when Skip_Analysis =>
null;
end Analyze_Loop_Statement;
----------------------------
+2 -4
View File
@@ -4256,16 +4256,14 @@ package body Sem_Ch8 is
-- Common case for compilation unit
elsif Defining_Entity (N => Parent (N),
Empty_On_Errors => True) = Current_Scope
then
elsif Defining_Entity (Parent (N)) = Current_Scope then
null;
else
-- If declaration appears in some other scope, it must be in some
-- parent unit when compiling a child.
Pack := Defining_Entity (Parent (N), Empty_On_Errors => True);
Pack := Defining_Entity (Parent (N));
if not In_Open_Scopes (Pack) then
null;
+13 -3
View File
@@ -5544,13 +5544,23 @@ package body Sem_Elab is
N_Procedure_Instantiation)
and then Nkind (Context) = N_Compilation_Unit
then
return
Related_Instance (Defining_Entity (N, Concurrent_Subunit => True));
return Related_Instance (Defining_Entity (N));
-- The unit denotes a concurrent body acting as a subunit. Such bodies
-- are generally rewritten into null statements. The proper entity is
-- that of the "original node".
elsif Nkind (N) = N_Subunit
and then Nkind (Proper_Body (N)) = N_Null_Statement
and then Nkind_In (Original_Node (Proper_Body (N)), N_Protected_Body,
N_Task_Body)
then
return Defining_Entity (Original_Node (Proper_Body (N)));
-- Otherwise the proper entity is the defining entity
else
return Defining_Entity (N, Concurrent_Subunit => True);
return Defining_Entity (N);
end if;
end Find_Unit_Entity;
+2 -2
View File
@@ -804,7 +804,7 @@ package body Sem_SPARK is
if Present (SPARK_Pragma (Defining_Entity (Body_N))) then
if Get_SPARK_Mode_From_Annotation
(SPARK_Pragma (Defining_Entity (Body_N, False))) /= Opt.On
(SPARK_Pragma (Defining_Entity (Body_N))) /= Opt.On
then
return;
end if;
@@ -1914,7 +1914,7 @@ package body Sem_SPARK is
CorSp : Node_Id;
begin
if Present (SPARK_Pragma (Defining_Entity (Pack, False))) then
if Present (SPARK_Pragma (Defining_Entity (Pack))) then
if Get_SPARK_Mode_From_Annotation
(SPARK_Pragma (Defining_Entity (Pack))) /= Opt.On
then
+9 -34
View File
@@ -5827,11 +5827,7 @@ package body Sem_Util is
-- Defining_Entity --
---------------------
function Defining_Entity
(N : Node_Id;
Empty_On_Errors : Boolean := False;
Concurrent_Subunit : Boolean := False) return Entity_Id
is
function Defining_Entity (N : Node_Id) return Entity_Id is
begin
case Nkind (N) is
when N_Abstract_Subprogram_Declaration
@@ -5882,24 +5878,11 @@ package body Sem_Util is
=>
return Defining_Identifier (N);
when N_Compilation_Unit =>
return Defining_Entity (Unit (N));
when N_Subunit =>
declare
Bod : constant Node_Id := Proper_Body (N);
Orig_Bod : constant Node_Id := Original_Node (Bod);
begin
-- Retrieve the entity of the original protected or task body
-- if requested by the caller.
if Concurrent_Subunit
and then Nkind (Bod) = N_Null_Statement
and then Nkind_In (Orig_Bod, N_Protected_Body, N_Task_Body)
then
return Defining_Entity (Orig_Bod);
else
return Defining_Entity (Bod);
end if;
end;
return Defining_Entity (Proper_Body (N));
when N_Function_Instantiation
| N_Function_Specification
@@ -5925,14 +5908,10 @@ package body Sem_Util is
-- can continue semantic analysis.
elsif Nam = Error then
if Empty_On_Errors then
return Empty;
else
Err := Make_Temporary (Sloc (N), 'T');
Set_Defining_Unit_Name (N, Err);
Err := Make_Temporary (Sloc (N), 'T');
Set_Defining_Unit_Name (N, Err);
return Err;
end if;
return Err;
-- If not an entity, get defining identifier
@@ -5947,11 +5926,7 @@ package body Sem_Util is
return Entity (Identifier (N));
when others =>
if Empty_On_Errors then
return Empty;
else
raise Program_Error;
end if;
raise Program_Error;
end case;
end Defining_Entity;
+1 -20
View File
@@ -543,10 +543,7 @@ package Sem_Util is
-- in the case of a descendant of a generic formal type (returns Int'Last
-- instead of 0).
function Defining_Entity
(N : Node_Id;
Empty_On_Errors : Boolean := False;
Concurrent_Subunit : Boolean := False) return Entity_Id;
function Defining_Entity (N : Node_Id) return Entity_Id;
-- Given a declaration N, returns the associated defining entity. If the
-- declaration has a specification, the entity is obtained from the
-- specification. If the declaration has a defining unit name, then the
@@ -557,22 +554,6 @@ package Sem_Util is
-- local entities declared during loop expansion. These entities need
-- debugging information, generated through Qualify_Entity_Names, and
-- the loop declaration must be placed in the table Name_Qualify_Units.
--
-- Set flag Empty_On_Error to change the behavior of this routine as
-- follows:
--
-- * True - A declaration that lacks a defining entity returns Empty.
-- A node that does not allow for a defining entity returns Empty.
--
-- * False - A declaration that lacks a defining entity is given a new
-- internally generated entity which is subsequently returned. A node
-- that does not allow for a defining entity raises Program_Error.
--
-- The former semantics is appropriate for the back end; the latter
-- semantics is appropriate for the front end.
--
-- Set flag Concurrent_Subunit to handle rewritings of concurrent bodies
-- which act as subunits. Such bodies are generally rewritten as null.
function Denotes_Discriminant
(N : Node_Id;
+30 -4
View File
@@ -1186,15 +1186,14 @@ record_alias_subset (alias_set_type superset, alias_set_type subset)
}
}
/* Record that component types of TYPE, if any, are part of that type for
/* Record that component types of TYPE, if any, are part of SUPERSET for
aliasing purposes. For record types, we only record component types
for fields that are not marked non-addressable. For array types, we
only record the component type if it is not marked non-aliased. */
void
record_component_aliases (tree type)
record_component_aliases (tree type, alias_set_type superset)
{
alias_set_type superset = get_alias_set (type);
tree field;
if (superset == 0)
@@ -1244,7 +1243,21 @@ record_component_aliases (tree type)
== get_alias_set (TREE_TYPE (field)));
}
record_alias_subset (superset, get_alias_set (t));
alias_set_type set = get_alias_set (t);
record_alias_subset (superset, set);
/* If the field has alias-set zero make sure to still record
any componets of it. This makes sure that for
struct A {
struct B {
int i;
char c[4];
} b;
};
in C++ even though 'B' has alias-set zero because
TYPE_TYPELESS_STORAGE is set, 'A' has the alias-set of
'int' as subset. */
if (set == 0)
record_component_aliases (t, superset);
}
break;
@@ -1260,6 +1273,19 @@ record_component_aliases (tree type)
}
}
/* Record that component types of TYPE, if any, are part of that type for
aliasing purposes. For record types, we only record component types
for fields that are not marked non-addressable. For array types, we
only record the component type if it is not marked non-aliased. */
void
record_component_aliases (tree type)
{
alias_set_type superset = get_alias_set (type);
record_component_aliases (type, superset);
}
/* Allocate an alias set for use in storing and reading from the varargs
spill area. */
+12
View File
@@ -1,3 +1,15 @@
2020-03-12 Release Manager
* GCC 9.3.0 released.
2019-08-12 Release Manager
* GCC 9.2.0 released.
2019-05-03 Release Manager
* GCC 9.1.0 released.
2019-01-01 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
+111 -15
View File
@@ -3112,27 +3112,25 @@ expand_builtin_strnlen (tree exp, rtx target, machine_mode target_mode)
return NULL_RTX;
}
if (lendata.decl
&& !TREE_NO_WARNING (exp)
&& ((tree_int_cst_lt (len, bound))
|| !exact))
if (lendata.decl && (tree_int_cst_lt (len, bound) || !exact))
{
location_t warnloc
= expansion_point_location_if_in_system_header (loc);
if (warning_at (warnloc, OPT_Wstringop_overflow_,
exact
? G_("%K%qD specified bound %E exceeds the size %E "
"of unterminated array")
: G_("%K%qD specified bound %E may exceed the size "
"of at most %E of unterminated array"),
exp, func, bound, len))
if (!TREE_NO_WARNING (exp)
&& warning_at (warnloc, OPT_Wstringop_overflow_,
exact
? G_("%K%qD specified bound %E exceeds the size "
"%E of unterminated array")
: G_("%K%qD specified bound %E may exceed the "
"size of at most %E of unterminated array"),
exp, func, bound, len))
{
inform (DECL_SOURCE_LOCATION (lendata.decl),
"referenced argument declared here");
TREE_NO_WARNING (exp) = true;
return NULL_RTX;
}
return NULL_RTX;
}
if (!len)
@@ -7124,8 +7122,19 @@ inline_expand_builtin_string_cmp (tree exp, rtx target)
return NULL_RTX;
/* For strncmp, if the length is not a const, not qualify. */
if (is_ncmp && !tree_fits_uhwi_p (len3_tree))
return NULL_RTX;
if (is_ncmp)
{
if (!tree_fits_uhwi_p (len3_tree))
return NULL_RTX;
else
len3 = tree_to_uhwi (len3_tree);
}
if (src_str1 != NULL)
len1 = strnlen (src_str1, len1) + 1;
if (src_str2 != NULL)
len2 = strnlen (src_str2, len2) + 1;
int const_str_n = 0;
if (!len1)
@@ -7140,7 +7149,7 @@ inline_expand_builtin_string_cmp (tree exp, rtx target)
gcc_checking_assert (const_str_n > 0);
length = (const_str_n == 1) ? len1 : len2;
if (is_ncmp && (len3 = tree_to_uhwi (len3_tree)) < length)
if (is_ncmp && len3 < length)
length = len3;
/* If the length of the comparision is larger than the threshold,
@@ -11225,3 +11234,90 @@ target_char_cst_p (tree t, char *p)
*p = (char)tree_to_uhwi (t);
return true;
}
/* Return true if the builtin DECL is implemented in a standard library.
Otherwise returns false which doesn't guarantee it is not (thus the list of
handled builtins below may be incomplete). */
bool
builtin_with_linkage_p (tree decl)
{
if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
switch (DECL_FUNCTION_CODE (decl))
{
CASE_FLT_FN (BUILT_IN_ACOS):
CASE_FLT_FN (BUILT_IN_ACOSH):
CASE_FLT_FN (BUILT_IN_ASIN):
CASE_FLT_FN (BUILT_IN_ASINH):
CASE_FLT_FN (BUILT_IN_ATAN):
CASE_FLT_FN (BUILT_IN_ATANH):
CASE_FLT_FN (BUILT_IN_ATAN2):
CASE_FLT_FN (BUILT_IN_CBRT):
CASE_FLT_FN (BUILT_IN_CEIL):
CASE_FLT_FN_FLOATN_NX (BUILT_IN_CEIL):
CASE_FLT_FN (BUILT_IN_COPYSIGN):
CASE_FLT_FN_FLOATN_NX (BUILT_IN_COPYSIGN):
CASE_FLT_FN (BUILT_IN_COS):
CASE_FLT_FN (BUILT_IN_COSH):
CASE_FLT_FN (BUILT_IN_ERF):
CASE_FLT_FN (BUILT_IN_ERFC):
CASE_FLT_FN (BUILT_IN_EXP):
CASE_FLT_FN (BUILT_IN_EXP2):
CASE_FLT_FN (BUILT_IN_EXPM1):
CASE_FLT_FN (BUILT_IN_FABS):
CASE_FLT_FN_FLOATN_NX (BUILT_IN_FABS):
CASE_FLT_FN (BUILT_IN_FDIM):
CASE_FLT_FN (BUILT_IN_FLOOR):
CASE_FLT_FN_FLOATN_NX (BUILT_IN_FLOOR):
CASE_FLT_FN (BUILT_IN_FMA):
CASE_FLT_FN_FLOATN_NX (BUILT_IN_FMA):
CASE_FLT_FN (BUILT_IN_FMAX):
CASE_FLT_FN_FLOATN_NX (BUILT_IN_FMAX):
CASE_FLT_FN (BUILT_IN_FMIN):
CASE_FLT_FN_FLOATN_NX (BUILT_IN_FMIN):
CASE_FLT_FN (BUILT_IN_FMOD):
CASE_FLT_FN (BUILT_IN_FREXP):
CASE_FLT_FN (BUILT_IN_HYPOT):
CASE_FLT_FN (BUILT_IN_ILOGB):
CASE_FLT_FN (BUILT_IN_LDEXP):
CASE_FLT_FN (BUILT_IN_LGAMMA):
CASE_FLT_FN (BUILT_IN_LLRINT):
CASE_FLT_FN (BUILT_IN_LLROUND):
CASE_FLT_FN (BUILT_IN_LOG):
CASE_FLT_FN (BUILT_IN_LOG10):
CASE_FLT_FN (BUILT_IN_LOG1P):
CASE_FLT_FN (BUILT_IN_LOG2):
CASE_FLT_FN (BUILT_IN_LOGB):
CASE_FLT_FN (BUILT_IN_LRINT):
CASE_FLT_FN (BUILT_IN_LROUND):
CASE_FLT_FN (BUILT_IN_MODF):
CASE_FLT_FN (BUILT_IN_NAN):
CASE_FLT_FN (BUILT_IN_NEARBYINT):
CASE_FLT_FN_FLOATN_NX (BUILT_IN_NEARBYINT):
CASE_FLT_FN (BUILT_IN_NEXTAFTER):
CASE_FLT_FN (BUILT_IN_NEXTTOWARD):
CASE_FLT_FN (BUILT_IN_POW):
CASE_FLT_FN (BUILT_IN_REMAINDER):
CASE_FLT_FN (BUILT_IN_REMQUO):
CASE_FLT_FN (BUILT_IN_RINT):
CASE_FLT_FN_FLOATN_NX (BUILT_IN_RINT):
CASE_FLT_FN (BUILT_IN_ROUND):
CASE_FLT_FN_FLOATN_NX (BUILT_IN_ROUND):
CASE_FLT_FN (BUILT_IN_SCALBLN):
CASE_FLT_FN (BUILT_IN_SCALBN):
CASE_FLT_FN (BUILT_IN_SIN):
CASE_FLT_FN (BUILT_IN_SINH):
CASE_FLT_FN (BUILT_IN_SINCOS):
CASE_FLT_FN (BUILT_IN_SQRT):
CASE_FLT_FN_FLOATN_NX (BUILT_IN_SQRT):
CASE_FLT_FN (BUILT_IN_TAN):
CASE_FLT_FN (BUILT_IN_TANH):
CASE_FLT_FN (BUILT_IN_TGAMMA):
CASE_FLT_FN (BUILT_IN_TRUNC):
CASE_FLT_FN_FLOATN_NX (BUILT_IN_TRUNC):
return true;
default:
break;
}
return false;
}
+1
View File
@@ -150,5 +150,6 @@ extern internal_fn replacement_internal_fn (gcall *);
extern void warn_string_no_nul (location_t, const char *, tree, tree);
extern tree unterminated_array (tree, tree * = NULL, bool * = NULL);
extern bool builtin_with_linkage_p (tree);
#endif /* GCC_BUILTINS_H */
+116
View File
@@ -1,3 +1,119 @@
2020-03-12 Release Manager
* GCC 9.3.0 released.
2020-01-29 Jason Merrill <jason@redhat.com>
PR c++/89357
* c-attribs.c (check_cxx_fundamental_alignment_constraints): Remove.
2019-12-20 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2019-11-26 Jakub Jelinek <jakub@redhat.com>
PR c++/61414
* c-attribs.c (handle_mode_attribute): Add mode attribute to
ENUMERAL_TYPEs.
2019-11-22 Jakub Jelinek <jakub@redhat.com>
PR c/90677
* c-common.h (identifier_global_tag): Declare.
* c-format.c (get_pointer_to_named_type): Renamed to ...
(get_named_type): ... this. Use identifier_global_tag instead of
identifier_global_value, handle the return value being a TYPE_P.
(init_dynamic_diag_info): Adjust get_pointer_to_named_type callers
to call get_named_type instead. Formatting fixes.
2019-11-13 Eric Botcazou <ebotcazou@adacore.com>
* c-ada-spec.c (get_underlying_decl): Do not look through typedefs.
(dump_forward_type): Do not generate a declaration for function types.
(dump_nested_type) <ARRAY_TYPE>: Do not generate a nested declaration
of the component type if it is declared in another file.
2019-10-21 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2019-10-01 Jakub Jelinek <jakub@redhat.com>
PR c++/91925
* c-warn.c (check_alignment_of_packed_member): Ignore FIELD_DECLs
with NULL DECL_FIELD_OFFSET.
2019-09-27 Jakub Jelinek <jakub@redhat.com>
PR c++/88203
* c-common.h (c_omp_predefined_variable): Declare.
* c-omp.c (c_omp_predefined_variable): New function.
(c_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED
for predefined variables.
2019-09-02 Martin Liska <mliska@suse.cz>
Backport from mainline
2019-09-02 Martin Liska <mliska@suse.cz>
PR c++/91155
* c-common.c (fname_as_string): Use cxx_printable_name for
__PRETTY_FUNCTION__ same as was used before r265711.
2019-08-31 Iain Sandoe <iain@sandoe.co.uk>
Backport from mainline
2019-08-23 Iain Sandoe <iain@sandoe.co.uk>
PR pch/61250
* c-lex.c (c_lex_with_flags): Don't call
c_common_no_more_pch () from here.
2019-08-12 Release Manager
* GCC 9.2.0 released.
2019-07-15 Martin Liska <mliska@suse.cz>
PR c++/91125
* c-opts.c (c_common_handle_option): Warn the -frepo
will be removed in the future.
2019-07-14 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2019-07-13 Jakub Jelinek <jakub@redhat.com>
PR c/91149
* c-omp.c (c_omp_split_clauses): Fix a pasto in
OMP_CLAUSE_REDUCTION_TASK handling.
2019-06-29 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2019-06-25 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/90954
* c-omp.c (c_finish_omp_atomic): Allow tree_invariant_p in addition
to SAVE_EXPR in first operand of a COMPOUND_EXPR.
2019-06-06 Richard Biener <rguenther@suse.de>
Backport from mainline
2019-05-15 Richard Biener <rguenther@suse.de>
PR c/90474
* c-common.c (c_common_mark_addressable_vec): Also mark
a COMPOUND_LITERAL_EXPR_DECL addressable similar to
c_mark_addressable.
2019-05-23 Eric Botcazou <ebotcazou@adacore.com>
* c-ada-spec.c (compare_node): Compare the DECL_UIDs as a last resort.
2019-05-03 Release Manager
* GCC 9.1.0 released.
2019-04-19 Jakub Jelinek <jakub@redhat.com>
PR c/89888
+13 -3
View File
@@ -679,8 +679,10 @@ compare_node (const void *lp, const void *rp)
{
const_tree lhs = *((const tree *) lp);
const_tree rhs = *((const tree *) rp);
const int ret
= compare_location (decl_sloc (lhs, true), decl_sloc (rhs, true));
return compare_location (decl_sloc (lhs, true), decl_sloc (rhs, true));
return ret ? ret : DECL_UID (lhs) - DECL_UID (rhs);
}
/* Compare two comments (LP and RP) by their source location. */
@@ -1023,7 +1025,9 @@ get_underlying_decl (tree type)
if (TYPE_P (type))
{
type = TYPE_MAIN_VARIANT (type);
/* Strip qualifiers but do not look through typedefs. */
if (TYPE_QUALS_NO_ADDR_SPACE (type))
type = TYPE_MAIN_VARIANT (type);
/* type is a typedef. */
if (TYPE_NAME (type) && DECL_P (TYPE_NAME (type)))
@@ -2449,6 +2453,9 @@ dump_forward_type (pretty_printer *buffer, tree type, tree t, int spc)
if (DECL_SOURCE_FILE (decl) != DECL_SOURCE_FILE (t))
return;
if (TREE_CODE (type) == FUNCTION_TYPE)
return;
/* Generate an incomplete type declaration. */
pp_string (buffer, "type ");
dump_ada_node (buffer, decl, NULL_TREE, spc, false, true);
@@ -2517,7 +2524,10 @@ dump_nested_type (pretty_printer *buffer, tree field, tree t, tree parent,
while (TREE_CODE (tmp) == ARRAY_TYPE)
tmp = TREE_TYPE (tmp);
decl = get_underlying_decl (tmp);
if (decl && !DECL_NAME (decl) && !TREE_VISITED (decl))
if (decl
&& !DECL_NAME (decl)
&& DECL_SOURCE_FILE (decl) == DECL_SOURCE_FILE (t)
&& !TREE_VISITED (decl))
{
/* Generate full declaration. */
dump_nested_type (buffer, decl, t, parent, spc);
+2 -61
View File
@@ -1843,6 +1843,7 @@ handle_mode_attribute (tree *node, tree name, tree args,
typefm = make_signed_type (TYPE_PRECISION (typefm));
TREE_TYPE (typefm) = type;
}
*no_add_attrs = false;
}
else if (VECTOR_MODE_P (mode)
? TREE_CODE (type) != TREE_CODE (TREE_TYPE (typefm))
@@ -1921,65 +1922,6 @@ fail:
return NULL_TREE;
}
/* If in c++-11, check if the c++-11 alignment constraint with respect
to fundamental alignment (in [dcl.align]) are satisfied. If not in
c++-11 mode, does nothing.
[dcl.align]2/ says:
[* if the constant expression evaluates to a fundamental alignment,
the alignment requirement of the declared entity shall be the
specified fundamental alignment.
* if the constant expression evaluates to an extended alignment
and the implementation supports that alignment in the context
of the declaration, the alignment of the declared entity shall
be that alignment
* if the constant expression evaluates to an extended alignment
and the implementation does not support that alignment in the
context of the declaration, the program is ill-formed]. */
static bool
check_cxx_fundamental_alignment_constraints (tree node,
unsigned align_log,
int flags)
{
bool alignment_too_large_p = false;
unsigned requested_alignment = (1U << align_log) * BITS_PER_UNIT;
unsigned max_align = 0;
if ((!(flags & ATTR_FLAG_CXX11) && !warn_cxx_compat)
|| (node == NULL_TREE || node == error_mark_node))
return true;
if (cxx_fundamental_alignment_p (requested_alignment))
return true;
if (VAR_P (node))
{
if (TREE_STATIC (node) || DECL_EXTERNAL (node))
/* For file scope variables and static members, the target supports
alignments that are at most MAX_OFILE_ALIGNMENT. */
max_align = MAX_OFILE_ALIGNMENT;
else
/* For stack variables, the target supports at most
MAX_STACK_ALIGNMENT. */
max_align = MAX_STACK_ALIGNMENT;
if (requested_alignment > max_align)
alignment_too_large_p = true;
}
/* Let's be liberal for types and fields; don't limit their alignment any
more than check_user_alignment already did. */
if (alignment_too_large_p)
pedwarn (input_location, OPT_Wattributes,
"requested alignment %d is larger than %d",
requested_alignment / BITS_PER_UNIT, max_align / BITS_PER_UNIT);
return !alignment_too_large_p;
}
/* Common codes shared by handle_warn_if_not_aligned_attribute and
handle_aligned_attribute. */
@@ -2023,8 +1965,7 @@ common_handle_aligned_attribute (tree *node, tree name, tree args, int flags,
/* Log2 of specified alignment. */
int pow2align = check_user_alignment (align_expr, objfile,
/* warn_zero = */ true);
if (pow2align == -1
|| !check_cxx_fundamental_alignment_constraints (*node, pow2align, flags))
if (pow2align == -1)
{
*no_add_attrs = true;
return NULL_TREE;
+2
View File
@@ -6554,6 +6554,8 @@ c_common_mark_addressable_vec (tree t)
return;
if (!VAR_P (t) || !DECL_HARD_REGISTER (t))
TREE_ADDRESSABLE (t) = 1;
if (TREE_CODE (t) == COMPOUND_LITERAL_EXPR)
TREE_ADDRESSABLE (COMPOUND_LITERAL_EXPR_DECL (t)) = 1;
}
+2
View File
@@ -800,6 +800,7 @@ extern void c_register_addr_space (const char *str, addr_space_t as);
extern bool in_late_binary_op;
extern const char *c_addr_space_name (addr_space_t as);
extern tree identifier_global_value (tree);
extern tree identifier_global_tag (tree);
extern tree c_linkage_bindings (tree);
extern void record_builtin_type (enum rid, const char *, tree);
extern tree build_void_list_node (void);
@@ -1184,6 +1185,7 @@ extern void c_omp_split_clauses (location_t, enum tree_code, omp_clause_mask,
tree, tree *);
extern tree c_omp_declare_simd_clauses_to_numbers (tree, tree);
extern void c_omp_declare_simd_clauses_to_decls (tree, tree);
extern bool c_omp_predefined_variable (tree);
extern enum omp_clause_default_kind c_omp_predetermined_sharing (tree);
/* Return next tree in the chain for chain_next walking of tree nodes. */
+21 -19
View File
@@ -3909,31 +3909,32 @@ init_dynamic_gfc_info (void)
}
}
/* Lookup the type named NAME and return a pointer-to-NAME type if found.
Otherwise, return void_type_node if NAME has not been used yet, or NULL_TREE if
NAME is not a type (issuing an error). */
/* Lookup the type named NAME and return a NAME type if found.
Otherwise, return void_type_node if NAME has not been used yet,
or NULL_TREE if NAME is not a type (issuing an error). */
static tree
get_pointer_to_named_type (const char *name)
get_named_type (const char *name)
{
tree result;
if ((result = maybe_get_identifier (name)))
if (tree result = maybe_get_identifier (name))
{
result = identifier_global_value (result);
result = identifier_global_tag (result);
if (result)
{
if (TREE_CODE (result) != TYPE_DECL)
if (TYPE_P (result))
;
else if (TREE_CODE (result) == TYPE_DECL)
result = TREE_TYPE (result);
else
{
error ("%qs is not defined as a type", name);
result = NULL_TREE;
}
else
result = TREE_TYPE (result);
}
return result;
}
else
result = void_type_node;
return result;
return void_type_node;
}
/* Determine the types of "tree" and "location_t" in the code being
@@ -3963,23 +3964,24 @@ init_dynamic_diag_info (void)
an extra type level. */
if ((local_tree_type_node = maybe_get_identifier ("tree")))
{
local_tree_type_node = identifier_global_value (local_tree_type_node);
local_tree_type_node
= identifier_global_value (local_tree_type_node);
if (local_tree_type_node)
{
if (TREE_CODE (local_tree_type_node) != TYPE_DECL)
{
error ("%<tree%> is not defined as a type");
local_tree_type_node = 0;
local_tree_type_node = NULL_TREE;
}
else if (TREE_CODE (TREE_TYPE (local_tree_type_node))
!= POINTER_TYPE)
{
error ("%<tree%> is not defined as a pointer type");
local_tree_type_node = 0;
local_tree_type_node = NULL_TREE;
}
else
local_tree_type_node =
TREE_TYPE (TREE_TYPE (local_tree_type_node));
local_tree_type_node
= TREE_TYPE (TREE_TYPE (local_tree_type_node));
}
}
else
@@ -3989,12 +3991,12 @@ init_dynamic_diag_info (void)
/* Similar to the above but for gimple*. */
if (!local_gimple_ptr_node
|| local_gimple_ptr_node == void_type_node)
local_gimple_ptr_node = get_pointer_to_named_type ("gimple");
local_gimple_ptr_node = get_named_type ("gimple");
/* Similar to the above but for cgraph_node*. */
if (!local_cgraph_node_ptr_node
|| local_cgraph_node_ptr_node == void_type_node)
local_cgraph_node_ptr_node = get_pointer_to_named_type ("cgraph_node");
local_cgraph_node_ptr_node = get_named_type ("cgraph_node");
static tree hwi;
-7
View File
@@ -394,7 +394,6 @@ enum cpp_ttype
c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags,
int lex_flags)
{
static bool no_more_pch;
const cpp_token *tok;
enum cpp_ttype type;
unsigned char add_flags = 0;
@@ -628,12 +627,6 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags,
if (cpp_flags)
*cpp_flags = tok->flags | add_flags;
if (!no_more_pch)
{
no_more_pch = true;
c_common_no_more_pch ();
}
timevar_pop (TV_CPP);
return type;
+24 -2
View File
@@ -305,7 +305,7 @@ c_finish_omp_atomic (location_t loc, enum tree_code code,
if (TREE_CODE (x) == COMPOUND_EXPR)
{
pre = TREE_OPERAND (x, 0);
gcc_assert (TREE_CODE (pre) == SAVE_EXPR);
gcc_assert (TREE_CODE (pre) == SAVE_EXPR || tree_invariant_p (pre));
x = TREE_OPERAND (x, 1);
}
gcc_assert (TREE_CODE (x) == MODIFY_EXPR);
@@ -1648,7 +1648,7 @@ c_omp_split_clauses (location_t loc, enum tree_code code,
}
else if (code != OMP_SECTIONS
&& (mask & (OMP_CLAUSE_MASK_1
<< PRAGMA_OMP_CLAUSE_SCHEDULE)) == 0
<< PRAGMA_OMP_CLAUSE_NUM_THREADS)) == 0
&& (mask & (OMP_CLAUSE_MASK_1
<< PRAGMA_OMP_CLAUSE_SCHEDULE)) == 0)
{
@@ -2023,6 +2023,25 @@ c_omp_declare_simd_clauses_to_decls (tree fndecl, tree clauses)
}
}
/* Return true for __func__ and similar function-local predefined
variables (which are in OpenMP predetermined shared, allowed in
shared/firstprivate clauses). */
bool
c_omp_predefined_variable (tree decl)
{
if (VAR_P (decl)
&& DECL_ARTIFICIAL (decl)
&& TREE_READONLY (decl)
&& TREE_STATIC (decl)
&& DECL_NAME (decl)
&& (DECL_NAME (decl) == ridpointers[RID_C99_FUNCTION_NAME]
|| DECL_NAME (decl) == ridpointers[RID_FUNCTION_NAME]
|| DECL_NAME (decl) == ridpointers[RID_PRETTY_FUNCTION_NAME]))
return true;
return false;
}
/* True if OpenMP sharing attribute of DECL is predetermined. */
enum omp_clause_default_kind
@@ -2036,5 +2055,8 @@ c_omp_predetermined_sharing (tree decl)
&& INTEGRAL_TYPE_P (TREE_TYPE (decl)))
return OMP_CLAUSE_DEFAULT_SHARED;
if (c_omp_predefined_variable (decl))
return OMP_CLAUSE_DEFAULT_SHARED;
return OMP_CLAUSE_DEFAULT_UNSPECIFIED;
}
+5 -1
View File
@@ -500,7 +500,11 @@ c_common_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
case OPT_frepo:
flag_use_repository = value;
if (value)
flag_implicit_templates = 0;
{
flag_implicit_templates = 0;
warning (OPT_Wdeprecated, "%<-frepo%> is deprecated and will "
"be removed in a future release");
}
break;
case OPT_ftabstop_:
+2
View File
@@ -2784,6 +2784,8 @@ check_alignment_of_packed_member (tree type, tree field, bool rvalue)
/* Check alignment of the data member. */
if (TREE_CODE (field) == FIELD_DECL
&& (DECL_PACKED (field) || TYPE_PACKED (TREE_TYPE (field)))
/* Ignore FIELDs not laid out yet. */
&& DECL_FIELD_OFFSET (field)
&& (!rvalue || TREE_CODE (TREE_TYPE (field)) == ARRAY_TYPE))
{
/* Check the expected alignment against the field alignment. */
+183
View File
@@ -1,3 +1,186 @@
2020-04-07 Jakub Jelinek <jakub@redhat.com>
PR c++/94512
* c-parser.c (c_parser_omp_parallel): Set OMP_PARALLEL_COMBINED
if c_parser_omp_master succeeded.
Backported from mainline
2020-03-23 Jakub Jelinek <jakub@redhat.com>
PR gcov-profile/94029
PR c/94239
* c-parser.c (c_parser_declaration_or_fndef): Initialize endloc to
the function_start_locus location. Don't do that afterwards for the
__GIMPLE body parsing.
2020-03-19 Jakub Jelinek <jakub@redhat.com>
PR gcov-profile/94029
* c-tree.h (finish_function): Add location_t argument defaulted to
input_location.
* c-parser.c (c_parser_compound_statement): Add endlocp argument and
set it to the locus of closing } if non-NULL.
(c_parser_compound_statement_nostart): Return locus of closing }.
(c_parser_parse_rtl_body): Likewise.
(c_parser_declaration_or_fndef): Propagate locus of closing } to
finish_function.
* c-decl.c (finish_function): Add end_loc argument, use it instead of
input_location to set function_end_locus.
2020-03-17 Jakub Jelinek <jakub@redhat.com>
PR c/94172
* c-tree.h (C_TYPE_INCOMPLETE_VARS): Define to TYPE_LANG_SLOT_1
instead of TYPE_VFIELD, and support it on {RECORD,UNION,ENUMERAL}_TYPE.
(TYPE_ACTUAL_ARG_TYPES): Check that it is only used on FUNCTION_TYPEs.
* c-decl.c (pushdecl): Push C_TYPE_INCOMPLETE_VARS also to
ENUMERAL_TYPEs.
(finish_incomplete_vars): New function, moved from finish_struct. Use
relayout_decl instead of layout_decl.
(finish_struct): Remove obsolete comment about C_TYPE_INCOMPLETE_VARS
being TYPE_VFIELD. Use finish_incomplete_vars.
(finish_enum): Clear C_TYPE_INCOMPLETE_VARS. Call
finish_incomplete_vars.
* c-typeck.c (c_build_qualified_type): Clear C_TYPE_INCOMPLETE_VARS
also on ENUMERAL_TYPEs.
2020-03-12 Release Manager
* GCC 9.3.0 released.
2020-02-13 Jakub Jelinek <jakub@redhat.com>
PR c/93576
* c-decl.c (grokdeclarator): If this_size_varies, only push size into
*expr if it has side effects.
2020-01-22 Joseph Myers <joseph@codesourcery.com>
Backport from mainline:
2020-01-22 Joseph Myers <joseph@codesourcery.com>
PR c/93348
* c-typeck.c (build_c_cast): Call remove_c_maybe_const_expr on
argument with integer operands.
2020-01-15 Joseph Myers <joseph@codesourcery.com>
Backport from mainline:
2020-01-15 Joseph Myers <joseph@codesourcery.com>
PR c/93072
* c-decl.c (pushdecl): Use TREE_PUBLIC, not DECL_EXTERNAL, to
determine whether to set DECL_CONTEXT.
2020-01-13 Joseph Myers <joseph@codesourcery.com>
Backport from mainline:
2020-01-13 Joseph Myers <joseph@codesourcery.com>
PR c/93241
* c-typeck.c (build_c_cast): Check for expressions with integer
operands that can occur in an unevaluated part of an integer
constant expression and call note_integer_operands as needed.
2019-12-20 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2019-11-22 Jakub Jelinek <jakub@redhat.com>
PR c/90677
* c-decl.c (identifier_global_tag): Define.
2019-12-02 Sandra Loosemore <sandra@codesourcery.com>
Fix bugs relating to flexibly-sized objects in nios2 backend.
PR target/92499
* c-decl.c (flexible_array_type_p): Move to common code.
2019-10-21 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2019-09-27 Jakub Jelinek <jakub@redhat.com>
PR c++/88203
* c-parser.c (c_parser_predefined_identifier): New function.
(c_parser_postfix_expression): Use it.
(c_parser_omp_variable_list): Parse predefined identifiers.
* c-typeck.c (c_finish_omp_clauses): Allow predefined variables
in shared and firstprivate clauses, even when they are predetermined
shared.
2019-08-09 Jakub Jelinek <jakub@redhat.com>
PR c/91401
* c-parser.c (c_parser_omp_clause_dist_schedule): Fix up typos in the
check_no_duplicate_clause call. Comment it out, instead emit a
warning for duplicate dist_schedule clauses.
2019-08-31 Iain Sandoe <iain@sandoe.co.uk>
Backport from mainline.
2019-08-23 Iain Sandoe <iain@sandoe.co.uk>
PR pch/61250
* c-parser.c (c_parse_file): Call c_common_no_more_pch ()
after determining that the first token is not
PRAGMA_GCC_PCH_PREPROCESS.
2019-08-12 Release Manager
* GCC 9.2.0 released.
2019-08-02 Martin Sebor <msebor@redhat.com>
Backport from mainline
2019-06-05 Martin Sebor <msebor@redhat.com>
PR c/90737
* c-typeck.c (c_finish_return): Only consider functions returning
pointers as candidates for -Wreturn-local-addr.
2019-08-01 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2019-07-31 Jakub Jelinek <jakub@redhat.com>
PR c/91192
* c-parser.c (c_parser_sizeof_expression): Call set_c_expr_source_range
even if finish is UNKNOWN_LOCATION, just use start as finish in that
case.
2019-07-20 Richard Sandiford <richard.sandiford@arm.com>
Backport from mainline
2019-07-18 Richard Sandiford <richard.sandiford@arm.com>
PR c/53633
* c-decl.c (finish_function): Check targetm.warn_func_return
before issuing a -Wreturn-type warning.
2019-05-17 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2019-04-26 Jakub Jelinek <jakub@redhat.com>
PR debug/90197
* c-tree.h (c_finish_loop): Add 2 further location_t arguments.
* c-parser.c (c_parser_while_statement): Adjust c_finish_loop caller.
(c_parser_do_statement): Likewise.
(c_parser_for_statement): Likewise. Formatting fixes.
* c-typeck.c (c_finish_loop): Add COND_LOCUS and INCR_LOCUS arguments,
emit DEBUG_BEGIN_STMTs if needed.
2019-05-04 Michael Meissner <meissner@linux.ibm.com>
* ChangeLog.ibm: Delete unintentional commit on the wrong branch.
2019-05-03 Release Manager
* GCC 9.1.0 released.
2019-04-19 Jakub Jelinek <jakub@redhat.com>
PR c/89888
+53 -64
View File
@@ -3044,7 +3044,7 @@ pushdecl (tree x)
unless they have initializers (which generate code). */
if (current_function_decl
&& (!VAR_OR_FUNCTION_DECL_P (x)
|| DECL_INITIAL (x) || !DECL_EXTERNAL (x)))
|| DECL_INITIAL (x) || !TREE_PUBLIC (x)))
DECL_CONTEXT (x) = current_function_decl;
/* Anonymous decls are just inserted in the scope. */
@@ -3272,7 +3272,8 @@ pushdecl (tree x)
element = TREE_TYPE (element);
element = TYPE_MAIN_VARIANT (element);
if (RECORD_OR_UNION_TYPE_P (element)
if ((RECORD_OR_UNION_TYPE_P (element)
|| TREE_CODE (element) == ENUMERAL_TYPE)
&& (TREE_CODE (x) != TYPE_DECL
|| TREE_CODE (TREE_TYPE (x)) == ARRAY_TYPE)
&& !COMPLETE_TYPE_P (element))
@@ -5586,39 +5587,6 @@ check_compound_literal_type (location_t loc, struct c_type_name *type_name)
"defining a type in a compound literal is invalid in C++");
}
/* Determine whether TYPE is a structure with a flexible array member,
or a union containing such a structure (possibly recursively). */
static bool
flexible_array_type_p (tree type)
{
tree x;
switch (TREE_CODE (type))
{
case RECORD_TYPE:
x = TYPE_FIELDS (type);
if (x == NULL_TREE)
return false;
while (DECL_CHAIN (x) != NULL_TREE)
x = DECL_CHAIN (x);
if (TREE_CODE (TREE_TYPE (x)) == ARRAY_TYPE
&& TYPE_SIZE (TREE_TYPE (x)) == NULL_TREE
&& TYPE_DOMAIN (TREE_TYPE (x)) != NULL_TREE
&& TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (x))) == NULL_TREE)
return true;
return false;
case UNION_TYPE:
for (x = TYPE_FIELDS (type); x != NULL_TREE; x = DECL_CHAIN (x))
{
if (flexible_array_type_p (TREE_TYPE (x)))
return true;
}
return false;
default:
return false;
}
}
/* Performs sanity checks on the TYPE and WIDTH of the bit-field NAME,
replacing with appropriate values if they are invalid. */
@@ -6401,11 +6369,14 @@ grokdeclarator (const struct c_declarator *declarator,
}
if (this_size_varies)
{
if (*expr)
*expr = build2 (COMPOUND_EXPR, TREE_TYPE (size),
*expr, size);
else
*expr = size;
if (TREE_SIDE_EFFECTS (size))
{
if (*expr)
*expr = build2 (COMPOUND_EXPR, TREE_TYPE (size),
*expr, size);
else
*expr = size;
}
*expr_const_operands &= size_maybe_const;
}
}
@@ -8171,6 +8142,26 @@ field_decl_cmp (const void *x_p, const void *y_p)
return 1;
}
/* If this structure or union completes the type of any previous
variable declaration, lay it out and output its rtl. */
static void
finish_incomplete_vars (tree incomplete_vars, bool toplevel)
{
for (tree x = incomplete_vars; x; x = TREE_CHAIN (x))
{
tree decl = TREE_VALUE (x);
if (TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
layout_array_type (TREE_TYPE (decl));
if (TREE_CODE (decl) != TYPE_DECL)
{
relayout_decl (decl);
if (c_dialect_objc ())
objc_check_decl (decl);
rest_of_decl_compilation (decl, toplevel, 0);
}
}
}
/* Fill in the fields of a RECORD_TYPE or UNION_TYPE node, T.
LOC is the location of the RECORD_TYPE or UNION_TYPE's definition.
FIELDLIST is a chain of FIELD_DECL nodes for the fields.
@@ -8429,13 +8420,6 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
warning_at (loc, 0, "union cannot be made transparent");
}
/* Note: C_TYPE_INCOMPLETE_VARS overloads TYPE_VFIELD which is used
in dwarf2out via rest_of_decl_compilation below and means
something totally different. Since we will be clearing
C_TYPE_INCOMPLETE_VARS shortly after we iterate through them,
clear it ahead of time and avoid problems in dwarf2out. Ideally,
C_TYPE_INCOMPLETE_VARS should use some language specific
node. */
tree incomplete_vars = C_TYPE_INCOMPLETE_VARS (TYPE_MAIN_VARIANT (t));
for (x = TYPE_MAIN_VARIANT (t); x; x = TYPE_NEXT_VARIANT (x))
{
@@ -8456,21 +8440,7 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
/* Finish debugging output for this type. */
rest_of_type_compilation (t, toplevel);
/* If this structure or union completes the type of any previous
variable declaration, lay it out and output its rtl. */
for (x = incomplete_vars; x; x = TREE_CHAIN (x))
{
tree decl = TREE_VALUE (x);
if (TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
layout_array_type (TREE_TYPE (decl));
if (TREE_CODE (decl) != TYPE_DECL)
{
layout_decl (decl, 0);
if (c_dialect_objc ())
objc_check_decl (decl);
rest_of_decl_compilation (decl, toplevel, 0);
}
}
finish_incomplete_vars (incomplete_vars, toplevel);
/* If we're inside a function proper, i.e. not file-scope and not still
parsing parameters, then arrange for the size of a variable sized type
@@ -8749,8 +8719,10 @@ finish_enum (tree enumtype, tree values, tree attributes)
TYPE_LANG_SPECIFIC (enumtype) = lt;
/* Fix up all variant types of this enum type. */
tree incomplete_vars = C_TYPE_INCOMPLETE_VARS (TYPE_MAIN_VARIANT (enumtype));
for (tem = TYPE_MAIN_VARIANT (enumtype); tem; tem = TYPE_NEXT_VARIANT (tem))
{
C_TYPE_INCOMPLETE_VARS (tem) = NULL_TREE;
if (tem == enumtype)
continue;
TYPE_VALUES (tem) = TYPE_VALUES (enumtype);
@@ -8769,6 +8741,8 @@ finish_enum (tree enumtype, tree values, tree attributes)
/* Finish debugging output for this type. */
rest_of_type_compilation (enumtype, toplevel);
finish_incomplete_vars (incomplete_vars, toplevel);
/* If this enum is defined inside a struct, add it to
struct_types. */
if (warn_cxx_compat
@@ -9623,7 +9597,7 @@ temp_pop_parm_decls (void)
This is called after parsing the body of the function definition. */
void
finish_function (void)
finish_function (location_t end_loc)
{
tree fndecl = current_function_decl;
@@ -9685,6 +9659,7 @@ finish_function (void)
/* Normally, with -Wreturn-type, flow will complain, but we might
optimize out static functions. */
&& !TREE_PUBLIC (fndecl)
&& targetm.warn_func_return (fndecl)
&& warning (OPT_Wreturn_type,
"no return statement in function returning non-void"))
TREE_NO_WARNING (fndecl) = 1;
@@ -9718,7 +9693,7 @@ finish_function (void)
/* Store the end of the function, so that we get good line number
info for the epilogue. */
cfun->function_end_locus = input_location;
cfun->function_end_locus = end_loc;
/* Finalize the ELF visibility for the function. */
c_determine_visibility (fndecl);
@@ -9973,6 +9948,20 @@ identifier_global_value (tree t)
return NULL_TREE;
}
/* Return the global value of tag T as a symbol. */
tree
identifier_global_tag (tree t)
{
struct c_binding *b;
for (b = I_TAG_BINDING (t); b; b = b->shadowed)
if (B_IN_FILE_SCOPE (b) || B_IN_EXTERNAL_SCOPE (b))
return b->decl;
return NULL_TREE;
}
/* In C, the only C-linkage public declaration is at file scope. */
tree
+141 -82
View File
@@ -1402,8 +1402,8 @@ static struct c_expr c_parser_braced_init (c_parser *, tree, bool,
static void c_parser_initelt (c_parser *, struct obstack *);
static void c_parser_initval (c_parser *, struct c_expr *,
struct obstack *);
static tree c_parser_compound_statement (c_parser *);
static void c_parser_compound_statement_nostart (c_parser *);
static tree c_parser_compound_statement (c_parser *, location_t * = NULL);
static location_t c_parser_compound_statement_nostart (c_parser *);
static void c_parser_label (c_parser *);
static void c_parser_statement (c_parser *, bool *, location_t * = NULL);
static void c_parser_statement_after_labels (c_parser *, bool *,
@@ -1498,8 +1498,7 @@ static void c_parser_objc_at_synthesize_declaration (c_parser *);
static void c_parser_objc_at_dynamic_declaration (c_parser *);
static bool c_parser_objc_diagnose_bad_element_prefix
(c_parser *, struct c_declspecs *);
static void c_parser_parse_rtl_body (c_parser *parser, char *start_with_pass);
static location_t c_parser_parse_rtl_body (c_parser *, char *);
/* Parse a translation unit (C90 6.7, C99 6.9, C11 6.9).
@@ -2321,14 +2320,16 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok,
omp_declare_simd_clauses);
if (oacc_routine_data)
c_finish_oacc_routine (oacc_routine_data, current_function_decl, true);
location_t startloc = c_parser_peek_token (parser)->location;
DECL_STRUCT_FUNCTION (current_function_decl)->function_start_locus
= c_parser_peek_token (parser)->location;
= startloc;
location_t endloc = startloc;
/* If the definition was marked with __RTL, use the RTL parser now,
consuming the function body. */
if (specs->declspec_il == cdil_rtl)
{
c_parser_parse_rtl_body (parser, specs->gimple_or_rtl_pass);
endloc = c_parser_parse_rtl_body (parser, specs->gimple_or_rtl_pass);
/* Normally, store_parm_decls sets next_is_function_body,
anticipating a function body. We need a push_scope/pop_scope
@@ -2337,7 +2338,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok,
push_scope ();
pop_scope ();
finish_function ();
finish_function (endloc);
return;
}
/* If the definition was marked with __GIMPLE then parse the
@@ -2351,7 +2352,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok,
in_late_binary_op = saved;
}
else
fnbody = c_parser_compound_statement (parser);
fnbody = c_parser_compound_statement (parser, &endloc);
tree fndecl = current_function_decl;
if (nested)
{
@@ -2362,7 +2363,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok,
by initializer_constant_valid_p. See gcc.dg/nested-fn-2.c. */
DECL_STATIC_CHAIN (decl) = 1;
add_stmt (fnbody);
finish_function ();
finish_function (endloc);
c_pop_function_context ();
add_stmt (build_stmt (DECL_SOURCE_LOCATION (decl), DECL_EXPR, decl));
}
@@ -2370,7 +2371,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok,
{
if (fnbody)
add_stmt (fnbody);
finish_function ();
finish_function (endloc);
}
/* Get rid of the empty stmt list for GIMPLE/RTL. */
if (specs->declspec_il != cdil_none)
@@ -4965,7 +4966,7 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
cancellation-point-directive */
static tree
c_parser_compound_statement (c_parser *parser)
c_parser_compound_statement (c_parser *parser, location_t *endlocp)
{
tree stmt;
location_t brace_loc;
@@ -4979,7 +4980,9 @@ c_parser_compound_statement (c_parser *parser)
return error_mark_node;
}
stmt = c_begin_compound_stmt (true);
c_parser_compound_statement_nostart (parser);
location_t end_loc = c_parser_compound_statement_nostart (parser);
if (endlocp)
*endlocp = end_loc;
return c_end_compound_stmt (brace_loc, stmt, true);
}
@@ -4988,7 +4991,7 @@ c_parser_compound_statement (c_parser *parser)
used for parsing both compound statements and statement expressions
(which follow different paths to handling the opening). */
static void
static location_t
c_parser_compound_statement_nostart (c_parser *parser)
{
bool last_stmt = false;
@@ -4997,9 +5000,10 @@ c_parser_compound_statement_nostart (c_parser *parser)
location_t label_loc = UNKNOWN_LOCATION; /* Quiet warning. */
if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE))
{
add_debug_begin_stmt (c_parser_peek_token (parser)->location);
location_t endloc = c_parser_peek_token (parser)->location;
add_debug_begin_stmt (endloc);
c_parser_consume_token (parser);
return;
return endloc;
}
mark_valid_location_for_stdc_pragma (true);
if (c_parser_next_token_is_keyword (parser, RID_LABEL))
@@ -5040,8 +5044,9 @@ c_parser_compound_statement_nostart (c_parser *parser)
{
mark_valid_location_for_stdc_pragma (save_valid_for_pragma);
c_parser_error (parser, "expected declaration or statement");
location_t endloc = c_parser_peek_token (parser)->location;
c_parser_consume_token (parser);
return;
return endloc;
}
while (c_parser_next_token_is_not (parser, CPP_CLOSE_BRACE))
{
@@ -5122,7 +5127,7 @@ c_parser_compound_statement_nostart (c_parser *parser)
{
mark_valid_location_for_stdc_pragma (save_valid_for_pragma);
c_parser_error (parser, "expected declaration or statement");
return;
return c_parser_peek_token (parser)->location;
}
else if (c_parser_next_token_is_keyword (parser, RID_ELSE))
{
@@ -5130,7 +5135,7 @@ c_parser_compound_statement_nostart (c_parser *parser)
{
mark_valid_location_for_stdc_pragma (save_valid_for_pragma);
error_at (loc, "expected %<}%> before %<else%>");
return;
return c_parser_peek_token (parser)->location;
}
else
{
@@ -5152,9 +5157,11 @@ c_parser_compound_statement_nostart (c_parser *parser)
}
if (last_label)
error_at (label_loc, "label at end of compound statement");
location_t endloc = c_parser_peek_token (parser)->location;
c_parser_consume_token (parser);
/* Restore the value we started with. */
mark_valid_location_for_stdc_pragma (save_valid_for_pragma);
return endloc;
}
/* Parse all consecutive labels. */
@@ -6001,7 +6008,8 @@ c_parser_while_statement (c_parser *parser, bool ivdep, unsigned short unroll,
location_t loc_after_labels;
bool open_brace = c_parser_next_token_is (parser, CPP_OPEN_BRACE);
body = c_parser_c99_block_statement (parser, if_p, &loc_after_labels);
c_finish_loop (loc, cond, NULL, body, c_break_label, c_cont_label, true);
c_finish_loop (loc, loc, cond, UNKNOWN_LOCATION, NULL, body,
c_break_label, c_cont_label, true);
add_stmt (c_end_compound_stmt (loc, block, flag_isoc99));
c_parser_maybe_reclassify_token (parser);
@@ -6046,6 +6054,7 @@ c_parser_do_statement (c_parser *parser, bool ivdep, unsigned short unroll)
c_break_label = save_break;
new_cont = c_cont_label;
c_cont_label = save_cont;
location_t cond_loc = c_parser_peek_token (parser)->location;
cond = c_parser_paren_condition (parser);
if (ivdep && cond != error_mark_node)
cond = build3 (ANNOTATE_EXPR, TREE_TYPE (cond), cond,
@@ -6059,7 +6068,8 @@ c_parser_do_statement (c_parser *parser, bool ivdep, unsigned short unroll)
build_int_cst (integer_type_node, unroll));
if (!c_parser_require (parser, CPP_SEMICOLON, "expected %<;%>"))
c_parser_skip_to_end_of_block_or_statement (parser);
c_finish_loop (loc, cond, NULL, body, new_break, new_cont, false);
c_finish_loop (loc, cond_loc, cond, UNKNOWN_LOCATION, NULL, body,
new_break, new_cont, false);
add_stmt (c_end_compound_stmt (loc, block, flag_isoc99));
}
@@ -6132,7 +6142,9 @@ c_parser_for_statement (c_parser *parser, bool ivdep, unsigned short unroll,
/* Silence the bogus uninitialized warning. */
tree collection_expression = NULL;
location_t loc = c_parser_peek_token (parser)->location;
location_t for_loc = c_parser_peek_token (parser)->location;
location_t for_loc = loc;
location_t cond_loc = UNKNOWN_LOCATION;
location_t incr_loc = UNKNOWN_LOCATION;
bool is_foreach_statement = false;
gcc_assert (c_parser_next_token_is_keyword (parser, RID_FOR));
token_indent_info for_tinfo
@@ -6166,7 +6178,8 @@ c_parser_for_statement (c_parser *parser, bool ivdep, unsigned short unroll,
c_parser_consume_token (parser);
is_foreach_statement = true;
if (check_for_loop_decls (for_loc, true) == NULL_TREE)
c_parser_error (parser, "multiple iterating variables in fast enumeration");
c_parser_error (parser, "multiple iterating variables in "
"fast enumeration");
}
else
check_for_loop_decls (for_loc, flag_isoc99);
@@ -6196,7 +6209,8 @@ c_parser_for_statement (c_parser *parser, bool ivdep, unsigned short unroll,
c_parser_consume_token (parser);
is_foreach_statement = true;
if (check_for_loop_decls (for_loc, true) == NULL_TREE)
c_parser_error (parser, "multiple iterating variables in fast enumeration");
c_parser_error (parser, "multiple iterating variables in "
"fast enumeration");
}
else
check_for_loop_decls (for_loc, flag_isoc99);
@@ -6218,15 +6232,18 @@ c_parser_for_statement (c_parser *parser, bool ivdep, unsigned short unroll,
c_parser_consume_token (parser);
is_foreach_statement = true;
if (! lvalue_p (init_expression))
c_parser_error (parser, "invalid iterating variable in fast enumeration");
object_expression = c_fully_fold (init_expression, false, NULL);
c_parser_error (parser, "invalid iterating variable in "
"fast enumeration");
object_expression
= c_fully_fold (init_expression, false, NULL);
}
else
{
ce = convert_lvalue_to_rvalue (loc, ce, true, false);
init_expression = ce.value;
c_finish_expr_stmt (loc, init_expression);
c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>");
c_parser_skip_until_found (parser, CPP_SEMICOLON,
"expected %<;%>");
}
}
}
@@ -6235,18 +6252,19 @@ c_parser_for_statement (c_parser *parser, bool ivdep, unsigned short unroll,
gcc_assert (!parser->objc_could_be_foreach_context);
if (!is_foreach_statement)
{
cond_loc = c_parser_peek_token (parser)->location;
if (c_parser_next_token_is (parser, CPP_SEMICOLON))
{
if (ivdep)
{
c_parser_error (parser, "missing loop condition in loop with "
"%<GCC ivdep%> pragma");
c_parser_error (parser, "missing loop condition in loop "
"with %<GCC ivdep%> pragma");
cond = error_mark_node;
}
else if (unroll)
{
c_parser_error (parser, "missing loop condition in loop with "
"%<GCC unroll%> pragma");
c_parser_error (parser, "missing loop condition in loop "
"with %<GCC unroll%> pragma");
cond = error_mark_node;
}
else
@@ -6275,11 +6293,13 @@ c_parser_for_statement (c_parser *parser, bool ivdep, unsigned short unroll,
/* Parse the increment expression (the third expression in a
for-statement). In the case of a foreach-statement, this is
the expression that follows the 'in'. */
loc = incr_loc = c_parser_peek_token (parser)->location;
if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN))
{
if (is_foreach_statement)
{
c_parser_error (parser, "missing collection in fast enumeration");
c_parser_error (parser,
"missing collection in fast enumeration");
collection_expression = error_mark_node;
}
else
@@ -6288,8 +6308,8 @@ c_parser_for_statement (c_parser *parser, bool ivdep, unsigned short unroll,
else
{
if (is_foreach_statement)
collection_expression = c_fully_fold (c_parser_expression (parser).value,
false, NULL);
collection_expression
= c_fully_fold (c_parser_expression (parser).value, false, NULL);
else
{
struct c_expr ce = c_parser_expression (parser);
@@ -6312,10 +6332,14 @@ c_parser_for_statement (c_parser *parser, bool ivdep, unsigned short unroll,
body = c_parser_c99_block_statement (parser, if_p, &loc_after_labels);
if (is_foreach_statement)
objc_finish_foreach_loop (loc, object_expression, collection_expression, body, c_break_label, c_cont_label);
objc_finish_foreach_loop (for_loc, object_expression,
collection_expression, body, c_break_label,
c_cont_label);
else
c_finish_loop (loc, cond, incr, body, c_break_label, c_cont_label, true);
add_stmt (c_end_compound_stmt (loc, block, flag_isoc99 || c_dialect_objc ()));
c_finish_loop (for_loc, cond_loc, cond, incr_loc, incr, body,
c_break_label, c_cont_label, true);
add_stmt (c_end_compound_stmt (for_loc, block,
flag_isoc99 || c_dialect_objc ()));
c_parser_maybe_reclassify_token (parser);
token_indent_info next_tinfo
@@ -7454,8 +7478,9 @@ c_parser_sizeof_expression (c_parser *parser)
error_at (expr_loc, "%<sizeof%> applied to a bit-field");
result = c_expr_sizeof_expr (expr_loc, expr);
}
if (finish != UNKNOWN_LOCATION)
set_c_expr_source_range (&result, start, finish);
if (finish == UNKNOWN_LOCATION)
finish = start;
set_c_expr_source_range (&result, start, finish);
return result;
}
@@ -7994,6 +8019,41 @@ enum tgmath_parm_kind
tgmath_fixed, tgmath_real, tgmath_complex
};
/* Helper function for c_parser_postfix_expression. Parse predefined
identifiers. */
static struct c_expr
c_parser_predefined_identifier (c_parser *parser)
{
location_t loc = c_parser_peek_token (parser)->location;
switch (c_parser_peek_token (parser)->keyword)
{
case RID_FUNCTION_NAME:
pedwarn (loc, OPT_Wpedantic, "ISO C does not support %qs predefined "
"identifier", "__FUNCTION__");
break;
case RID_PRETTY_FUNCTION_NAME:
pedwarn (loc, OPT_Wpedantic, "ISO C does not support %qs predefined "
"identifier", "__PRETTY_FUNCTION__");
break;
case RID_C99_FUNCTION_NAME:
pedwarn_c90 (loc, OPT_Wpedantic, "ISO C90 does not support "
"%<__func__%> predefined identifier");
break;
default:
gcc_unreachable ();
}
struct c_expr expr;
expr.original_code = ERROR_MARK;
expr.original_type = NULL;
expr.value = fname_decl (loc, c_parser_peek_token (parser)->keyword,
c_parser_peek_token (parser)->value);
set_c_expr_source_range (&expr, loc, loc);
c_parser_consume_token (parser);
return expr;
}
/* Parse a postfix expression (C90 6.3.1-6.3.2, C99 6.5.1-6.5.2,
C11 6.5.1-6.5.2). Compound literals aren't handled here; callers have to
call c_parser_postfix_expression_after_paren_type on encountering them.
@@ -8214,31 +8274,9 @@ c_parser_postfix_expression (c_parser *parser)
switch (c_parser_peek_token (parser)->keyword)
{
case RID_FUNCTION_NAME:
pedwarn (loc, OPT_Wpedantic, "ISO C does not support "
"%<__FUNCTION__%> predefined identifier");
expr.value = fname_decl (loc,
c_parser_peek_token (parser)->keyword,
c_parser_peek_token (parser)->value);
set_c_expr_source_range (&expr, loc, loc);
c_parser_consume_token (parser);
break;
case RID_PRETTY_FUNCTION_NAME:
pedwarn (loc, OPT_Wpedantic, "ISO C does not support "
"%<__PRETTY_FUNCTION__%> predefined identifier");
expr.value = fname_decl (loc,
c_parser_peek_token (parser)->keyword,
c_parser_peek_token (parser)->value);
set_c_expr_source_range (&expr, loc, loc);
c_parser_consume_token (parser);
break;
case RID_C99_FUNCTION_NAME:
pedwarn_c90 (loc, OPT_Wpedantic, "ISO C90 does not support "
"%<__func__%> predefined identifier");
expr.value = fname_decl (loc,
c_parser_peek_token (parser)->keyword,
c_parser_peek_token (parser)->value);
set_c_expr_source_range (&expr, loc, loc);
c_parser_consume_token (parser);
expr = c_parser_predefined_identifier (parser);
break;
case RID_VA_ARG:
{
@@ -11932,15 +11970,9 @@ c_parser_omp_variable_list (c_parser *parser,
{
auto_vec<c_token> tokens;
unsigned int tokens_avail = 0;
bool first = true;
if (kind != OMP_CLAUSE_DEPEND
&& (c_parser_next_token_is_not (parser, CPP_NAME)
|| c_parser_peek_token (parser)->id_kind != C_ID_ID))
c_parser_error (parser, "expected identifier");
while (kind == OMP_CLAUSE_DEPEND
|| (c_parser_next_token_is (parser, CPP_NAME)
&& c_parser_peek_token (parser)->id_kind == C_ID_ID))
while (1)
{
bool array_section_p = false;
if (kind == OMP_CLAUSE_DEPEND)
@@ -11961,6 +11993,7 @@ c_parser_omp_variable_list (c_parser *parser,
break;
c_parser_consume_token (parser);
first = false;
continue;
}
@@ -12011,16 +12044,35 @@ c_parser_omp_variable_list (c_parser *parser,
parser->tokens_avail = tokens.length ();
}
tree t = lookup_name (c_parser_peek_token (parser)->value);
tree t = NULL_TREE;
if (t == NULL_TREE)
if (c_parser_next_token_is (parser, CPP_NAME)
&& c_parser_peek_token (parser)->id_kind == C_ID_ID)
{
undeclared_variable (c_parser_peek_token (parser)->location,
c_parser_peek_token (parser)->value);
t = error_mark_node;
}
t = lookup_name (c_parser_peek_token (parser)->value);
c_parser_consume_token (parser);
if (t == NULL_TREE)
{
undeclared_variable (c_parser_peek_token (parser)->location,
c_parser_peek_token (parser)->value);
t = error_mark_node;
}
c_parser_consume_token (parser);
}
else if (c_parser_next_token_is (parser, CPP_KEYWORD)
&& (c_parser_peek_token (parser)->keyword == RID_FUNCTION_NAME
|| (c_parser_peek_token (parser)->keyword
== RID_PRETTY_FUNCTION_NAME)
|| (c_parser_peek_token (parser)->keyword
== RID_C99_FUNCTION_NAME)))
t = c_parser_predefined_identifier (parser).value;
else
{
if (first)
c_parser_error (parser, "expected identifier");
break;
}
if (t == error_mark_node)
;
@@ -12158,6 +12210,7 @@ c_parser_omp_variable_list (c_parser *parser,
break;
c_parser_consume_token (parser);
first = false;
}
return list;
@@ -14689,7 +14742,10 @@ c_parser_omp_clause_dist_schedule (c_parser *parser, tree list)
c_parser_skip_until_found (parser, CPP_CLOSE_PAREN,
"expected %<,%> or %<)%>");
check_no_duplicate_clause (list, OMP_CLAUSE_SCHEDULE, "schedule");
/* check_no_duplicate_clause (list, OMP_CLAUSE_DIST_SCHEDULE,
"dist_schedule"); */
if (omp_find_clause (list, OMP_CLAUSE_DIST_SCHEDULE))
warning_at (loc, 0, "too many %qs clauses", "dist_schedule");
if (t == error_mark_node)
return list;
@@ -17575,9 +17631,9 @@ c_parser_omp_parallel (location_t loc, c_parser *parser,
stmt = c_finish_omp_parallel (loc,
cclauses[C_OMP_CLAUSE_SPLIT_PARALLEL],
block);
OMP_PARALLEL_COMBINED (stmt) = 1;
if (ret == NULL)
return ret;
OMP_PARALLEL_COMBINED (stmt) = 1;
return stmt;
}
else if (!flag_openmp) /* flag_openmp_simd */
@@ -19841,6 +19897,8 @@ c_parse_file (void)
if (c_parser_peek_token (&tparser)->pragma_kind == PRAGMA_GCC_PCH_PREPROCESS)
c_parser_pragma_pch_preprocess (&tparser);
else
c_common_no_more_pch ();
the_parser = ggc_alloc<c_parser> ();
*the_parser = tparser;
@@ -19869,13 +19927,13 @@ c_parse_file (void)
Take ownership of START_WITH_PASS, if non-NULL. */
void
location_t
c_parser_parse_rtl_body (c_parser *parser, char *start_with_pass)
{
if (!c_parser_require (parser, CPP_OPEN_BRACE, "expected %<{%>"))
{
free (start_with_pass);
return;
return c_parser_peek_token (parser)->location;
}
location_t start_loc = c_parser_peek_token (parser)->location;
@@ -19897,7 +19955,7 @@ c_parser_parse_rtl_body (c_parser *parser, char *start_with_pass)
case CPP_EOF:
error_at (start_loc, "no closing brace");
free (start_with_pass);
return;
return c_parser_peek_token (parser)->location;
default:
break;
}
@@ -19915,7 +19973,7 @@ c_parser_parse_rtl_body (c_parser *parser, char *start_with_pass)
if (!read_rtl_function_body_from_file_range (start_loc, end_loc))
{
free (start_with_pass);
return;
return end_loc;
}
/* If a pass name was provided for START_WITH_PASS, run the backend
@@ -19923,6 +19981,7 @@ c_parser_parse_rtl_body (c_parser *parser, char *start_with_pass)
ownership of START_WITH_PASS. */
if (start_with_pass)
run_rtl_passes (start_with_pass);
return end_loc;
}
#include "gt-c-c-parser.h"
+11 -6
View File
@@ -38,9 +38,12 @@ along with GCC; see the file COPYING3. If not see
nonzero if the definition of the type has already started. */
#define C_TYPE_BEING_DEFINED(TYPE) TYPE_LANG_FLAG_0 (TYPE)
/* In an incomplete RECORD_TYPE or UNION_TYPE, a list of variable
declarations whose type would be completed by completing that type. */
#define C_TYPE_INCOMPLETE_VARS(TYPE) TYPE_VFIELD (TYPE)
/* In an incomplete RECORD_TYPE, UNION_TYPE or ENUMERAL_TYPE, a list of
variable declarations whose type would be completed by completing
that type. */
#define C_TYPE_INCOMPLETE_VARS(TYPE) \
TYPE_LANG_SLOT_1 (TREE_CHECK4 (TYPE, RECORD_TYPE, UNION_TYPE, \
QUAL_UNION_TYPE, ENUMERAL_TYPE))
/* In an IDENTIFIER_NODE, nonzero if this identifier is actually a
keyword. C_RID_CODE (node) is then the RID_* value of the keyword. */
@@ -111,7 +114,8 @@ along with GCC; see the file COPYING3. If not see
/* For FUNCTION_TYPE, a hidden list of types of arguments. The same as
TYPE_ARG_TYPES for functions with prototypes, but created for functions
without prototypes. */
#define TYPE_ACTUAL_ARG_TYPES(NODE) TYPE_LANG_SLOT_1 (NODE)
#define TYPE_ACTUAL_ARG_TYPES(NODE) \
TYPE_LANG_SLOT_1 (FUNCTION_TYPE_CHECK (NODE))
/* For a CONSTRUCTOR, whether some initializer contains a
subexpression meaning it is not a constant expression. */
@@ -558,7 +562,7 @@ extern bool c_check_switch_jump_warnings (struct c_spot_bindings *,
location_t, location_t);
extern void finish_decl (tree, location_t, tree, tree, tree);
extern tree finish_enum (tree, tree, tree);
extern void finish_function (void);
extern void finish_function (location_t = input_location);
extern tree finish_struct (location_t, tree, tree, tree,
struct c_struct_parse_info *);
extern struct c_arg_info *build_arg_info (void);
@@ -694,7 +698,8 @@ extern int c_types_compatible_p (tree, tree);
extern tree c_begin_compound_stmt (bool);
extern tree c_end_compound_stmt (location_t, tree, bool);
extern void c_finish_if_stmt (location_t, tree, tree, tree);
extern void c_finish_loop (location_t, tree, tree, tree, tree, tree, bool);
extern void c_finish_loop (location_t, location_t, tree, location_t, tree,
tree, tree, tree, bool);
extern tree c_begin_stmt_expr (void);
extern tree c_finish_stmt_expr (location_t, tree);
extern tree c_process_expr_stmt (location_t, tree);
+46 -12
View File
@@ -5702,10 +5702,14 @@ build_c_cast (location_t loc, tree type, tree expr)
{
tree value;
bool int_operands = EXPR_INT_CONST_OPERANDS (expr);
if (TREE_CODE (expr) == EXCESS_PRECISION_EXPR)
expr = TREE_OPERAND (expr, 0);
value = expr;
if (int_operands)
value = remove_c_maybe_const_expr (value);
if (type == error_mark_node || expr == error_mark_node)
return error_mark_node;
@@ -5936,6 +5940,14 @@ build_c_cast (location_t loc, tree type, tree expr)
|| TREE_CODE (expr) == COMPLEX_CST)))
value = build1 (NOP_EXPR, type, value);
/* If the expression has integer operands and so can occur in an
unevaluated part of an integer constant expression, ensure the
return value reflects this. */
if (int_operands
&& INTEGRAL_TYPE_P (type)
&& !EXPR_INT_CONST_OPERANDS (value))
value = note_integer_operands (value);
protected_set_expr_location (value, loc);
return value;
}
@@ -10627,7 +10639,8 @@ c_finish_return (location_t loc, tree retval, tree origtype)
if (DECL_P (inner)
&& !DECL_EXTERNAL (inner)
&& !TREE_STATIC (inner)
&& DECL_CONTEXT (inner) == current_function_decl)
&& DECL_CONTEXT (inner) == current_function_decl
&& POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (current_function_decl))))
{
if (TREE_CODE (inner) == LABEL_DECL)
warning_at (loc, OPT_Wreturn_local_addr,
@@ -10858,11 +10871,14 @@ c_finish_if_stmt (location_t if_locus, tree cond, tree then_block,
the beginning of the loop. COND is the loop condition. COND_IS_FIRST
is false for DO loops. INCR is the FOR increment expression. BODY is
the statement controlled by the loop. BLAB is the break label. CLAB is
the continue label. Everything is allowed to be NULL. */
the continue label. Everything is allowed to be NULL.
COND_LOCUS is the location of the loop condition, INCR_LOCUS is the
location of the FOR increment expression. */
void
c_finish_loop (location_t start_locus, tree cond, tree incr, tree body,
tree blab, tree clab, bool cond_is_first)
c_finish_loop (location_t start_locus, location_t cond_locus, tree cond,
location_t incr_locus, tree incr, tree body, tree blab,
tree clab, bool cond_is_first)
{
tree entry = NULL, exit = NULL, t;
@@ -10904,12 +10920,8 @@ c_finish_loop (location_t start_locus, tree cond, tree incr, tree body,
}
t = build_and_jump (&blab);
if (cond_is_first)
exit = fold_build3_loc (start_locus,
COND_EXPR, void_type_node, cond, exit, t);
else
exit = fold_build3_loc (input_location,
COND_EXPR, void_type_node, cond, exit, t);
exit = fold_build3_loc (cond_is_first ? start_locus : input_location,
COND_EXPR, void_type_node, cond, exit, t);
}
else
{
@@ -10930,9 +10942,23 @@ c_finish_loop (location_t start_locus, tree cond, tree incr, tree body,
if (clab)
add_stmt (build1 (LABEL_EXPR, void_type_node, clab));
if (incr)
add_stmt (incr);
{
if (MAY_HAVE_DEBUG_MARKER_STMTS && incr_locus != UNKNOWN_LOCATION)
{
t = build0 (DEBUG_BEGIN_STMT, void_type_node);
SET_EXPR_LOCATION (t, incr_locus);
add_stmt (t);
}
add_stmt (incr);
}
if (entry)
add_stmt (entry);
if (MAY_HAVE_DEBUG_MARKER_STMTS && cond_locus != UNKNOWN_LOCATION)
{
t = build0 (DEBUG_BEGIN_STMT, void_type_node);
SET_EXPR_LOCATION (t, cond_locus);
add_stmt (t);
}
if (exit)
add_stmt (exit);
if (blab)
@@ -14699,6 +14725,13 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
case OMP_CLAUSE_DEFAULT_UNSPECIFIED:
break;
case OMP_CLAUSE_DEFAULT_SHARED:
if ((OMP_CLAUSE_CODE (c) == OMP_CLAUSE_SHARED
|| OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FIRSTPRIVATE)
&& c_omp_predefined_variable (t))
/* The __func__ variable and similar function-local
predefined variables may be listed in a shared or
firstprivate clause. */
break;
share_name = "shared";
break;
case OMP_CLAUSE_DEFAULT_PRIVATE:
@@ -14932,7 +14965,8 @@ c_build_qualified_type (tree type, int type_quals, tree orig_qual_type,
: build_qualified_type (type, type_quals));
/* A variant type does not inherit the list of incomplete vars from the
type main variant. */
if (RECORD_OR_UNION_TYPE_P (var_type)
if ((RECORD_OR_UNION_TYPE_P (var_type)
|| TREE_CODE (var_type) == ENUMERAL_TYPE)
&& TYPE_MAIN_VARIANT (var_type) != var_type)
C_TYPE_INCOMPLETE_VARS (var_type) = 0;
return var_type;
+29 -6
View File
@@ -1971,8 +1971,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
/* If TYPE is a transparent union or record, pass things the way
we would pass the first field of the union or record. We have
already verified that the modes are the same. */
if ((TREE_CODE (type) == UNION_TYPE || TREE_CODE (type) == RECORD_TYPE)
&& TYPE_TRANSPARENT_AGGR (type))
if (RECORD_OR_UNION_TYPE_P (type) && TYPE_TRANSPARENT_AGGR (type))
type = TREE_TYPE (first_field (type));
/* Decide where to pass this arg.
@@ -2750,6 +2749,9 @@ load_register_parameters (struct arg_data *args, int num_actuals,
poly_int64 size = 0;
HOST_WIDE_INT const_size = 0;
rtx_insn *before_arg = get_last_insn ();
tree type = TREE_TYPE (args[i].tree_value);
if (RECORD_OR_UNION_TYPE_P (type) && TYPE_TRANSPARENT_AGGR (type))
type = TREE_TYPE (first_field (type));
/* Set non-negative if we must move a word at a time, even if
just one word (e.g, partial == 4 && mode == DFmode). Set
to -1 if we just use a normal move insn. This value can be
@@ -2762,11 +2764,11 @@ load_register_parameters (struct arg_data *args, int num_actuals,
gcc_assert (partial % UNITS_PER_WORD == 0);
nregs = partial / UNITS_PER_WORD;
}
else if (TYPE_MODE (TREE_TYPE (args[i].tree_value)) == BLKmode)
else if (TYPE_MODE (type) == BLKmode)
{
/* Variable-sized parameters should be described by a
PARALLEL instead. */
const_size = int_size_in_bytes (TREE_TYPE (args[i].tree_value));
const_size = int_size_in_bytes (type);
gcc_assert (const_size >= 0);
nregs = (const_size + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD;
size = const_size;
@@ -2893,8 +2895,7 @@ load_register_parameters (struct arg_data *args, int num_actuals,
if (GET_CODE (reg) == PARALLEL)
use_group_regs (call_fusage, reg);
else if (nregs == -1)
use_reg_mode (call_fusage, reg,
TYPE_MODE (TREE_TYPE (args[i].tree_value)));
use_reg_mode (call_fusage, reg, TYPE_MODE (type));
else if (nregs > 0)
use_regs (call_fusage, REGNO (reg), nregs);
}
@@ -3628,6 +3629,28 @@ expand_call (tree exp, rtx target, int ignore)
|| dbg_cnt (tail_call) == false)
try_tail_call = 0;
/* Workaround buggy C/C++ wrappers around Fortran routines with
character(len=constant) arguments if the hidden string length arguments
are passed on the stack; if the callers forget to pass those arguments,
attempting to tail call in such routines leads to stack corruption.
Avoid tail calls in functions where at least one such hidden string
length argument is passed (partially or fully) on the stack in the
caller and the callee needs to pass any arguments on the stack.
See PR90329. */
if (try_tail_call && maybe_ne (args_size.constant, 0))
for (tree arg = DECL_ARGUMENTS (current_function_decl);
arg; arg = DECL_CHAIN (arg))
if (DECL_HIDDEN_STRING_LENGTH (arg) && DECL_INCOMING_RTL (arg))
{
subrtx_iterator::array_type array;
FOR_EACH_SUBRTX (iter, array, DECL_INCOMING_RTL (arg), NONCONST)
if (MEM_P (*iter))
{
try_tail_call = 0;
break;
}
}
/* If the user has marked the function as requiring tail-call
optimization, attempt it. */
if (must_tail_call)
+26 -10
View File
@@ -53,6 +53,7 @@ along with GCC; see the file COPYING3. If not see
#include "dce.h"
#include "dbgcnt.h"
#include "rtl-iter.h"
#include "regs.h"
#define FORWARDER_BLOCK_P(BB) ((BB)->flags & BB_FORWARDER_BLOCK)
@@ -257,6 +258,10 @@ thread_jump (edge e, basic_block b)
bool failed = false;
reg_set_iterator rsi;
/* Jump threading may cause fixup_partitions to introduce new crossing edges,
which is not allowed after reload. */
gcc_checking_assert (!reload_completed || !crtl->has_bb_partition);
if (b->flags & BB_NONTHREADABLE_BLOCK)
return NULL;
@@ -1224,6 +1229,14 @@ old_insns_match_p (int mode ATTRIBUTE_UNUSED, rtx_insn *i1, rtx_insn *i2)
}
}
}
HARD_REG_SET i1_used, i2_used;
get_call_reg_set_usage (i1, &i1_used, call_used_reg_set);
get_call_reg_set_usage (i2, &i2_used, call_used_reg_set);
if (!hard_reg_set_equal_p (i1_used, i2_used))
return dir_none;
}
/* If both i1 and i2 are frame related, verify all the CFA notes
@@ -3269,10 +3282,10 @@ make_pass_jump (gcc::context *ctxt)
namespace {
const pass_data pass_data_postreload_jump =
const pass_data pass_data_jump_after_combine =
{
RTL_PASS, /* type */
"postreload_jump", /* name */
"jump_after_combine", /* name */
OPTGROUP_NONE, /* optinfo_flags */
TV_JUMP, /* tv_id */
0, /* properties_required */
@@ -3282,31 +3295,34 @@ const pass_data pass_data_postreload_jump =
0, /* todo_flags_finish */
};
class pass_postreload_jump : public rtl_opt_pass
class pass_jump_after_combine : public rtl_opt_pass
{
public:
pass_postreload_jump (gcc::context *ctxt)
: rtl_opt_pass (pass_data_postreload_jump, ctxt)
pass_jump_after_combine (gcc::context *ctxt)
: rtl_opt_pass (pass_data_jump_after_combine, ctxt)
{}
/* opt_pass methods: */
virtual bool gate (function *) { return flag_thread_jumps; }
virtual unsigned int execute (function *);
}; // class pass_postreload_jump
}; // class pass_jump_after_combine
unsigned int
pass_postreload_jump::execute (function *)
pass_jump_after_combine::execute (function *)
{
cleanup_cfg (flag_thread_jumps ? CLEANUP_THREADING : 0);
/* Jump threading does not keep dominators up-to-date. */
free_dominance_info (CDI_DOMINATORS);
cleanup_cfg (CLEANUP_THREADING);
return 0;
}
} // anon namespace
rtl_opt_pass *
make_pass_postreload_jump (gcc::context *ctxt)
make_pass_jump_after_combine (gcc::context *ctxt)
{
return new pass_postreload_jump (ctxt);
return new pass_jump_after_combine (ctxt);
}
namespace {
+5 -1
View File
@@ -4369,7 +4369,11 @@ expand_debug_expr (tree exp)
op0 = DECL_RTL_IF_SET (exp);
/* This decl was probably optimized away. */
if (!op0)
if (!op0
/* At least label RTXen are sometimes replaced by
NOTE_INSN_DELETED_LABEL. Any notes here are not
handled by copy_rtx. */
|| NOTE_P (op0))
{
if (!VAR_P (exp)
|| DECL_EXTERNAL (exp)
+32 -5
View File
@@ -1779,8 +1779,6 @@ cgraph_node::release_body (bool keep_arguments)
void
cgraph_node::remove (void)
{
cgraph_node *n;
if (symtab->ipa_clones_dump_file && symtab->cloned_nodes.contains (this))
fprintf (symtab->ipa_clones_dump_file,
"Callgraph removal;%s;%d;%s;%d;%d\n", asm_name (), order,
@@ -1797,8 +1795,13 @@ cgraph_node::remove (void)
*/
force_output = false;
forced_by_abi = false;
for (n = nested; n; n = n->next_nested)
cgraph_node *next = nested;
for (cgraph_node *n = nested; n; n = next)
{
next = n->next_nested;
n->origin = NULL;
n->next_nested = NULL;
}
nested = NULL;
if (origin)
{
@@ -1852,7 +1855,7 @@ cgraph_node::remove (void)
*/
if (symtab->state != LTO_STREAMING)
{
n = cgraph_node::get (decl);
cgraph_node *n = cgraph_node::get (decl);
if (!n
|| (!n->clones && !n->clone_of && !n->global.inlined_to
&& ((symtab->global_info_ready || in_lto_p)
@@ -3449,6 +3452,30 @@ cgraph_node::verify_node (void)
e->aux = 0;
}
}
if (nested != NULL)
{
for (cgraph_node *n = nested; n != NULL; n = n->next_nested)
{
if (n->origin == NULL)
{
error ("missing origin for a node in a nested list");
error_found = true;
}
else if (n->origin != this)
{
error ("origin points to a different parent");
error_found = true;
break;
}
}
}
if (next_nested != NULL && origin == NULL)
{
error ("missing origin for a node in a nested list");
error_found = true;
}
if (error_found)
{
dump (stderr);
@@ -3607,7 +3634,7 @@ cgraph_node::get_body (void)
set_dump_file (NULL);
push_cfun (DECL_STRUCT_FUNCTION (decl));
execute_all_ipa_transforms ();
execute_all_ipa_transforms (true);
cgraph_edge::rebuild_edges ();
free_dominance_info (CDI_DOMINATORS);
free_dominance_info (CDI_POST_DOMINATORS);
+7 -7
View File
@@ -967,15 +967,15 @@ check_global_declaration (symtab_node *snode)
&& DECL_INITIAL (decl) == 0
&& DECL_EXTERNAL (decl)
&& ! DECL_ARTIFICIAL (decl)
&& ! TREE_NO_WARNING (decl)
&& ! TREE_PUBLIC (decl)
&& (warn_unused_function
|| snode->referred_to_p (/*include_self=*/false)))
&& ! TREE_PUBLIC (decl))
{
if (snode->referred_to_p (/*include_self=*/false))
if (TREE_NO_WARNING (decl))
;
else if (snode->referred_to_p (/*include_self=*/false))
pedwarn (input_location, 0, "%q+F used but never defined", decl);
else
warning (OPT_Wunused_function, "%q+F declared %<static%> but never defined", decl);
warning (OPT_Wunused_function, "%q+F declared %<static%> but never "
"defined", decl);
/* This symbol is effectively an "extern" declaration now. */
TREE_PUBLIC (decl) = 1;
}
@@ -2188,7 +2188,7 @@ cgraph_node::expand (void)
bitmap_obstack_initialize (&reg_obstack); /* FIXME, only at RTL generation*/
execute_all_ipa_transforms ();
execute_all_ipa_transforms (false);
/* Perform all tree transforms and optimizations. */
-4
View File
@@ -141,7 +141,3 @@ DEFCIFCODE(EXTERN_LIVE_ONLY_STATIC, CIF_FINAL_ERROR,
/* We proved that the call is unreachable. */
DEFCIFCODE(UNREACHABLE, CIF_FINAL_ERROR,
N_("unreachable"))
/* We can't inline because of instrumentation thunk. */
DEFCIFCODE(CHKP, CIF_FINAL_ERROR,
N_("caller is instrumentation thunk"))
+8 -1
View File
@@ -384,6 +384,10 @@ static void scan_prog_file (const char *, scanpass, scanfilter);
void
tool_cleanup (bool from_signal)
{
/* maybe_unlink may call notice, which is not signal safe. */
if (from_signal)
verbose = false;
if (c_file != 0 && c_file[0])
maybe_unlink (c_file);
@@ -743,7 +747,10 @@ maybe_run_lto_and_relink (char **lto_ld_argv, char **object_lst,
++num_files;
}
lto_o_files = XNEWVEC (char *, num_files + 1);
/* signal handler may access uninitialized memory
and delete whatever it points to, if lto_o_files
is not allocated with calloc. */
lto_o_files = XCNEWVEC (char *, num_files + 1);
lto_o_files[num_files] = NULL;
start = XOBFINISH (&temporary_obstack, char *);
for (i = 0; i < num_files; ++i)
+4 -4
View File
@@ -5138,10 +5138,9 @@ find_split_point (rtx *loc, rtx_insn *insn, bool set_src)
{
HOST_WIDE_INT pos = INTVAL (XEXP (SET_DEST (x), 2));
unsigned HOST_WIDE_INT len = INTVAL (XEXP (SET_DEST (x), 1));
unsigned HOST_WIDE_INT src = INTVAL (SET_SRC (x));
rtx dest = XEXP (SET_DEST (x), 0);
unsigned HOST_WIDE_INT mask
= (HOST_WIDE_INT_1U << len) - 1;
unsigned HOST_WIDE_INT mask = (HOST_WIDE_INT_1U << len) - 1;
unsigned HOST_WIDE_INT src = INTVAL (SET_SRC (x)) & mask;
rtx or_mask;
if (BITS_BIG_ENDIAN)
@@ -12424,7 +12423,8 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
bit. This will be converted into a ZERO_EXTRACT. */
if (const_op == 0 && sign_bit_comparison_p
&& CONST_INT_P (XEXP (op0, 1))
&& mode_width <= HOST_BITS_PER_WIDE_INT)
&& mode_width <= HOST_BITS_PER_WIDE_INT
&& UINTVAL (XEXP (op0, 1)) < mode_width)
{
op0 = simplify_and_const_int (NULL_RTX, mode, XEXP (op0, 0),
(HOST_WIDE_INT_1U
+2
View File
@@ -39,6 +39,8 @@ static const struct default_options arm_option_optimization_table[] =
/* Enable section anchors by default at -O1 or higher. */
{ OPT_LEVELS_1_PLUS, OPT_fsection_anchors, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_fsched_pressure, NULL, 1 },
/* Enable code hoisting only with -Os. */
{ OPT_LEVELS_SIZE, OPT_fcode_hoisting, NULL, 1 },
{ OPT_LEVELS_NONE, 0, NULL, 0 }
};
+1 -1
View File
@@ -1702,7 +1702,7 @@ const pta processor_alias_table[] =
| PTA_RDRND | PTA_MOVBE | PTA_MWAITX | PTA_ADX | PTA_RDSEED
| PTA_CLZERO | PTA_CLFLUSHOPT | PTA_XSAVEC | PTA_XSAVES
| PTA_SHA | PTA_LZCNT | PTA_POPCNT},
{"znver2", PROCESSOR_ZNVER2, CPU_ZNVER1,
{"znver2", PROCESSOR_ZNVER2, CPU_ZNVER2,
PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
| PTA_SSE4A | PTA_CX16 | PTA_ABM | PTA_SSSE3 | PTA_SSE4_1
| PTA_SSE4_2 | PTA_AES | PTA_PCLMUL | PTA_AVX | PTA_AVX2
+2 -2
View File
@@ -47,9 +47,9 @@ EXPORTED_CONST int processor_flags_table[] =
/* z14 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
| PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX
| PF_Z13 | PF_VX | PF_VXE | PF_Z14,
/* arch13 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
/* z15 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
| PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX
| PF_Z13 | PF_VX | PF_VXE | PF_Z14 | PF_VXE2 | PF_ARCH13
| PF_Z13 | PF_VX | PF_VXE | PF_Z14 | PF_VXE2 | PF_Z15
};
/* Change optimizations to be performed, depending on the
+38 -20
View File
@@ -676,7 +676,7 @@ x86_cpus="generic intel"
# Common parts for widely ported systems.
case ${target} in
*-*-darwin*)
tmake_file="t-darwin ${cpu_type}/t-darwin"
tmake_file="t-darwin "
tm_file="${tm_file} darwin.h"
case ${target} in
*-*-darwin9*)
@@ -1609,16 +1609,25 @@ hppa[12]*-*-hpux11*)
dwarf2=no
fi
;;
i[34567]86-*-darwin1[89]*)
echo "Error: 32bit target is not supported after Darwin17" 1>&2
;;
i[34567]86-*-darwin*)
need_64bit_isa=yes
# Baseline choice for a machine that allows m64 support.
with_cpu=${with_cpu:-core2}
tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch t-slibgcc"
tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h"
;;
x86_64-*-darwin1[89]* | x86_64-*-darwin2[01]*)
# Only 64b from now
with_cpu=${with_cpu:-core2}
tmake_file="${tmake_file} t-slibgcc"
;;
x86_64-*-darwin*)
with_cpu=${with_cpu:-core2}
tmake_file="${tmake_file} ${cpu_type}/t-darwin64 t-slibgcc"
tm_file="${tm_file} ${cpu_type}/darwin64.h"
tmake_file="${tmake_file} ${cpu_type}/t-darwin64-biarch t-slibgcc"
tm_file="${tm_file} ${cpu_type}/darwin64-biarch.h"
;;
i[34567]86-*-elfiamcu)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/iamcu.h"
@@ -2578,26 +2587,31 @@ pdp11-*-*)
# extra_headers=
# ;;
powerpc-*-darwin*)
extra_options="${extra_options} rs6000/darwin.opt"
extra_options="${extra_options} ${cpu_type}/darwin.opt"
case ${target} in
*-darwin1[0-9]* | *-darwin[8-9]*)
tmake_file="${tmake_file} rs6000/t-darwin8"
tm_file="${tm_file} rs6000/darwin8.h"
*-darwin1[0-9]* | *-darwin9*)
tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch"
tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h"
;;
*-darwin8*)
tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch"
tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h"
tm_file="${tm_file} ${cpu_type}/darwin8.h"
;;
*-darwin7*)
tm_file="${tm_file} rs6000/darwin7.h"
tm_file="${tm_file} ${cpu_type}/darwin7.h"
;;
*-darwin[0-6]*)
*-darwin[456]*)
# Earlier - ingle arch, with 32b only
# OS X 10.0, the first edition is Darwin4
;;
esac
tmake_file="${tmake_file} t-slibgcc"
extra_headers=altivec.h
;;
powerpc64-*-darwin*)
extra_options="${extra_options} ${cpu_type}/darwin.opt"
tmake_file="${tmake_file} ${cpu_type}/t-darwin64 t-slibgcc"
tm_file="${tm_file} ${cpu_type}/darwin8.h ${cpu_type}/darwin64.h"
extra_headers=altivec.h
tmake_file="${tmake_file} ${cpu_type}/t-darwin64-biarch t-slibgcc"
tm_file="${tm_file} ${cpu_type}/darwin64-biarch.h"
;;
powerpc*-*-freebsd*)
tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h ${fbsd_tm_file} rs6000/sysv4.h"
@@ -4686,14 +4700,12 @@ case "${target}" in
echo "#undef LINK_OS_EXTRA_SPEC32"
echo "#define LINK_OS_EXTRA_SPEC32" \
"\"%(link_os_new_dtags)" \
"-rpath $prefix/lib -rpath $at/lib" \
"-L $prefix/lib -L $at/lib\""
"-rpath $prefix/lib -rpath $at/lib\""
echo
echo "#undef LINK_OS_EXTRA_SPEC64"
echo "#define LINK_OS_EXTRA_SPEC64" \
"\"%(link_os_new_dtags)" \
"-rpath $prefix/lib64 -rpath $at/lib64" \
"-L $prefix/lib64 -L $at/lib64\""
"-rpath $prefix/lib64 -rpath $at/lib64\""
echo
echo "#undef LINK_OS_NEW_DTAGS_SPEC"
echo "#define LINK_OS_NEW_DTAGS_SPEC" \
@@ -4706,7 +4718,10 @@ case "${target}" in
echo "#define MD_EXEC_PREFIX \"$at/bin/\""
echo
echo "#undef MD_STARTFILE_PREFIX"
echo "#define MD_STARTFILE_PREFIX \"$at/lib/\"") \
echo "#define MD_STARTFILE_PREFIX \"$prefix/lib/\""
echo
echo "#undef MD_STARTFILE_PREFIX_1"
echo "#define MD_STARTFILE_PREFIX_1 \"$at/lib/\"") \
> advance-toolchain.h
else
echo "Unknown advance-toolchain $with_advance_toolchain"
@@ -4729,7 +4744,7 @@ case "${target}" in
for which in arch tune; do
eval "val=\$with_$which"
case ${val} in
"" | native | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12 | z13 | z14 | arch5 | arch6 | arch7 | arch8 | arch9 | arch10 | arch11 | arch12 | arch13 )
"" | native | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12 | z13 | z14 | z15 | arch5 | arch6 | arch7 | arch8 | arch9 | arch10 | arch11 | arch12 | arch13 )
# OK
;;
*)
@@ -4927,7 +4942,10 @@ case ${target} in
;;
i[34567]86-*-dragonfly* | x86_64-*-dragonfly*)
;;
i[34567]86-*-freebsd* | x86_64-*-freebsd*)
i[34567]86-*-freebsd*)
;;
x86_64-*-freebsd*)
tmake_file="${tmake_file} i386/t-freebsd64"
;;
ia64*-*-linux*)
;;
+1
View File
@@ -147,6 +147,7 @@ aarch64_update_cpp_builtins (cpp_reader *pfile)
builtin_define_with_int_value ("__ARM_FEATURE_SVE_BITS", bits);
}
aarch64_def_or_undef (TARGET_LSE, "__ARM_FEATURE_ATOMICS", pfile);
aarch64_def_or_undef (TARGET_AES, "__ARM_FEATURE_AES", pfile);
aarch64_def_or_undef (TARGET_SHA2, "__ARM_FEATURE_SHA2", pfile);
aarch64_def_or_undef (TARGET_SHA3, "__ARM_FEATURE_SHA3", pfile);
@@ -108,7 +108,7 @@ AARCH64_OPT_EXTENSION("sm4", AARCH64_FL_SM4, AARCH64_FL_SIMD, 0, false, "sm3 sm4
/* Enabling "fp16fml" also enables "fp" and "fp16".
Disabling "fp16fml" just disables "fp16fml". */
AARCH64_OPT_EXTENSION("fp16fml", AARCH64_FL_F16FML, AARCH64_FL_FP | AARCH64_FL_F16, 0, false, "asimdfml")
AARCH64_OPT_EXTENSION("fp16fml", AARCH64_FL_F16FML, AARCH64_FL_FP | AARCH64_FL_F16, 0, false, "asimdfhm")
/* Enabling "sve" also enables "fp16", "fp" and "simd".
Disabling "sve" just disables "sve". */
+15
View File
@@ -427,6 +427,8 @@ bool aarch64_is_long_call_p (rtx);
bool aarch64_is_noplt_call_p (rtx);
bool aarch64_label_mentioned_p (rtx);
void aarch64_declare_function_name (FILE *, const char*, tree);
void aarch64_asm_output_alias (FILE *, const tree, const tree);
void aarch64_asm_output_external (FILE *, tree, const char*);
bool aarch64_legitimate_pic_operand_p (rtx);
bool aarch64_mask_and_shift_for_ubfiz_p (scalar_int_mode, rtx, rtx);
bool aarch64_masks_and_shift_for_bfi_p (scalar_int_mode, unsigned HOST_WIDE_INT,
@@ -642,4 +644,17 @@ poly_uint64 aarch64_regmode_natural_size (machine_mode);
bool aarch64_high_bits_all_ones_p (HOST_WIDE_INT);
struct atomic_ool_names
{
const char *str[5][4];
};
rtx aarch64_atomic_ool_func(machine_mode mode, rtx model_rtx,
const atomic_ool_names *names);
extern const atomic_ool_names aarch64_ool_swp_names;
extern const atomic_ool_names aarch64_ool_ldadd_names;
extern const atomic_ool_names aarch64_ool_ldset_names;
extern const atomic_ool_names aarch64_ool_ldclr_names;
extern const atomic_ool_names aarch64_ool_ldeor_names;
#endif /* GCC_AARCH64_PROTOS_H */
+51 -69
View File
@@ -1012,31 +1012,17 @@
tmp));
DONE;
}
else
{
operands[2] = force_reg (SImode, operands[2]);
}
}
else if (MEM_P (operands[2]))
{
operands[2] = force_reg (SImode, operands[2]);
}
if (REG_P (operands[2]))
{
rtx tmp = gen_reg_rtx (<MODE>mode);
emit_insn (gen_aarch64_simd_dup<mode> (tmp,
convert_to_mode (<VEL>mode,
operands[2],
0)));
emit_insn (gen_aarch64_simd_reg_sshl<mode> (operands[0], operands[1],
tmp));
DONE;
}
else
FAIL;
}
)
operands[2] = force_reg (SImode, operands[2]);
rtx tmp = gen_reg_rtx (<MODE>mode);
emit_insn (gen_aarch64_simd_dup<mode> (tmp, convert_to_mode (<VEL>mode,
operands[2],
0)));
emit_insn (gen_aarch64_simd_reg_sshl<mode> (operands[0], operands[1], tmp));
DONE;
})
(define_expand "lshr<mode>3"
[(match_operand:VDQ_I 0 "register_operand" "")
@@ -1059,31 +1045,19 @@
tmp));
DONE;
}
else
operands[2] = force_reg (SImode, operands[2]);
}
else if (MEM_P (operands[2]))
{
operands[2] = force_reg (SImode, operands[2]);
}
if (REG_P (operands[2]))
{
rtx tmp = gen_reg_rtx (SImode);
rtx tmp1 = gen_reg_rtx (<MODE>mode);
emit_insn (gen_negsi2 (tmp, operands[2]));
emit_insn (gen_aarch64_simd_dup<mode> (tmp1,
convert_to_mode (<VEL>mode,
tmp, 0)));
emit_insn (gen_aarch64_simd_reg_shl<mode>_unsigned (operands[0],
operands[1],
tmp1));
DONE;
}
else
FAIL;
}
)
operands[2] = force_reg (SImode, operands[2]);
rtx tmp = gen_reg_rtx (SImode);
rtx tmp1 = gen_reg_rtx (<MODE>mode);
emit_insn (gen_negsi2 (tmp, operands[2]));
emit_insn (gen_aarch64_simd_dup<mode> (tmp1,
convert_to_mode (<VEL>mode, tmp, 0)));
emit_insn (gen_aarch64_simd_reg_shl<mode>_unsigned (operands[0], operands[1],
tmp1));
DONE;
})
(define_expand "ashr<mode>3"
[(match_operand:VDQ_I 0 "register_operand" "")
@@ -1106,31 +1080,19 @@
tmp));
DONE;
}
else
operands[2] = force_reg (SImode, operands[2]);
}
else if (MEM_P (operands[2]))
{
operands[2] = force_reg (SImode, operands[2]);
}
if (REG_P (operands[2]))
{
rtx tmp = gen_reg_rtx (SImode);
rtx tmp1 = gen_reg_rtx (<MODE>mode);
emit_insn (gen_negsi2 (tmp, operands[2]));
emit_insn (gen_aarch64_simd_dup<mode> (tmp1,
convert_to_mode (<VEL>mode,
tmp, 0)));
emit_insn (gen_aarch64_simd_reg_shl<mode>_signed (operands[0],
operands[1],
tmp1));
DONE;
}
else
FAIL;
}
)
operands[2] = force_reg (SImode, operands[2]);
rtx tmp = gen_reg_rtx (SImode);
rtx tmp1 = gen_reg_rtx (<MODE>mode);
emit_insn (gen_negsi2 (tmp, operands[2]));
emit_insn (gen_aarch64_simd_dup<mode> (tmp1, convert_to_mode (<VEL>mode,
tmp, 0)));
emit_insn (gen_aarch64_simd_reg_shl<mode>_signed (operands[0], operands[1],
tmp1));
DONE;
})
(define_expand "vashl<mode>3"
[(match_operand:VDQ_I 0 "register_operand" "")
@@ -5214,6 +5176,26 @@
if (GET_CODE (operands[0]) != REG)
operands[1] = force_reg (<MODE>mode, operands[1]);
}
/* If we have a paradoxical subreg trying to write to <MODE> from and the
registers don't overlap then we need to break it apart. What it's trying
to do is give two kind of information at the same time. It's trying to
convey liveness information by saying that the entire register will be
written to eventually, but it also only wants to write a single part of the
register. Hence the paradoxical subreg.
Instead of allowing this we will split the two concerns. The liveness
information will be conveyed using a clobber and then we break apart the
paradoxical subreg into just a normal write of the part that it wanted to
write originally. */
if (REG_P (operands[0]) && paradoxical_subreg_p (operands[1]))
{
if (!reg_overlap_mentioned_p (operands[0], operands[1]))
emit_clobber (operands[0]);
operands[1] = SUBREG_REG (operands[1]);
operands[0] = gen_lowpart (GET_MODE (operands[1]), operands[0]);
}
})
+249 -67
View File
@@ -1879,10 +1879,33 @@ emit_set_insn (rtx x, rtx y)
rtx
aarch64_gen_compare_reg (RTX_CODE code, rtx x, rtx y)
{
machine_mode mode = SELECT_CC_MODE (code, x, y);
rtx cc_reg = gen_rtx_REG (mode, CC_REGNUM);
machine_mode cmp_mode = GET_MODE (x);
machine_mode cc_mode;
rtx cc_reg;
emit_set_insn (cc_reg, gen_rtx_COMPARE (mode, x, y));
if (cmp_mode == TImode)
{
gcc_assert (code == NE);
cc_mode = CCmode;
cc_reg = gen_rtx_REG (cc_mode, CC_REGNUM);
rtx x_lo = operand_subword (x, 0, 0, TImode);
rtx y_lo = operand_subword (y, 0, 0, TImode);
emit_set_insn (cc_reg, gen_rtx_COMPARE (cc_mode, x_lo, y_lo));
rtx x_hi = operand_subword (x, 1, 0, TImode);
rtx y_hi = operand_subword (y, 1, 0, TImode);
emit_insn (gen_ccmpdi (cc_reg, cc_reg, x_hi, y_hi,
gen_rtx_EQ (cc_mode, cc_reg, const0_rtx),
GEN_INT (AARCH64_EQ)));
}
else
{
cc_mode = SELECT_CC_MODE (code, x, y);
cc_reg = gen_rtx_REG (cc_mode, CC_REGNUM);
emit_set_insn (cc_reg, gen_rtx_COMPARE (cc_mode, x, y));
}
return cc_reg;
}
@@ -1895,7 +1918,10 @@ aarch64_gen_compare_reg_maybe_ze (RTX_CODE code, rtx x, rtx y,
if (y_mode == E_QImode || y_mode == E_HImode)
{
if (CONST_INT_P (y))
y = GEN_INT (INTVAL (y) & GET_MODE_MASK (y_mode));
{
y = GEN_INT (INTVAL (y) & GET_MODE_MASK (y_mode));
y_mode = SImode;
}
else
{
rtx t, cc_reg;
@@ -1910,6 +1936,9 @@ aarch64_gen_compare_reg_maybe_ze (RTX_CODE code, rtx x, rtx y,
}
}
if (!aarch64_plus_operand (y, y_mode))
y = force_reg (y_mode, y);
return aarch64_gen_compare_reg (code, x, y);
}
@@ -2815,7 +2844,7 @@ aarch64_add_offset_1 (scalar_int_mode mode, rtx dest,
gcc_assert (emit_move_imm || temp1 != NULL_RTX);
gcc_assert (temp1 == NULL_RTX || !reg_overlap_mentioned_p (temp1, src));
HOST_WIDE_INT moffset = abs_hwi (offset);
unsigned HOST_WIDE_INT moffset = absu_hwi (offset);
rtx_insn *insn;
if (!moffset)
@@ -2859,7 +2888,8 @@ aarch64_add_offset_1 (scalar_int_mode mode, rtx dest,
if (emit_move_imm)
{
gcc_assert (temp1 != NULL_RTX || can_create_pseudo_p ());
temp1 = aarch64_force_temporary (mode, temp1, GEN_INT (moffset));
temp1 = aarch64_force_temporary (mode, temp1,
gen_int_mode (moffset, mode));
}
insn = emit_insn (offset < 0
? gen_sub3_insn (dest, src, temp1)
@@ -7538,7 +7568,7 @@ sizetochar (int size)
'S/T/U/V': Print a FP/SIMD register name for a register list.
The register printed is the FP/SIMD register name
of X + 0/1/2/3 for S/T/U/V.
'R': Print a scalar FP/SIMD register name + 1.
'R': Print a scalar Integer/FP/SIMD register name + 1.
'X': Print bottom 16 bits of integer constant in hex.
'w/x': Print a general register name or the zero register
(32-bit or 64-bit).
@@ -7730,12 +7760,13 @@ aarch64_print_operand (FILE *f, rtx x, int code)
break;
case 'R':
if (!REG_P (x) || !FP_REGNUM_P (REGNO (x)))
{
output_operand_lossage ("incompatible floating point / vector register operand for '%%%c'", code);
return;
}
asm_fprintf (f, "q%d", REGNO (x) - V0_REGNUM + 1);
if (REG_P (x) && FP_REGNUM_P (REGNO (x)))
asm_fprintf (f, "q%d", REGNO (x) - V0_REGNUM + 1);
else if (REG_P (x) && GP_REGNUM_P (REGNO (x)))
asm_fprintf (f, "x%d", REGNO (x) - R0_REGNUM + 1);
else
output_operand_lossage ("incompatible register operand for '%%%c'",
code);
break;
case 'X':
@@ -15276,6 +15307,19 @@ aarch64_asm_preferred_eh_data_format (int code ATTRIBUTE_UNUSED, int global)
return (global ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | type;
}
/* Output .variant_pcs for aarch64_vector_pcs function symbols. */
static void
aarch64_asm_output_variant_pcs (FILE *stream, const tree decl, const char* name)
{
if (aarch64_simd_decl_p (decl))
{
fprintf (stream, "\t.variant_pcs\t");
assemble_name (stream, name);
fprintf (stream, "\n");
}
}
/* The last .arch and .tune assembly strings that we printed. */
static std::string aarch64_last_printed_arch_string;
static std::string aarch64_last_printed_tune_string;
@@ -15325,9 +15369,60 @@ aarch64_declare_function_name (FILE *stream, const char* name,
aarch64_last_printed_tune_string = this_tune->name;
}
aarch64_asm_output_variant_pcs (stream, fndecl, name);
/* Don't forget the type directive for ELF. */
ASM_OUTPUT_TYPE_DIRECTIVE (stream, name, "function");
ASM_OUTPUT_LABEL (stream, name);
cfun->machine->label_is_assembled = true;
}
/* Implement PRINT_PATCHABLE_FUNCTION_ENTRY. Check if the patch area is after
the function label and emit a BTI if necessary. */
void
aarch64_print_patchable_function_entry (FILE *file,
unsigned HOST_WIDE_INT patch_area_size,
bool record_p)
{
if (cfun->machine->label_is_assembled
&& aarch64_bti_enabled ()
&& !cgraph_node::get (cfun->decl)->only_called_directly_p ())
{
/* Remove the BTI that follows the patch area and insert a new BTI
before the patch area right after the function label. */
rtx_insn *insn = next_real_nondebug_insn (get_insns ());
if (insn
&& INSN_P (insn)
&& GET_CODE (PATTERN (insn)) == UNSPEC_VOLATILE
&& XINT (PATTERN (insn), 1) == UNSPECV_BTI_C)
delete_insn (insn);
asm_fprintf (file, "\thint\t34 // bti c\n");
}
default_print_patchable_function_entry (file, patch_area_size, record_p);
}
/* Implement ASM_OUTPUT_DEF_FROM_DECLS. Output .variant_pcs for aliases. */
void
aarch64_asm_output_alias (FILE *stream, const tree decl, const tree target)
{
const char *name = XSTR (XEXP (DECL_RTL (decl), 0), 0);
const char *value = IDENTIFIER_POINTER (target);
aarch64_asm_output_variant_pcs (stream, decl, name);
ASM_OUTPUT_DEF (stream, name, value);
}
/* Implement ASM_OUTPUT_EXTERNAL. Output .variant_pcs for undefined
function symbol references. */
void
aarch64_asm_output_external (FILE *stream, tree decl, const char* name)
{
default_elf_asm_output_external (stream, decl, name);
aarch64_asm_output_variant_pcs (stream, decl, name);
}
/* Implements TARGET_ASM_FILE_START. Output the assembly header. */
@@ -15359,16 +15454,26 @@ static void
aarch64_emit_load_exclusive (machine_mode mode, rtx rval,
rtx mem, rtx model_rtx)
{
emit_insn (gen_aarch64_load_exclusive (mode, rval, mem, model_rtx));
if (mode == TImode)
emit_insn (gen_aarch64_load_exclusive_pair (gen_lowpart (DImode, rval),
gen_highpart (DImode, rval),
mem, model_rtx));
else
emit_insn (gen_aarch64_load_exclusive (mode, rval, mem, model_rtx));
}
/* Emit store exclusive. */
static void
aarch64_emit_store_exclusive (machine_mode mode, rtx bval,
rtx rval, rtx mem, rtx model_rtx)
rtx mem, rtx rval, rtx model_rtx)
{
emit_insn (gen_aarch64_store_exclusive (mode, bval, rval, mem, model_rtx));
if (mode == TImode)
emit_insn (gen_aarch64_store_exclusive_pair
(bval, mem, operand_subword (rval, 0, 0, TImode),
operand_subword (rval, 1, 0, TImode), model_rtx));
else
emit_insn (gen_aarch64_store_exclusive (mode, bval, mem, rval, model_rtx));
}
/* Mark the previous jump instruction as unlikely. */
@@ -15380,6 +15485,82 @@ aarch64_emit_unlikely_jump (rtx insn)
add_reg_br_prob_note (jump, profile_probability::very_unlikely ());
}
/* We store the names of the various atomic helpers in a 5x4 array.
Return the libcall function given MODE, MODEL and NAMES. */
rtx
aarch64_atomic_ool_func(machine_mode mode, rtx model_rtx,
const atomic_ool_names *names)
{
memmodel model = memmodel_base (INTVAL (model_rtx));
int mode_idx, model_idx;
switch (mode)
{
case E_QImode:
mode_idx = 0;
break;
case E_HImode:
mode_idx = 1;
break;
case E_SImode:
mode_idx = 2;
break;
case E_DImode:
mode_idx = 3;
break;
case E_TImode:
mode_idx = 4;
break;
default:
gcc_unreachable ();
}
switch (model)
{
case MEMMODEL_RELAXED:
model_idx = 0;
break;
case MEMMODEL_CONSUME:
case MEMMODEL_ACQUIRE:
model_idx = 1;
break;
case MEMMODEL_RELEASE:
model_idx = 2;
break;
case MEMMODEL_ACQ_REL:
case MEMMODEL_SEQ_CST:
model_idx = 3;
break;
default:
gcc_unreachable ();
}
return init_one_libfunc_visibility (names->str[mode_idx][model_idx],
VISIBILITY_HIDDEN);
}
#define DEF0(B, N) \
{ "__aarch64_" #B #N "_relax", \
"__aarch64_" #B #N "_acq", \
"__aarch64_" #B #N "_rel", \
"__aarch64_" #B #N "_acq_rel" }
#define DEF4(B) DEF0(B, 1), DEF0(B, 2), DEF0(B, 4), DEF0(B, 8), \
{ NULL, NULL, NULL, NULL }
#define DEF5(B) DEF0(B, 1), DEF0(B, 2), DEF0(B, 4), DEF0(B, 8), DEF0(B, 16)
static const atomic_ool_names aarch64_ool_cas_names = { { DEF5(cas) } };
const atomic_ool_names aarch64_ool_swp_names = { { DEF4(swp) } };
const atomic_ool_names aarch64_ool_ldadd_names = { { DEF4(ldadd) } };
const atomic_ool_names aarch64_ool_ldset_names = { { DEF4(ldset) } };
const atomic_ool_names aarch64_ool_ldclr_names = { { DEF4(ldclr) } };
const atomic_ool_names aarch64_ool_ldeor_names = { { DEF4(ldeor) } };
#undef DEF0
#undef DEF4
#undef DEF5
/* Expand a compare and swap pattern. */
void
@@ -15426,6 +15607,17 @@ aarch64_expand_compare_and_swap (rtx operands[])
newval, mod_s));
cc_reg = aarch64_gen_compare_reg_maybe_ze (NE, rval, oldval, mode);
}
else if (TARGET_OUTLINE_ATOMICS)
{
/* Oldval must satisfy compare afterward. */
if (!aarch64_plus_operand (oldval, mode))
oldval = force_reg (mode, oldval);
rtx func = aarch64_atomic_ool_func (mode, mod_s, &aarch64_ool_cas_names);
rval = emit_library_call_value (func, NULL_RTX, LCT_NORMAL, r_mode,
oldval, mode, newval, mode,
XEXP (mem, 0), Pmode);
cc_reg = aarch64_gen_compare_reg_maybe_ze (NE, rval, oldval, mode);
}
else
{
/* The oldval predicate varies by mode. Test it and force to reg. */
@@ -15468,13 +15660,14 @@ aarch64_emit_post_barrier (enum memmodel model)
void
aarch64_split_compare_and_swap (rtx operands[])
{
rtx rval, mem, oldval, newval, scratch;
/* Split after prolog/epilog to avoid interactions with shrinkwrapping. */
gcc_assert (epilogue_completed);
rtx rval, mem, oldval, newval, scratch, x, model_rtx;
machine_mode mode;
bool is_weak;
rtx_code_label *label1, *label2;
rtx x, cond;
enum memmodel model;
rtx model_rtx;
rval = operands[0];
mem = operands[1];
@@ -15495,7 +15688,8 @@ aarch64_split_compare_and_swap (rtx operands[])
CBNZ scratch, .label1
.label2:
CMP rval, 0. */
bool strong_zero_p = !is_weak && oldval == const0_rtx;
bool strong_zero_p = (!is_weak && !aarch64_track_speculation &&
oldval == const0_rtx && mode != TImode);
label1 = NULL;
if (!is_weak)
@@ -15508,35 +15702,20 @@ aarch64_split_compare_and_swap (rtx operands[])
/* The initial load can be relaxed for a __sync operation since a final
barrier will be emitted to stop code hoisting. */
if (is_mm_sync (model))
aarch64_emit_load_exclusive (mode, rval, mem,
GEN_INT (MEMMODEL_RELAXED));
aarch64_emit_load_exclusive (mode, rval, mem, GEN_INT (MEMMODEL_RELAXED));
else
aarch64_emit_load_exclusive (mode, rval, mem, model_rtx);
if (strong_zero_p)
{
if (aarch64_track_speculation)
{
/* Emit an explicit compare instruction, so that we can correctly
track the condition codes. */
rtx cc_reg = aarch64_gen_compare_reg (NE, rval, const0_rtx);
x = gen_rtx_NE (GET_MODE (cc_reg), cc_reg, const0_rtx);
}
else
x = gen_rtx_NE (VOIDmode, rval, const0_rtx);
x = gen_rtx_IF_THEN_ELSE (VOIDmode, x,
gen_rtx_LABEL_REF (Pmode, label2), pc_rtx);
aarch64_emit_unlikely_jump (gen_rtx_SET (pc_rtx, x));
}
x = gen_rtx_NE (VOIDmode, rval, const0_rtx);
else
{
cond = aarch64_gen_compare_reg_maybe_ze (NE, rval, oldval, mode);
x = gen_rtx_NE (VOIDmode, cond, const0_rtx);
x = gen_rtx_IF_THEN_ELSE (VOIDmode, x,
gen_rtx_LABEL_REF (Pmode, label2), pc_rtx);
aarch64_emit_unlikely_jump (gen_rtx_SET (pc_rtx, x));
rtx cc_reg = aarch64_gen_compare_reg_maybe_ze (NE, rval, oldval, mode);
x = gen_rtx_NE (VOIDmode, cc_reg, const0_rtx);
}
x = gen_rtx_IF_THEN_ELSE (VOIDmode, x,
gen_rtx_LABEL_REF (Pmode, label2), pc_rtx);
aarch64_emit_unlikely_jump (gen_rtx_SET (pc_rtx, x));
aarch64_emit_store_exclusive (mode, scratch, mem, newval, model_rtx);
@@ -15557,22 +15736,16 @@ aarch64_split_compare_and_swap (rtx operands[])
aarch64_emit_unlikely_jump (gen_rtx_SET (pc_rtx, x));
}
else
{
cond = gen_rtx_REG (CCmode, CC_REGNUM);
x = gen_rtx_COMPARE (CCmode, scratch, const0_rtx);
emit_insn (gen_rtx_SET (cond, x));
}
aarch64_gen_compare_reg (NE, scratch, const0_rtx);
emit_label (label2);
/* If we used a CBNZ in the exchange loop emit an explicit compare with RVAL
to set the condition flags. If this is not used it will be removed by
later passes. */
if (strong_zero_p)
{
cond = gen_rtx_REG (CCmode, CC_REGNUM);
x = gen_rtx_COMPARE (CCmode, rval, const0_rtx);
emit_insn (gen_rtx_SET (cond, x));
}
aarch64_gen_compare_reg (NE, rval, const0_rtx);
/* Emit any final barrier needed for a __sync operation. */
if (is_mm_sync (model))
aarch64_emit_post_barrier (model);
@@ -15584,6 +15757,9 @@ void
aarch64_split_atomic_op (enum rtx_code code, rtx old_out, rtx new_out, rtx mem,
rtx value, rtx model_rtx, rtx cond)
{
/* Split after prolog/epilog to avoid interactions with shrinkwrapping. */
gcc_assert (epilogue_completed);
machine_mode mode = GET_MODE (mem);
machine_mode wmode = (mode == DImode ? DImode : SImode);
const enum memmodel model = memmodel_from_int (INTVAL (model_rtx));
@@ -17211,14 +17387,15 @@ aarch64_expand_subvti (rtx op0, rtx low_dest, rtx low_in1,
}
else
{
if (CONST_INT_P (low_in2))
{
high_in2 = force_reg (DImode, high_in2);
emit_insn (gen_subdi3_compare1_imm (low_dest, low_in1, low_in2,
GEN_INT (-INTVAL (low_in2))));
}
if (aarch64_plus_immediate (low_in2, DImode))
emit_insn (gen_subdi3_compare1_imm (low_dest, low_in1, low_in2,
GEN_INT (-INTVAL (low_in2))));
else
emit_insn (gen_subdi3_compare1 (low_dest, low_in1, low_in2));
{
low_in2 = force_reg (DImode, low_in2);
emit_insn (gen_subdi3_compare1 (low_dest, low_in1, low_in2));
}
high_in2 = force_reg (DImode, high_in2);
if (unsigned_p)
emit_insn (gen_usubdi3_carryinC (high_dest, high_in1, high_in2));
@@ -18126,19 +18303,21 @@ aarch64_gen_adjusted_ldpstp (rtx *operands, bool load,
/* Sort the operands. */
qsort (temp_operands, 4, 2 * sizeof (rtx *), aarch64_ldrstr_offset_compare);
/* Copy the memory operands so that if we have to bail for some
reason the original addresses are unchanged. */
if (load)
{
mem_1 = temp_operands[1];
mem_2 = temp_operands[3];
mem_3 = temp_operands[5];
mem_4 = temp_operands[7];
mem_1 = copy_rtx (temp_operands[1]);
mem_2 = copy_rtx (temp_operands[3]);
mem_3 = copy_rtx (temp_operands[5]);
mem_4 = copy_rtx (temp_operands[7]);
}
else
{
mem_1 = temp_operands[0];
mem_2 = temp_operands[2];
mem_3 = temp_operands[4];
mem_4 = temp_operands[6];
mem_1 = copy_rtx (temp_operands[0]);
mem_2 = copy_rtx (temp_operands[2]);
mem_3 = copy_rtx (temp_operands[4]);
mem_4 = copy_rtx (temp_operands[6]);
gcc_assert (code == UNKNOWN);
}
@@ -18908,6 +19087,9 @@ aarch64_run_selftests (void)
#undef TARGET_ASM_TRAMPOLINE_TEMPLATE
#define TARGET_ASM_TRAMPOLINE_TEMPLATE aarch64_asm_trampoline_template
#undef TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY
#define TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY aarch64_print_patchable_function_entry
#undef TARGET_BUILD_BUILTIN_VA_LIST
#define TARGET_BUILD_BUILTIN_VA_LIST aarch64_build_builtin_va_list
+10
View File
@@ -505,6 +505,15 @@ extern unsigned aarch64_architecture_version;
#define ASM_DECLARE_FUNCTION_NAME(STR, NAME, DECL) \
aarch64_declare_function_name (STR, NAME, DECL)
/* Output assembly strings for alias definition. */
#define ASM_OUTPUT_DEF_FROM_DECLS(STR, DECL, TARGET) \
aarch64_asm_output_alias (STR, DECL, TARGET)
/* Output assembly strings for undefined extern symbols. */
#undef ASM_OUTPUT_EXTERNAL
#define ASM_OUTPUT_EXTERNAL(STR, DECL, NAME) \
aarch64_asm_output_external (STR, DECL, NAME)
/* For EH returns X4 contains the stack adjustment. */
#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, R4_REGNUM)
#define EH_RETURN_HANDLER_RTX aarch64_eh_return_handler_rtx ()
@@ -722,6 +731,7 @@ typedef struct GTY (()) machine_function
struct aarch64_frame frame;
/* One entry for each hard register. */
bool reg_is_wrapped_separately[LAST_SAVED_REGNUM];
bool label_is_assembled;
} machine_function;
#endif
+3 -3
View File
@@ -1059,8 +1059,8 @@
(match_operand:GPI 1 "general_operand" ""))]
""
"
if (MEM_P (operands[0]) && CONST_INT_P (operands[1])
&& <MODE>mode == DImode
if (MEM_P (operands[0]) && !MEM_VOLATILE_P (operands[0])
&& CONST_INT_P (operands[1]) && <MODE>mode == DImode
&& aarch64_split_dimode_const_store (operands[0], operands[1]))
DONE;
@@ -6304,7 +6304,7 @@
[(match_operand:GPI 0 "register_operand")
(match_operand:GPF 1 "register_operand")]
"TARGET_FLOAT
&& ((GET_MODE_SIZE (<GPF:MODE>mode) <= GET_MODE_SIZE (<GPI:MODE>mode))
&& ((GET_MODE_BITSIZE (<GPF:MODE>mode) <= LONG_TYPE_SIZE)
|| !flag_trapping_math || flag_fp_int_builtin_inexact)"
{
rtx cvt = gen_reg_rtx (<GPF:MODE>mode);
+6 -3
View File
@@ -119,15 +119,15 @@ EnumValue
Enum(aarch64_tls_size) String(48) Value(48)
march=
Target RejectNegative ToLower Joined Var(aarch64_arch_string)
Target RejectNegative Negative(march=) ToLower Joined Var(aarch64_arch_string)
Use features of architecture ARCH.
mcpu=
Target RejectNegative ToLower Joined Var(aarch64_cpu_string)
Target RejectNegative Negative(mcpu=) ToLower Joined Var(aarch64_cpu_string)
Use features of and optimize for CPU.
mtune=
Target RejectNegative ToLower Joined Var(aarch64_tune_string)
Target RejectNegative Negative(mtune=) ToLower Joined Var(aarch64_tune_string)
Optimize for CPU.
mabi=
@@ -255,3 +255,6 @@ user-land code.
TargetVariable
long aarch64_stack_protector_guard_offset = 0
moutline-atomics
Target Report Mask(OUTLINE_ATOMICS) Save
Generate local calls to out-of-line atomic operations.
+186 -22
View File
@@ -22,10 +22,10 @@
(define_expand "@atomic_compare_and_swap<mode>"
[(match_operand:SI 0 "register_operand" "") ;; bool out
(match_operand:ALLI 1 "register_operand" "") ;; val out
(match_operand:ALLI 2 "aarch64_sync_memory_operand" "") ;; memory
(match_operand:ALLI 3 "nonmemory_operand" "") ;; expected
(match_operand:ALLI 4 "aarch64_reg_or_zero" "") ;; desired
(match_operand:ALLI_TI 1 "register_operand" "") ;; val out
(match_operand:ALLI_TI 2 "aarch64_sync_memory_operand" "") ;; memory
(match_operand:ALLI_TI 3 "nonmemory_operand" "") ;; expected
(match_operand:ALLI_TI 4 "aarch64_reg_or_zero" "") ;; desired
(match_operand:SI 5 "const_int_operand") ;; is_weak
(match_operand:SI 6 "const_int_operand") ;; mod_s
(match_operand:SI 7 "const_int_operand")] ;; mod_f
@@ -38,6 +38,8 @@
(define_mode_attr cas_short_expected_pred
[(QI "aarch64_reg_or_imm") (HI "aarch64_plushi_operand")])
(define_mode_attr cas_short_expected_imm
[(QI "n") (HI "Uph")])
(define_insn_and_split "@aarch64_compare_and_swap<mode>"
[(set (reg:CC CC_REGNUM) ;; bool out
@@ -47,7 +49,8 @@
(match_operand:SHORT 1 "aarch64_sync_memory_operand" "+Q"))) ;; memory
(set (match_dup 1)
(unspec_volatile:SHORT
[(match_operand:SHORT 2 "<cas_short_expected_pred>" "rn") ;; expected
[(match_operand:SHORT 2 "<cas_short_expected_pred>"
"r<cas_short_expected_imm>") ;; expected
(match_operand:SHORT 3 "aarch64_reg_or_zero" "rZ") ;; desired
(match_operand:SI 4 "const_int_operand") ;; is_weak
(match_operand:SI 5 "const_int_operand") ;; mod_s
@@ -56,7 +59,7 @@
(clobber (match_scratch:SI 7 "=&r"))]
""
"#"
"&& reload_completed"
"&& epilogue_completed"
[(const_int 0)]
{
aarch64_split_compare_and_swap (operands);
@@ -80,7 +83,31 @@
(clobber (match_scratch:SI 7 "=&r"))]
""
"#"
"&& reload_completed"
"&& epilogue_completed"
[(const_int 0)]
{
aarch64_split_compare_and_swap (operands);
DONE;
}
)
(define_insn_and_split "@aarch64_compare_and_swap<mode>"
[(set (reg:CC CC_REGNUM) ;; bool out
(unspec_volatile:CC [(const_int 0)] UNSPECV_ATOMIC_CMPSW))
(set (match_operand:JUST_TI 0 "register_operand" "=&r") ;; val out
(match_operand:JUST_TI 1 "aarch64_sync_memory_operand" "+Q")) ;; memory
(set (match_dup 1)
(unspec_volatile:JUST_TI
[(match_operand:JUST_TI 2 "aarch64_reg_or_zero" "rZ") ;; expect
(match_operand:JUST_TI 3 "aarch64_reg_or_zero" "rZ") ;; desired
(match_operand:SI 4 "const_int_operand") ;; is_weak
(match_operand:SI 5 "const_int_operand") ;; mod_s
(match_operand:SI 6 "const_int_operand")] ;; mod_f
UNSPECV_ATOMIC_CMPSW))
(clobber (match_scratch:SI 7 "=&r"))]
""
"#"
"&& epilogue_completed"
[(const_int 0)]
{
aarch64_split_compare_and_swap (operands);
@@ -133,6 +160,28 @@
return "casal<atomic_sfx>\t%<w>0, %<w>2, %1";
})
(define_insn "@aarch64_compare_and_swap<mode>_lse"
[(set (match_operand:JUST_TI 0 "register_operand" "+r") ;; val out
(match_operand:JUST_TI 1 "aarch64_sync_memory_operand" "+Q")) ;; memory
(set (match_dup 1)
(unspec_volatile:JUST_TI
[(match_dup 0) ;; expect
(match_operand:JUST_TI 2 "register_operand" "r") ;; desired
(match_operand:SI 3 "const_int_operand")] ;; mod_s
UNSPECV_ATOMIC_CMPSW))]
"TARGET_LSE"
{
enum memmodel model = memmodel_from_int (INTVAL (operands[3]));
if (is_mm_relaxed (model))
return "casp\t%0, %R0, %2, %R2, %1";
else if (is_mm_acquire (model) || is_mm_consume (model))
return "caspa\t%0, %R0, %2, %R2, %1";
else if (is_mm_release (model))
return "caspl\t%0, %R0, %2, %R2, %1";
else
return "caspal\t%0, %R0, %2, %R2, %1";
})
(define_expand "atomic_exchange<mode>"
[(match_operand:ALLI 0 "register_operand" "")
(match_operand:ALLI 1 "aarch64_sync_memory_operand" "")
@@ -140,16 +189,27 @@
(match_operand:SI 3 "const_int_operand" "")]
""
{
rtx (*gen) (rtx, rtx, rtx, rtx);
/* Use an atomic SWP when available. */
if (TARGET_LSE)
gen = gen_aarch64_atomic_exchange<mode>_lse;
{
emit_insn (gen_aarch64_atomic_exchange<mode>_lse
(operands[0], operands[1], operands[2], operands[3]));
}
else if (TARGET_OUTLINE_ATOMICS)
{
machine_mode mode = <MODE>mode;
rtx func = aarch64_atomic_ool_func (mode, operands[3],
&aarch64_ool_swp_names);
rtx rval = emit_library_call_value (func, operands[0], LCT_NORMAL,
mode, operands[2], mode,
XEXP (operands[1], 0), Pmode);
emit_move_insn (operands[0], rval);
}
else
gen = gen_aarch64_atomic_exchange<mode>;
emit_insn (gen (operands[0], operands[1], operands[2], operands[3]));
{
emit_insn (gen_aarch64_atomic_exchange<mode>
(operands[0], operands[1], operands[2], operands[3]));
}
DONE;
}
)
@@ -166,7 +226,7 @@
(clobber (match_scratch:SI 4 "=&r"))]
""
"#"
"&& reload_completed"
"&& epilogue_completed"
[(const_int 0)]
{
aarch64_split_atomic_op (SET, operands[0], NULL, operands[1],
@@ -234,6 +294,39 @@
}
operands[1] = force_reg (<MODE>mode, operands[1]);
}
else if (TARGET_OUTLINE_ATOMICS)
{
const atomic_ool_names *names;
switch (<CODE>)
{
case MINUS:
operands[1] = expand_simple_unop (<MODE>mode, NEG, operands[1],
NULL, 1);
/* fallthru */
case PLUS:
names = &aarch64_ool_ldadd_names;
break;
case IOR:
names = &aarch64_ool_ldset_names;
break;
case XOR:
names = &aarch64_ool_ldeor_names;
break;
case AND:
operands[1] = expand_simple_unop (<MODE>mode, NOT, operands[1],
NULL, 1);
names = &aarch64_ool_ldclr_names;
break;
default:
gcc_unreachable ();
}
machine_mode mode = <MODE>mode;
rtx func = aarch64_atomic_ool_func (mode, operands[2], names);
emit_library_call_value (func, NULL_RTX, LCT_NORMAL, mode,
operands[1], mode,
XEXP (operands[0], 0), Pmode);
DONE;
}
else
gen = gen_aarch64_atomic_<atomic_optab><mode>;
@@ -254,7 +347,7 @@
(clobber (match_scratch:SI 4 "=&r"))]
""
"#"
"&& reload_completed"
"&& epilogue_completed"
[(const_int 0)]
{
aarch64_split_atomic_op (<CODE>, NULL, operands[3], operands[0],
@@ -310,7 +403,7 @@
(clobber (match_scratch:SI 4 "=&r"))]
""
"#"
"&& reload_completed"
"&& epilogue_completed"
[(const_int 0)]
{
aarch64_split_atomic_op (NOT, NULL, operands[3], operands[0],
@@ -359,6 +452,40 @@
}
operands[2] = force_reg (<MODE>mode, operands[2]);
}
else if (TARGET_OUTLINE_ATOMICS)
{
const atomic_ool_names *names;
switch (<CODE>)
{
case MINUS:
operands[2] = expand_simple_unop (<MODE>mode, NEG, operands[2],
NULL, 1);
/* fallthru */
case PLUS:
names = &aarch64_ool_ldadd_names;
break;
case IOR:
names = &aarch64_ool_ldset_names;
break;
case XOR:
names = &aarch64_ool_ldeor_names;
break;
case AND:
operands[2] = expand_simple_unop (<MODE>mode, NOT, operands[2],
NULL, 1);
names = &aarch64_ool_ldclr_names;
break;
default:
gcc_unreachable ();
}
machine_mode mode = <MODE>mode;
rtx func = aarch64_atomic_ool_func (mode, operands[3], names);
rtx rval = emit_library_call_value (func, operands[0], LCT_NORMAL, mode,
operands[2], mode,
XEXP (operands[1], 0), Pmode);
emit_move_insn (operands[0], rval);
DONE;
}
else
gen = gen_aarch64_atomic_fetch_<atomic_optab><mode>;
@@ -380,7 +507,7 @@
(clobber (match_scratch:SI 5 "=&r"))]
""
"#"
"&& reload_completed"
"&& epilogue_completed"
[(const_int 0)]
{
aarch64_split_atomic_op (<CODE>, operands[0], operands[4], operands[1],
@@ -427,7 +554,7 @@
(clobber (match_scratch:SI 5 "=&r"))]
""
"#"
"&& reload_completed"
"&& epilogue_completed"
[(const_int 0)]
{
aarch64_split_atomic_op (NOT, operands[0], operands[4], operands[1],
@@ -448,7 +575,7 @@
{
/* Use an atomic load-operate instruction when possible. In this case
we will re-compute the result from the original mem value. */
if (TARGET_LSE)
if (TARGET_LSE || TARGET_OUTLINE_ATOMICS)
{
rtx tmp = gen_reg_rtx (<MODE>mode);
operands[2] = force_reg (<MODE>mode, operands[2]);
@@ -480,7 +607,7 @@
(clobber (match_scratch:SI 4 "=&r"))]
""
"#"
"&& reload_completed"
"&& epilogue_completed"
[(const_int 0)]
{
aarch64_split_atomic_op (<CODE>, NULL, operands[0], operands[1],
@@ -504,7 +631,7 @@
(clobber (match_scratch:SI 4 "=&r"))]
""
"#"
"&& reload_completed"
"&& epilogue_completed"
[(const_int 0)]
{
aarch64_split_atomic_op (NOT, NULL, operands[0], operands[1],
@@ -581,6 +708,24 @@
}
)
(define_insn "aarch64_load_exclusive_pair"
[(set (match_operand:DI 0 "register_operand" "=r")
(unspec_volatile:DI
[(match_operand:TI 2 "aarch64_sync_memory_operand" "Q")
(match_operand:SI 3 "const_int_operand")]
UNSPECV_LX))
(set (match_operand:DI 1 "register_operand" "=r")
(unspec_volatile:DI [(match_dup 2) (match_dup 3)] UNSPECV_LX))]
""
{
enum memmodel model = memmodel_from_int (INTVAL (operands[3]));
if (is_mm_relaxed (model) || is_mm_consume (model) || is_mm_release (model))
return "ldxp\t%0, %1, %2";
else
return "ldaxp\t%0, %1, %2";
}
)
(define_insn "@aarch64_store_exclusive<mode>"
[(set (match_operand:SI 0 "register_operand" "=&r")
(unspec_volatile:SI [(const_int 0)] UNSPECV_SX))
@@ -599,6 +744,25 @@
}
)
(define_insn "aarch64_store_exclusive_pair"
[(set (match_operand:SI 0 "register_operand" "=&r")
(unspec_volatile:SI [(const_int 0)] UNSPECV_SX))
(set (match_operand:TI 1 "aarch64_sync_memory_operand" "=Q")
(unspec_volatile:TI
[(match_operand:DI 2 "aarch64_reg_or_zero" "rZ")
(match_operand:DI 3 "aarch64_reg_or_zero" "rZ")
(match_operand:SI 4 "const_int_operand")]
UNSPECV_SX))]
""
{
enum memmodel model = memmodel_from_int (INTVAL (operands[4]));
if (is_mm_relaxed (model) || is_mm_consume (model) || is_mm_acquire (model))
return "stxp\t%w0, %x2, %x3, %1";
else
return "stlxp\t%w0, %x2, %x3, %1";
}
)
(define_expand "mem_thread_fence"
[(match_operand:SI 0 "const_int_operand" "")]
""
+7
View File
@@ -220,6 +220,13 @@
(and (match_code "const_int")
(match_test "(unsigned) exact_log2 (ival) <= 4")))
(define_constraint "Uph"
"@internal
A constraint that matches HImode integers zero extendable to
SImode plus_operand."
(and (match_code "const_int")
(match_test "aarch64_plushi_immediate (op, VOIDmode)")))
(define_memory_constraint "Q"
"A memory address which uses a single base register with no offset."
(and (match_code "mem")
+3
View File
@@ -29,6 +29,9 @@
;; Iterator for HI, SI, DI, some instructions can only work on these modes.
(define_mode_iterator GPI_I16 [(HI "AARCH64_ISA_F16") SI DI])
;; "Iterator" for just TI -- features like @pattern only work with iterators.
(define_mode_iterator JUST_TI [TI])
;; Iterator for QI and HI modes
(define_mode_iterator SHORT [QI HI])
+3
View File
@@ -8839,6 +8839,9 @@ alpha_handle_trap_shadows (void)
case CODE_LABEL:
goto close_shadow;
case DEBUG_INSN:
break;
default:
gcc_unreachable ();
}
+1
View File
@@ -38,4 +38,5 @@ VECTOR_MODES (INT, 16); /* V16QI V8HI V4SI V2DI */
/* FPU condition flags. */
CC_MODE (CC_FPU);
CC_MODE (CC_FPUE);
CC_MODE (CC_FPU_UNEQ);
+76 -186
View File
@@ -1445,6 +1445,7 @@ get_arc_condition_code (rtx comparison)
default : gcc_unreachable ();
}
case E_CC_FPUmode:
case E_CC_FPUEmode:
switch (GET_CODE (comparison))
{
case EQ : return ARC_CC_EQ;
@@ -1567,11 +1568,13 @@ arc_select_cc_mode (enum rtx_code op, rtx x, rtx y)
case UNLE:
case UNGT:
case UNGE:
return CC_FPUmode;
case LT:
case LE:
case GT:
case GE:
return CC_FPUmode;
return CC_FPUEmode;
case LTGT:
case UNEQ:
@@ -1725,7 +1728,7 @@ arc_init_reg_tables (void)
if (i == (int) CCmode || i == (int) CC_ZNmode || i == (int) CC_Zmode
|| i == (int) CC_Cmode
|| i == CC_FP_GTmode || i == CC_FP_GEmode || i == CC_FP_ORDmode
|| i == CC_FPUmode || i == CC_FPU_UNEQmode)
|| i == CC_FPUmode || i == CC_FPUEmode || i == CC_FPU_UNEQmode)
arc_mode_class[i] = 1 << (int) C_MODE;
else
arc_mode_class[i] = 0;
@@ -5971,130 +5974,63 @@ arc_legitimize_tls_address (rtx addr, enum tls_model model)
}
}
/* Legitimize a pic address reference in ORIG.
The return value is the legitimated address.
If OLDX is non-zero, it is the target to assign the address to first. */
/* Return true if SYMBOL_REF X binds locally. */
static bool
arc_symbol_binds_local_p (const_rtx x)
{
return (SYMBOL_REF_DECL (x)
? targetm.binds_local_p (SYMBOL_REF_DECL (x))
: SYMBOL_REF_LOCAL_P (x));
}
/* Legitimize a pic address reference in ADDR. The return value is
the legitimated address. */
static rtx
arc_legitimize_pic_address (rtx orig, rtx oldx)
arc_legitimize_pic_address (rtx addr)
{
rtx addr = orig;
rtx pat = orig;
rtx base;
if (!flag_pic)
return addr;
if (oldx == orig)
oldx = NULL;
if (GET_CODE (addr) == LABEL_REF)
; /* Do nothing. */
else if (GET_CODE (addr) == SYMBOL_REF)
switch (GET_CODE (addr))
{
enum tls_model model = SYMBOL_REF_TLS_MODEL (addr);
if (model != 0)
return arc_legitimize_tls_address (addr, model);
else if (!flag_pic)
return orig;
else if (CONSTANT_POOL_ADDRESS_P (addr) || SYMBOL_REF_LOCAL_P (addr))
return arc_unspec_offset (addr, ARC_UNSPEC_GOTOFFPC);
case UNSPEC:
/* Can be one or our GOT or GOTOFFPC unspecs. This situation
happens when an address is not a legitimate constant and we
need the resolve it via force_reg in
prepare_move_operands. */
switch (XINT (addr, 1))
{
case ARC_UNSPEC_GOT:
case ARC_UNSPEC_GOTOFFPC:
/* Recover the symbol ref. */
addr = XVECEXP (addr, 0, 0);
break;
default:
return addr;
}
/* Fall through. */
case SYMBOL_REF:
/* TLS symbols are handled in different place. */
if (SYMBOL_REF_TLS_MODEL (addr))
return addr;
/* This symbol must be referenced via a load from the Global
Offset Table (@GOTPC). */
pat = arc_unspec_offset (addr, ARC_UNSPEC_GOT);
pat = gen_const_mem (Pmode, pat);
if (!arc_symbol_binds_local_p (addr))
return gen_const_mem (Pmode, arc_unspec_offset (addr, ARC_UNSPEC_GOT));
if (oldx == NULL)
oldx = gen_reg_rtx (Pmode);
/* Local symb: use @pcl to access it. */
/* Fall through. */
case LABEL_REF:
return arc_unspec_offset (addr, ARC_UNSPEC_GOTOFFPC);
emit_move_insn (oldx, pat);
pat = oldx;
}
else
{
if (GET_CODE (addr) == CONST)
{
addr = XEXP (addr, 0);
if (GET_CODE (addr) == UNSPEC)
{
/* Check that the unspec is one of the ones we generate? */
return orig;
}
/* fwprop is placing in the REG_EQUIV notes constant pic
unspecs expressions. Then, loop may use these notes for
optimizations resulting in complex patterns that are not
supported by the current implementation. The following
two if-cases are simplifying the complex patters to
simpler ones. */
else if (GET_CODE (addr) == MINUS)
{
rtx op0 = XEXP (addr, 0);
rtx op1 = XEXP (addr, 1);
gcc_assert (oldx);
gcc_assert (GET_CODE (op1) == UNSPEC);
emit_move_insn (oldx,
gen_rtx_CONST (SImode,
arc_legitimize_pic_address (op1,
NULL_RTX)));
emit_insn (gen_rtx_SET (oldx, gen_rtx_MINUS (SImode, op0, oldx)));
return oldx;
}
else if (GET_CODE (addr) != PLUS)
{
rtx tmp = XEXP (addr, 0);
enum rtx_code code = GET_CODE (addr);
/* It only works for UNARY operations. */
gcc_assert (UNARY_P (addr));
gcc_assert (GET_CODE (tmp) == UNSPEC);
gcc_assert (oldx);
emit_move_insn
(oldx,
gen_rtx_CONST (SImode,
arc_legitimize_pic_address (tmp,
NULL_RTX)));
emit_insn (gen_rtx_SET (oldx,
gen_rtx_fmt_ee (code, SImode,
oldx, const0_rtx)));
return oldx;
}
else
{
gcc_assert (GET_CODE (addr) == PLUS);
if (GET_CODE (XEXP (addr, 0)) == UNSPEC)
return orig;
}
}
if (GET_CODE (addr) == PLUS)
{
rtx op0 = XEXP (addr, 0), op1 = XEXP (addr, 1);
base = arc_legitimize_pic_address (op0, oldx);
pat = arc_legitimize_pic_address (op1,
base == oldx ? NULL_RTX : oldx);
if (base == op0 && pat == op1)
return orig;
if (GET_CODE (pat) == CONST_INT)
pat = plus_constant (Pmode, base, INTVAL (pat));
else
{
if (GET_CODE (pat) == PLUS && CONSTANT_P (XEXP (pat, 1)))
{
base = gen_rtx_PLUS (Pmode, base, XEXP (pat, 0));
pat = XEXP (pat, 1);
}
pat = gen_rtx_PLUS (Pmode, base, pat);
}
}
default:
break;
}
return pat;
return addr;
}
/* Output address constant X to FILE, taking PIC into account. */
@@ -6256,28 +6192,6 @@ arc_output_pic_addr_const (FILE * file, rtx x, int code)
}
}
#define SYMBOLIC_CONST(X) \
(GET_CODE (X) == SYMBOL_REF \
|| GET_CODE (X) == LABEL_REF \
|| (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X)))
/* Emit insns to move operands[1] into operands[0]. */
static void
prepare_pic_move (rtx *operands, machine_mode)
{
if (GET_CODE (operands[0]) == MEM && SYMBOLIC_CONST (operands[1])
&& flag_pic)
operands[1] = force_reg (Pmode, operands[1]);
else
{
rtx temp = (reload_in_progress ? operands[0]
: flag_pic? gen_reg_rtx (Pmode) : NULL_RTX);
operands[1] = arc_legitimize_pic_address (operands[1], temp);
}
}
/* The function returning the number of words, at the beginning of an
argument, must be put in registers. The returned value must be
zero for arguments that are passed entirely in registers or that
@@ -8322,6 +8236,7 @@ arc_reorg (void)
/* Avoid FPU instructions. */
if ((GET_MODE (XEXP (XEXP (pc_target, 0), 0)) == CC_FPUmode)
|| (GET_MODE (XEXP (XEXP (pc_target, 0), 0)) == CC_FPUEmode)
|| (GET_MODE (XEXP (XEXP (pc_target, 0), 0)) == CC_FPU_UNEQmode))
continue;
@@ -9053,54 +8968,37 @@ prepare_move_operands (rtx *operands, machine_mode mode)
}
}
if (mode == SImode && SYMBOLIC_CONST (operands[1]))
if (GET_CODE (operands[1]) == SYMBOL_REF)
{
prepare_pic_move (operands, SImode);
/* Disable any REG_EQUALs associated with the symref
otherwise the optimization pass undoes the work done
here and references the variable directly. */
enum tls_model model = SYMBOL_REF_TLS_MODEL (operands[1]);
if (MEM_P (operands[0]))
operands[1] = force_reg (mode, operands[1]);
else if (model)
operands[1] = arc_legitimize_tls_address (operands[1], model);
}
operands[1] = arc_legitimize_pic_address (operands[1]);
/* Store instructions are limited, they only accept as address an
immediate, a register or a register plus a small immediate. */
if (MEM_P (operands[0])
&& !(reload_in_progress || reload_completed))
&& !move_dest_operand (operands[0], mode))
{
operands[1] = force_reg (mode, operands[1]);
if (!move_dest_operand (operands[0], mode))
{
rtx addr = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));
/* This is like change_address_1 (operands[0], mode, 0, 1) ,
except that we can't use that function because it is static. */
rtx pat = change_address (operands[0], mode, addr);
MEM_COPY_ATTRIBUTES (pat, operands[0]);
operands[0] = pat;
}
if (!cse_not_expected)
{
rtx pat = XEXP (operands[0], 0);
pat = arc_legitimize_address_0 (pat, pat, mode);
if (pat)
{
pat = change_address (operands[0], mode, pat);
MEM_COPY_ATTRIBUTES (pat, operands[0]);
operands[0] = pat;
}
}
rtx tmp0 = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));
rtx tmp1 = change_address (operands[0], mode, tmp0);
MEM_COPY_ATTRIBUTES (tmp1, operands[0]);
operands[0] = tmp1;
}
if (MEM_P (operands[1]) && !cse_not_expected)
{
rtx pat = XEXP (operands[1], 0);
pat = arc_legitimize_address_0 (pat, pat, mode);
if (pat)
{
pat = change_address (operands[1], mode, pat);
MEM_COPY_ATTRIBUTES (pat, operands[1]);
operands[1] = pat;
}
}
/* Check if it is constant but it is not legitimized. */
if (CONSTANT_P (operands[1])
&& !arc_legitimate_constant_p (mode, operands[1]))
operands[1] = force_reg (mode, XEXP (operands[1], 0));
else if (MEM_P (operands[0])
&& ((CONSTANT_P (operands[1])
&& !satisfies_constraint_Cm3 (operands[1]))
|| MEM_P (operands[1])))
operands[1] = force_reg (mode, operands[1]);
return false;
}
@@ -9572,11 +9470,10 @@ arc_legitimize_address_0 (rtx x, rtx oldx ATTRIBUTE_UNUSED,
{
rtx addr, inner;
if (flag_pic && SYMBOLIC_CONST (x))
(x) = arc_legitimize_pic_address (x, 0);
addr = x;
if (GET_CODE (addr) == CONST)
addr = XEXP (addr, 0);
if (GET_CODE (addr) == PLUS
&& CONST_INT_P (XEXP (addr, 1))
&& ((GET_CODE (XEXP (addr, 0)) == SYMBOL_REF
@@ -9607,13 +9504,6 @@ arc_legitimize_address_0 (rtx x, rtx oldx ATTRIBUTE_UNUSED,
static rtx
arc_legitimize_address (rtx orig_x, rtx oldx, machine_mode mode)
{
if (GET_CODE (orig_x) == SYMBOL_REF)
{
enum tls_model model = SYMBOL_REF_TLS_MODEL (orig_x);
if (model != 0)
return arc_legitimize_tls_address (orig_x, model);
}
rtx new_x = arc_legitimize_address_0 (orig_x, oldx, mode);
if (new_x)
+1 -1
View File
@@ -1530,7 +1530,7 @@ enum arc_function_type {
(((MODE) == CC_FP_GTmode || (MODE) == CC_FP_GEmode \
|| (MODE) == CC_FP_UNEQmode || (MODE) == CC_FP_ORDmode \
|| (MODE) == CC_FPXmode || (MODE) == CC_FPU_UNEQmode \
|| (MODE) == CC_FPUmode) \
|| (MODE) == CC_FPUmode || (MODE) == CC_FPUEmode) \
? reverse_condition_maybe_unordered ((CODE)) \
: reverse_condition ((CODE)))
+19 -15
View File
@@ -671,7 +671,9 @@ core_3, archs4x, archs4xd, archs4xd_slow"
[(set (match_operand:QI 0 "move_dest_operand" "=Rcq,Rcq#q, w,Rcq#q, h, w, w,???w,h, w,Rcq, S,!*x, r,r, Ucm,m,???m, m,Usc")
(match_operand:QI 1 "move_src_operand" " cL, cP,Rcq#q, P,hCm1,cL, I,?Rac,i,?i, T,Rcq,Usd,Ucm,m,?Rac,c,?Rac,Cm3,i"))]
"register_operand (operands[0], QImode)
|| register_operand (operands[1], QImode)"
|| register_operand (operands[1], QImode)
|| (satisfies_constraint_Cm3 (operands[1])
&& memory_operand (operands[0], QImode))"
"@
mov%? %0,%1%&
mov%? %0,%1%&
@@ -713,7 +715,9 @@ core_3, archs4x, archs4xd, archs4xd_slow"
/* Don't use a LIMM that we could load with a single insn - we loose
delay-slot filling opportunities. */
&& !satisfies_constraint_I (operands[1])
&& satisfies_constraint_Usc (operands[0]))"
&& satisfies_constraint_Usc (operands[0]))
|| (satisfies_constraint_Cm3 (operands[1])
&& memory_operand (operands[0], HImode))"
"@
mov%? %0,%1%&
mov%? %0,%1%&
@@ -3670,7 +3674,7 @@ core_3, archs4x, archs4xd, archs4xd_slow"
})
(define_mode_iterator SDF [(SF "TARGET_FP_SP_BASE || TARGET_OPTFPE")
(DF "TARGET_OPTFPE")])
(DF "TARGET_FP_DP_BASE || TARGET_OPTFPE")])
(define_expand "cstore<mode>4"
[(set (reg:CC CC_REG)
@@ -3680,7 +3684,7 @@ core_3, archs4x, archs4xd, archs4xd_slow"
(match_operator:SI 1 "comparison_operator" [(reg CC_REG)
(const_int 0)]))]
"TARGET_FP_SP_BASE || TARGET_OPTFPE"
"TARGET_HARD_FLOAT || TARGET_OPTFPE"
{
gcc_assert (XEXP (operands[1], 0) == operands[2]);
gcc_assert (XEXP (operands[1], 1) == operands[3]);
@@ -3738,20 +3742,20 @@ core_3, archs4x, archs4xd, archs4xd_slow"
; cond_exec patterns
(define_insn "*movsi_ne"
[(cond_exec
(ne (match_operand:CC_Z 2 "cc_use_register" "Rcc, Rcc, Rcc,Rcc,Rcc") (const_int 0))
(set (match_operand:SI 0 "dest_reg_operand" "=Rcq#q,Rcq#q,Rcq#q, w,w")
(match_operand:SI 1 "nonmemory_operand" "C_0, h, ?Cal, Lc,?Cal")))]
(ne (match_operand:CC_Z 2 "cc_use_register" "Rcc,Rcc,Rcc,Rcc,Rcc") (const_int 0))
(set (match_operand:SI 0 "dest_reg_operand" "=q, q, r, q, r")
(match_operand:SI 1 "nonmemory_operand" "C_0, h, Lr,Cal,Cal")))]
""
"@
* current_insn_predicate = 0; return \"sub%?.ne %0,%0,%0%&\";
* current_insn_predicate = 0; return \"mov%?.ne %0,%1\";
* current_insn_predicate = 0; return \"mov%?.ne %0,%1\";
mov.ne %0,%1
mov.ne %0,%1"
* current_insn_predicate = 0; return \"sub%?.ne\\t%0,%0,%0\";
* current_insn_predicate = 0; return \"mov%?.ne\\t%0,%1\";
mov.ne\\t%0,%1
* current_insn_predicate = 0; return \"mov%?.ne\\t%0,%1\";
mov.ne\\t%0,%1"
[(set_attr "type" "cmove")
(set_attr "iscompact" "true,true,true_limm,false,false")
(set_attr "length" "2,2,6,4,8")
(set_attr "cpu_facility" "*,av2,av2,*,*")])
(set_attr "iscompact" "true,true,false,true_limm,false")
(set_attr "length" "2,2,4,6,8")
(set_attr "cpu_facility" "*,av2,*,av2,*")])
(define_insn "*movsi_cond_exec"
[(cond_exec
+24
View File
@@ -242,6 +242,18 @@
(set_attr "type" "fpu")
(set_attr "predicable" "yes")])
(define_insn "*cmpsf_fpu_trap"
[(set (reg:CC_FPUE CC_REG)
(compare:CC_FPUE (match_operand:SF 0 "register_operand" "r, r,r")
(match_operand:SF 1 "nonmemory_operand" "r,CfZ,F")))]
"TARGET_FP_SP_BASE"
"fscmpf%?\\t%0,%1"
[(set_attr "length" "4,4,8")
(set_attr "iscompact" "false")
(set_attr "cond" "set")
(set_attr "type" "fpu")
(set_attr "predicable" "yes")])
(define_insn "*cmpsf_fpu_uneq"
[(set (reg:CC_FPU_UNEQ CC_REG)
(compare:CC_FPU_UNEQ
@@ -338,6 +350,18 @@
(set_attr "type" "fpu")
(set_attr "predicable" "yes")])
(define_insn "*cmpdf_fpu_trap"
[(set (reg:CC_FPUE CC_REG)
(compare:CC_FPUE (match_operand:DF 0 "even_register_operand" "r")
(match_operand:DF 1 "even_register_operand" "r")))]
"TARGET_FP_DP_BASE"
"fdcmpf%? %0, %1"
[(set_attr "length" "4")
(set_attr "iscompact" "false")
(set_attr "cond" "set")
(set_attr "type" "fpu")
(set_attr "predicable" "yes")])
(define_insn "*cmpdf_fpu_uneq"
[(set (reg:CC_FPU_UNEQ CC_REG)
(compare:CC_FPU_UNEQ
+1
View File
@@ -437,6 +437,7 @@
|| code == ORDERED || code == UNORDERED);
case E_CC_FPUmode:
case E_CC_FPUEmode:
return 1;
case E_CC_FPU_UNEQmode:
return 1;
+1
View File
@@ -66,6 +66,7 @@ extern bool arm_small_register_classes_for_mode_p (machine_mode);
extern int const_ok_for_arm (HOST_WIDE_INT);
extern int const_ok_for_op (HOST_WIDE_INT, enum rtx_code);
extern int const_ok_for_dimode_op (HOST_WIDE_INT, enum rtx_code);
extern void thumb1_gen_const_int (rtx, HOST_WIDE_INT);
extern int arm_split_constant (RTX_CODE, machine_mode, rtx,
HOST_WIDE_INT, rtx, rtx, int);
extern int legitimate_pic_operand_p (rtx);
+146 -26
View File
@@ -2904,13 +2904,18 @@ arm_option_check_internal (struct gcc_options *opts)
{
const char *flag = (target_pure_code ? "-mpure-code" :
"-mslow-flash-data");
bool common_unsupported_modes = arm_arch_notm || flag_pic || TARGET_NEON;
/* We only support -mpure-code and -mslow-flash-data on M-profile targets
with MOVT. */
if (!TARGET_HAVE_MOVT || arm_arch_notm || flag_pic || TARGET_NEON)
/* We only support -mslow-flash-data on M-profile targets with
MOVT. */
if (target_slow_flash_data && (!TARGET_HAVE_MOVT || common_unsupported_modes))
error ("%s only supports non-pic code on M-profile targets with the "
"MOVT instruction", flag);
/* We only support -mpure-code on M-profile targets. */
if (target_pure_code && common_unsupported_modes)
error ("%s only supports non-pic code on M-profile targets", flag);
/* Cannot load addresses: -mslow-flash-data forbids literal pool and
-mword-relocations forbids relocation of MOVT/MOVW. */
if (target_word_relocations)
@@ -4316,6 +4321,38 @@ const_ok_for_dimode_op (HOST_WIDE_INT i, enum rtx_code code)
}
}
/* Emit a sequence of movs/adds/shift to produce a 32-bit constant.
Avoid generating useless code when one of the bytes is zero. */
void
thumb1_gen_const_int (rtx op0, HOST_WIDE_INT op1)
{
bool mov_done_p = false;
int i;
/* Emit upper 3 bytes if needed. */
for (i = 0; i < 3; i++)
{
int byte = (op1 >> (8 * (3 - i))) & 0xff;
if (byte)
{
emit_set_insn (op0, mov_done_p
? gen_rtx_PLUS (SImode,op0, GEN_INT (byte))
: GEN_INT (byte));
mov_done_p = true;
}
if (mov_done_p)
emit_set_insn (op0, gen_rtx_ASHIFT (SImode, op0, GEN_INT (8)));
}
/* Emit lower byte if needed. */
if (!mov_done_p)
emit_set_insn (op0, GEN_INT (op1 & 0xff));
else if (op1 & 0xff)
emit_set_insn (op0, gen_rtx_PLUS (SImode, op0, GEN_INT (op1 & 0xff)));
}
/* Emit a sequence of insns to handle a large constant.
CODE is the code of the operation required, it can be any of SET, PLUS,
IOR, AND, XOR, MINUS;
@@ -8325,7 +8362,8 @@ thumb1_legitimate_address_p (machine_mode mode, rtx x, int strict_p)
/* This is PC relative data before arm_reorg runs. */
else if (GET_MODE_SIZE (mode) >= 4 && CONSTANT_P (x)
&& GET_CODE (x) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (x) && !flag_pic)
&& CONSTANT_POOL_ADDRESS_P (x) && !flag_pic
&& !arm_disable_literal_pool)
return 1;
/* This is PC relative data after arm_reorg runs. */
@@ -8393,6 +8431,7 @@ thumb1_legitimate_address_p (machine_mode mode, rtx x, int strict_p)
&& GET_MODE_SIZE (mode) == 4
&& GET_CODE (x) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (x)
&& !arm_disable_literal_pool
&& ! (flag_pic
&& symbol_mentioned_p (get_pool_constant (x))
&& ! pcrel_constant_p (get_pool_constant (x))))
@@ -9028,7 +9067,9 @@ thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
return 0;
if (thumb_shiftable_const (INTVAL (x)))
return COSTS_N_INSNS (2);
return COSTS_N_INSNS (3);
return arm_disable_literal_pool
? COSTS_N_INSNS (8)
: COSTS_N_INSNS (3);
}
else if ((outer == PLUS || outer == COMPARE)
&& INTVAL (x) < 256 && INTVAL (x) > -256)
@@ -9185,7 +9226,9 @@ thumb1_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
/* See split "TARGET_THUMB1 && satisfies_constraint_K". */
if (thumb_shiftable_const (INTVAL (x)))
return COSTS_N_INSNS (2);
return COSTS_N_INSNS (3);
return arm_disable_literal_pool
? COSTS_N_INSNS (8)
: COSTS_N_INSNS (3);
}
else if ((outer == PLUS || outer == COMPARE)
&& INTVAL (x) < 256 && INTVAL (x) > -256)
@@ -19670,6 +19713,35 @@ arm_compute_save_core_reg_mask (void)
return save_reg_mask;
}
/* Return a mask for the call-clobbered low registers that are unused
at the end of the prologue. */
static unsigned long
thumb1_prologue_unused_call_clobbered_lo_regs (void)
{
unsigned long mask = 0;
for (int reg = 0; reg <= LAST_LO_REGNUM; reg++)
if (!callee_saved_reg_p (reg)
&& !REGNO_REG_SET_P (df_get_live_out (ENTRY_BLOCK_PTR_FOR_FN (cfun)),
reg))
mask |= 1 << reg;
return mask;
}
/* Similarly for the start of the epilogue. */
static unsigned long
thumb1_epilogue_unused_call_clobbered_lo_regs (void)
{
unsigned long mask = 0;
for (int reg = 0; reg <= LAST_LO_REGNUM; reg++)
if (!callee_saved_reg_p (reg)
&& !REGNO_REG_SET_P (df_get_live_in (EXIT_BLOCK_PTR_FOR_FN (cfun)),
reg))
mask |= 1 << reg;
return mask;
}
/* Compute a bit mask of which core registers need to be
saved on the stack for the current function. */
static unsigned long
@@ -19701,10 +19773,19 @@ thumb1_compute_save_core_reg_mask (void)
if (mask & 0xff || thumb_force_lr_save ())
mask |= (1 << LR_REGNUM);
/* Make sure we have a low work register if we need one.
We will need one if we are going to push a high register,
but we are not currently intending to push a low register. */
bool call_clobbered_scratch
= (thumb1_prologue_unused_call_clobbered_lo_regs ()
&& thumb1_epilogue_unused_call_clobbered_lo_regs ());
/* Make sure we have a low work register if we need one. We will
need one if we are going to push a high register, but we are not
currently intending to push a low register. However if both the
prologue and epilogue have a spare call-clobbered low register,
then we won't need to find an additional work register. It does
not need to be the same register in the prologue and
epilogue. */
if ((mask & 0xff) == 0
&& !call_clobbered_scratch
&& ((mask & 0x0f00) || TARGET_BACKTRACE))
{
/* Use thumb_find_work_register to choose which register
@@ -24930,12 +25011,7 @@ thumb1_unexpanded_epilogue (void)
unsigned long mask = live_regs_mask & 0xff;
int next_hi_reg;
/* The available low registers depend on the size of the value we are
returning. */
if (size <= 12)
mask |= 1 << 3;
if (size <= 8)
mask |= 1 << 2;
mask |= thumb1_epilogue_unused_call_clobbered_lo_regs ();
if (mask == 0)
/* Oh dear! We have no low registers into which we can pop
@@ -24943,7 +25019,7 @@ thumb1_unexpanded_epilogue (void)
internal_error
("no low registers available for popping high registers");
for (next_hi_reg = 8; next_hi_reg < 13; next_hi_reg++)
for (next_hi_reg = 12; next_hi_reg > LAST_LO_REGNUM; next_hi_reg--)
if (live_regs_mask & (1 << next_hi_reg))
break;
@@ -24951,7 +25027,7 @@ thumb1_unexpanded_epilogue (void)
{
/* Find lo register(s) into which the high register(s) can
be popped. */
for (regno = 0; regno <= LAST_LO_REGNUM; regno++)
for (regno = LAST_LO_REGNUM; regno >= 0; regno--)
{
if (mask & (1 << regno))
high_regs_pushed--;
@@ -24959,20 +25035,22 @@ thumb1_unexpanded_epilogue (void)
break;
}
mask &= (2 << regno) - 1; /* A noop if regno == 8 */
if (high_regs_pushed == 0 && regno >= 0)
mask &= ~((1 << regno) - 1);
/* Pop the values into the low register(s). */
thumb_pop (asm_out_file, mask);
/* Move the value(s) into the high registers. */
for (regno = 0; regno <= LAST_LO_REGNUM; regno++)
for (regno = LAST_LO_REGNUM; regno >= 0; regno--)
{
if (mask & (1 << regno))
{
asm_fprintf (asm_out_file, "\tmov\t%r, %r\n", next_hi_reg,
regno);
for (next_hi_reg++; next_hi_reg < 13; next_hi_reg++)
for (next_hi_reg--; next_hi_reg > LAST_LO_REGNUM;
next_hi_reg--)
if (live_regs_mask & (1 << next_hi_reg))
break;
}
@@ -25354,10 +25432,20 @@ thumb1_expand_prologue (void)
break;
/* Here we need to mask out registers used for passing arguments
even if they can be pushed. This is to avoid using them to stash the high
registers. Such kind of stash may clobber the use of arguments. */
even if they can be pushed. This is to avoid using them to
stash the high registers. Such kind of stash may clobber the
use of arguments. */
pushable_regs = l_mask & (~arg_regs_mask);
if (lr_needs_saving)
pushable_regs |= thumb1_prologue_unused_call_clobbered_lo_regs ();
/* Normally, LR can be used as a scratch register once it has been
saved; but if the function examines its own return address then
the value is still live and we need to avoid using it. */
bool return_addr_live
= REGNO_REG_SET_P (df_get_live_out (ENTRY_BLOCK_PTR_FOR_FN (cfun)),
LR_REGNUM);
if (lr_needs_saving || return_addr_live)
pushable_regs &= ~(1 << LR_REGNUM);
if (pushable_regs == 0)
@@ -25398,6 +25486,11 @@ thumb1_expand_prologue (void)
push_mask |= 1 << LR_REGNUM;
real_regs_mask |= 1 << LR_REGNUM;
lr_needs_saving = false;
/* If the return address is not live at this point, we
can add LR to the list of registers that we can use
for pushes. */
if (!return_addr_live)
pushable_regs |= 1 << LR_REGNUM;
}
insn = thumb1_emit_multi_reg_push (push_mask, real_regs_mask);
@@ -26782,14 +26875,41 @@ arm_thumb1_mi_thunk (FILE *file, tree, HOST_WIDE_INT delta,
/* push r3 so we can use it as a temporary. */
/* TODO: Omit this save if r3 is not used. */
fputs ("\tpush {r3}\n", file);
fputs ("\tldr\tr3, ", file);
/* With -mpure-code, we cannot load the address from the
constant pool: we build it explicitly. */
if (target_pure_code)
{
fputs ("\tmovs\tr3, #:upper8_15:#", file);
assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
fputc ('\n', file);
fputs ("\tlsls r3, #8\n", file);
fputs ("\tadds\tr3, #:upper0_7:#", file);
assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
fputc ('\n', file);
fputs ("\tlsls r3, #8\n", file);
fputs ("\tadds\tr3, #:lower8_15:#", file);
assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
fputc ('\n', file);
fputs ("\tlsls r3, #8\n", file);
fputs ("\tadds\tr3, #:lower0_7:#", file);
assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
fputc ('\n', file);
}
else
fputs ("\tldr\tr3, ", file);
}
else
{
fputs ("\tldr\tr12, ", file);
}
assemble_name (file, label);
fputc ('\n', file);
if (!target_pure_code)
{
assemble_name (file, label);
fputc ('\n', file);
}
if (flag_pic)
{
/* If we are generating PIC, the ldr instruction below loads
+5 -3
View File
@@ -1854,9 +1854,11 @@ enum arm_auto_incmodes
for the index in the tablejump instruction. */
#define CASE_VECTOR_MODE Pmode
#define CASE_VECTOR_PC_RELATIVE (TARGET_THUMB2 \
|| (TARGET_THUMB1 \
&& (optimize_size || flag_pic)))
#define CASE_VECTOR_PC_RELATIVE ((TARGET_THUMB2 \
|| (TARGET_THUMB1 \
&& (optimize_size || flag_pic))) \
&& (!target_pure_code))
#define CASE_VECTOR_SHORTEN_MODE(min, max, body) \
(TARGET_THUMB1 \
+112 -81
View File
@@ -94,6 +94,11 @@
; an IT block in their expansion which is not a short IT.
(define_attr "enabled_for_short_it" "no,yes" (const_string "yes"))
; Mark an instruction sequence as the required way of loading a
; constant when -mpure-code is enabled (which implies
; arm_disable_literal_pool)
(define_attr "required_for_purecode" "no,yes" (const_string "no"))
;; Operand number of an input operand that is shifted. Zero if the
;; given instruction does not shift one of its input operands.
(define_attr "shift" "" (const_int 0))
@@ -237,6 +242,10 @@
(match_test "arm_restrict_it"))
(const_string "no")
(and (eq_attr "required_for_purecode" "yes")
(not (match_test "arm_disable_literal_pool")))
(const_string "no")
(eq_attr "arch_enabled" "no")
(const_string "no")]
(const_string "yes")))
@@ -1110,7 +1119,7 @@
(parallel [(set (reg:CC CC_REGNUM)
(compare:CC (match_dup 4) (match_dup 5)))
(set (match_dup 3) (minus:SI (minus:SI (match_dup 4) (match_dup 5))
(ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))])]
(ltu:SI (reg:CC CC_REGNUM) (const_int 0))))])]
{
operands[3] = gen_highpart (SImode, operands[0]);
operands[0] = gen_lowpart (SImode, operands[0]);
@@ -1141,7 +1150,7 @@
[(set (match_operand:SI 0 "s_register_operand" "=r,r,r")
(minus:SI (minus:SI (match_operand:SI 1 "reg_or_int_operand" "r,I,Pz")
(match_operand:SI 2 "s_register_operand" "r,r,r"))
(ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
(match_operand:SI 3 "arm_borrow_operation" "")))]
"TARGET_32BIT"
"@
sbc%?\\t%0, %1, %2
@@ -1155,9 +1164,10 @@
(define_insn "*subsi3_carryin_const"
[(set (match_operand:SI 0 "s_register_operand" "=r")
(minus:SI (plus:SI (match_operand:SI 1 "s_register_operand" "r")
(match_operand:SI 2 "arm_neg_immediate_operand" "L"))
(ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
(minus:SI (plus:SI
(match_operand:SI 1 "s_register_operand" "r")
(match_operand:SI 2 "arm_neg_immediate_operand" "L"))
(match_operand:SI 3 "arm_borrow_operation" "")))]
"TARGET_32BIT"
"sbc\\t%0, %1, #%n2"
[(set_attr "conds" "use")
@@ -1166,8 +1176,8 @@
(define_insn "*subsi3_carryin_const0"
[(set (match_operand:SI 0 "s_register_operand" "=r")
(minus:SI (match_operand:SI 1 "s_register_operand" "r")
(ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
(minus:SI (match_operand:SI 1 "s_register_operand" "r")
(match_operand:SI 2 "arm_borrow_operation" "")))]
"TARGET_32BIT"
"sbc\\t%0, %1, #0"
[(set_attr "conds" "use")
@@ -1176,12 +1186,11 @@
(define_insn "*subsi3_carryin_compare"
[(set (reg:CC CC_REGNUM)
(compare:CC (match_operand:SI 1 "s_register_operand" "r")
(match_operand:SI 2 "s_register_operand" "r")))
(compare:CC (match_operand:SI 1 "s_register_operand" "r")
(match_operand:SI 2 "s_register_operand" "r")))
(set (match_operand:SI 0 "s_register_operand" "=r")
(minus:SI (minus:SI (match_dup 1)
(match_dup 2))
(ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
(minus:SI (minus:SI (match_dup 1) (match_dup 2))
(match_operand:SI 3 "arm_borrow_operation" "")))]
"TARGET_32BIT"
"sbcs\\t%0, %1, %2"
[(set_attr "conds" "set")
@@ -1190,12 +1199,13 @@
(define_insn "*subsi3_carryin_compare_const"
[(set (reg:CC CC_REGNUM)
(compare:CC (match_operand:SI 1 "reg_or_int_operand" "r")
(match_operand:SI 2 "const_int_I_operand" "I")))
(compare:CC (match_operand:SI 1 "reg_or_int_operand" "r")
(match_operand:SI 2 "const_int_I_operand" "I")))
(set (match_operand:SI 0 "s_register_operand" "=r")
(minus:SI (plus:SI (match_dup 1)
(match_operand:SI 3 "arm_neg_immediate_operand" "L"))
(ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
(minus:SI (plus:SI
(match_dup 1)
(match_operand:SI 3 "arm_neg_immediate_operand" "L"))
(match_operand:SI 4 "arm_borrow_operation" "")))]
"TARGET_32BIT
&& (INTVAL (operands[2])
== trunc_int_for_mode (-INTVAL (operands[3]), SImode))"
@@ -1206,11 +1216,11 @@
(define_insn "*subsi3_carryin_compare_const0"
[(set (reg:CC CC_REGNUM)
(compare:CC (match_operand:SI 1 "reg_or_int_operand" "r")
(compare:CC (match_operand:SI 1 "reg_or_int_operand" "r")
(const_int 0)))
(set (match_operand:SI 0 "s_register_operand" "=r")
(minus:SI (match_dup 1)
(ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
(minus:SI (match_dup 1)
(match_operand:SI 2 "arm_borrow_operation" "")))]
"TARGET_32BIT"
"sbcs\\t%0, %1, #0"
[(set_attr "conds" "set")
@@ -1220,28 +1230,28 @@
(define_insn "*subsi3_carryin_shift"
[(set (match_operand:SI 0 "s_register_operand" "=r")
(minus:SI (minus:SI
(match_operand:SI 1 "s_register_operand" "r")
(match_operator:SI 2 "shift_operator"
[(match_operand:SI 3 "s_register_operand" "r")
(match_operand:SI 4 "reg_or_int_operand" "rM")]))
(ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
(match_operand:SI 1 "s_register_operand" "r")
(match_operator:SI 2 "shift_operator"
[(match_operand:SI 3 "s_register_operand" "r")
(match_operand:SI 4 "reg_or_int_operand" "rM")]))
(match_operand:SI 5 "arm_borrow_operation" "")))]
"TARGET_32BIT"
"sbc%?\\t%0, %1, %3%S2"
[(set_attr "conds" "use")
(set_attr "predicable" "yes")
(set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "")
(const_string "alu_shift_imm")
(const_string "alu_shift_reg")))]
(const_string "alu_shift_imm")
(const_string "alu_shift_reg")))]
)
(define_insn "*rsbsi3_carryin_shift"
[(set (match_operand:SI 0 "s_register_operand" "=r")
(minus:SI (minus:SI
(match_operator:SI 2 "shift_operator"
[(match_operand:SI 3 "s_register_operand" "r")
(match_operand:SI 4 "reg_or_int_operand" "rM")])
(match_operator:SI 2 "shift_operator"
[(match_operand:SI 3 "s_register_operand" "r")
(match_operand:SI 4 "reg_or_int_operand" "rM")])
(match_operand:SI 1 "s_register_operand" "r"))
(ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
(match_operand:SI 5 "arm_borrow_operation" "")))]
"TARGET_ARM"
"rsc%?\\t%0, %1, %3%S2"
[(set_attr "conds" "use")
@@ -1311,7 +1321,7 @@
(compare:CC (match_dup 1) (match_dup 2)))
(set (match_dup 0) (minus:SI (match_dup 1) (match_dup 2)))])
(set (match_dup 3) (minus:SI (minus:SI (match_dup 4) (match_dup 5))
(ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
(ltu:SI (reg:CC CC_REGNUM) (const_int 0))))]
{
operands[3] = gen_highpart (SImode, operands[0]);
operands[0] = gen_lowpart (SImode, operands[0]);
@@ -1338,7 +1348,7 @@
(compare:CC (match_dup 1) (match_dup 2)))
(set (match_dup 0) (minus:SI (match_dup 1) (match_dup 2)))])
(set (match_dup 3) (minus:SI (match_dup 4)
(ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
(ltu:SI (reg:CC CC_REGNUM) (const_int 0))))]
{
operands[3] = gen_highpart (SImode, operands[0]);
operands[0] = gen_lowpart (SImode, operands[0]);
@@ -1365,7 +1375,7 @@
(set (match_dup 3) (minus:SI (minus:SI (match_dup 4)
(ashiftrt:SI (match_dup 2)
(const_int 31)))
(ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
(ltu:SI (reg:CC CC_REGNUM) (const_int 0))))]
{
operands[3] = gen_highpart (SImode, operands[0]);
operands[0] = gen_lowpart (SImode, operands[0]);
@@ -1392,7 +1402,7 @@
(compare:CC (match_dup 2) (match_dup 1)))
(set (match_dup 0) (minus:SI (match_dup 2) (match_dup 1)))])
(set (match_dup 3) (minus:SI (minus:SI (const_int 0) (match_dup 4))
(ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
(ltu:SI (reg:CC CC_REGNUM) (const_int 0))))]
{
operands[3] = gen_highpart (SImode, operands[0]);
operands[0] = gen_lowpart (SImode, operands[0]);
@@ -1422,7 +1432,7 @@
(ashiftrt:SI (match_dup 2)
(const_int 31))
(match_dup 4))
(ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
(ltu:SI (reg:CC CC_REGNUM) (const_int 0))))]
{
operands[3] = gen_highpart (SImode, operands[0]);
operands[0] = gen_lowpart (SImode, operands[0]);
@@ -1448,7 +1458,7 @@
(compare:CC (match_dup 1) (match_dup 2)))
(set (match_dup 0) (minus:SI (match_dup 1) (match_dup 2)))])
(set (match_dup 3) (minus:SI (minus:SI (match_dup 1) (match_dup 1))
(ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
(ltu:SI (reg:CC CC_REGNUM) (const_int 0))))]
{
operands[3] = gen_highpart (SImode, operands[0]);
operands[0] = gen_lowpart (SImode, operands[0]);
@@ -4483,62 +4493,78 @@
; ARMv6+ unaligned load/store instructions (used for packed structure accesses).
(define_insn "unaligned_loadsi"
[(set (match_operand:SI 0 "s_register_operand" "=l,r")
(unspec:SI [(match_operand:SI 1 "memory_operand" "Uw,m")]
[(set (match_operand:SI 0 "s_register_operand" "=l,l,r")
(unspec:SI [(match_operand:SI 1 "memory_operand" "m,Uw,m")]
UNSPEC_UNALIGNED_LOAD))]
"unaligned_access"
"ldr%?\t%0, %1\t@ unaligned"
[(set_attr "arch" "t2,any")
(set_attr "length" "2,4")
(set_attr "predicable" "yes")
(set_attr "predicable_short_it" "yes,no")
"@
ldr\t%0, %1\t@ unaligned
ldr%?\t%0, %1\t@ unaligned
ldr%?\t%0, %1\t@ unaligned"
[(set_attr "arch" "t1,t2,32")
(set_attr "length" "2,2,4")
(set_attr "predicable" "no,yes,yes")
(set_attr "predicable_short_it" "no,yes,no")
(set_attr "type" "load_4")])
;; The 16-bit Thumb1 variant of ldrsh requires two registers in the
;; address (there's no immediate format). That's tricky to support
;; here and we don't really need this pattern for that case, so only
;; enable for 32-bit ISAs.
(define_insn "unaligned_loadhis"
[(set (match_operand:SI 0 "s_register_operand" "=r")
(sign_extend:SI
(unspec:HI [(match_operand:HI 1 "memory_operand" "Uh")]
UNSPEC_UNALIGNED_LOAD)))]
"unaligned_access"
"unaligned_access && TARGET_32BIT"
"ldrsh%?\t%0, %1\t@ unaligned"
[(set_attr "predicable" "yes")
(set_attr "type" "load_byte")])
(define_insn "unaligned_loadhiu"
[(set (match_operand:SI 0 "s_register_operand" "=l,r")
[(set (match_operand:SI 0 "s_register_operand" "=l,l,r")
(zero_extend:SI
(unspec:HI [(match_operand:HI 1 "memory_operand" "Uw,m")]
(unspec:HI [(match_operand:HI 1 "memory_operand" "m,Uw,m")]
UNSPEC_UNALIGNED_LOAD)))]
"unaligned_access"
"ldrh%?\t%0, %1\t@ unaligned"
[(set_attr "arch" "t2,any")
(set_attr "length" "2,4")
(set_attr "predicable" "yes")
(set_attr "predicable_short_it" "yes,no")
"@
ldrh\t%0, %1\t@ unaligned
ldrh%?\t%0, %1\t@ unaligned
ldrh%?\t%0, %1\t@ unaligned"
[(set_attr "arch" "t1,t2,32")
(set_attr "length" "2,2,4")
(set_attr "predicable" "no,yes,yes")
(set_attr "predicable_short_it" "no,yes,no")
(set_attr "type" "load_byte")])
(define_insn "unaligned_storesi"
[(set (match_operand:SI 0 "memory_operand" "=Uw,m")
(unspec:SI [(match_operand:SI 1 "s_register_operand" "l,r")]
[(set (match_operand:SI 0 "memory_operand" "=m,Uw,m")
(unspec:SI [(match_operand:SI 1 "s_register_operand" "l,l,r")]
UNSPEC_UNALIGNED_STORE))]
"unaligned_access"
"str%?\t%1, %0\t@ unaligned"
[(set_attr "arch" "t2,any")
(set_attr "length" "2,4")
(set_attr "predicable" "yes")
(set_attr "predicable_short_it" "yes,no")
"@
str\t%1, %0\t@ unaligned
str%?\t%1, %0\t@ unaligned
str%?\t%1, %0\t@ unaligned"
[(set_attr "arch" "t1,t2,32")
(set_attr "length" "2,2,4")
(set_attr "predicable" "no,yes,yes")
(set_attr "predicable_short_it" "no,yes,no")
(set_attr "type" "store_4")])
(define_insn "unaligned_storehi"
[(set (match_operand:HI 0 "memory_operand" "=Uw,m")
(unspec:HI [(match_operand:HI 1 "s_register_operand" "l,r")]
[(set (match_operand:HI 0 "memory_operand" "=m,Uw,m")
(unspec:HI [(match_operand:HI 1 "s_register_operand" "l,l,r")]
UNSPEC_UNALIGNED_STORE))]
"unaligned_access"
"strh%?\t%1, %0\t@ unaligned"
[(set_attr "arch" "t2,any")
(set_attr "length" "2,4")
(set_attr "predicable" "yes")
(set_attr "predicable_short_it" "yes,no")
"@
strh\t%1, %0\t@ unaligned
strh%?\t%1, %0\t@ unaligned
strh%?\t%1, %0\t@ unaligned"
[(set_attr "arch" "t1,t2,32")
(set_attr "length" "2,2,4")
(set_attr "predicable" "no,yes,yes")
(set_attr "predicable_short_it" "no,yes,no")
(set_attr "type" "store_4")])
@@ -4645,7 +4671,7 @@
(set (match_dup 2)
(minus:SI
(minus:SI (const_int 0) (match_dup 3))
(ltu:SI (reg:CC_C CC_REGNUM)
(ltu:SI (reg:CC CC_REGNUM)
(const_int 0))))])]
{
operands[2] = gen_highpart (SImode, operands[0]);
@@ -4687,7 +4713,7 @@
(compare:CC (const_int 0) (match_dup 1)))
(set (match_dup 0) (minus:SI (const_int 0) (match_dup 1)))])
(set (match_dup 2) (minus:SI (minus:SI (const_int 0) (match_dup 3))
(ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
(ltu:SI (reg:CC CC_REGNUM) (const_int 0))))]
{
operands[2] = gen_highpart (SImode, operands[0]);
operands[0] = gen_lowpart (SImode, operands[0]);
@@ -4706,7 +4732,7 @@
(set (match_operand:SI 0 "s_register_operand" "=r")
(minus:SI (minus:SI (const_int 0)
(match_dup 1))
(ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
(match_operand:SI 2 "arm_borrow_operation" "")))]
"TARGET_ARM"
"rscs\\t%0, %1, #0"
[(set_attr "conds" "set")
@@ -4783,7 +4809,7 @@
asr Rhi, Rin, #31
rsbs Rlo, Rin, #0
rsc Rhi, Rhi, #0 (thumb2: sbc Rhi, Rhi, Rhi, lsl #1). */
rtx cc_reg = gen_rtx_REG (CC_Cmode, CC_REGNUM);
rtx cc_reg = gen_rtx_REG (CCmode, CC_REGNUM);
emit_insn (gen_rtx_SET (high,
gen_rtx_ASHIFTRT (SImode, operands[1],
@@ -4845,10 +4871,10 @@
;; since we just need to propagate the carry.
"&& reload_completed"
[(parallel [(set (reg:CC CC_REGNUM)
(compare:CC (const_int 0) (match_dup 1)))
(set (match_dup 0) (minus:SI (const_int 0) (match_dup 1)))])
(compare:CC (const_int 0) (match_dup 1)))
(set (match_dup 0) (minus:SI (const_int 0) (match_dup 1)))])
(set (match_dup 2) (minus:SI (minus:SI (match_dup 2) (match_dup 2))
(ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))]
(ltu:SI (reg:CC CC_REGNUM) (const_int 0))))]
{
operands[2] = gen_highpart (SImode, operands[0]);
operands[0] = gen_lowpart (SImode, operands[0]);
@@ -6336,16 +6362,21 @@
(define_insn "*movsi_compare0"
[(set (reg:CC CC_REGNUM)
(compare:CC (match_operand:SI 1 "s_register_operand" "0,r")
(compare:CC (match_operand:SI 1 "s_register_operand" "0,0,l,rk,rk")
(const_int 0)))
(set (match_operand:SI 0 "s_register_operand" "=r,r")
(set (match_operand:SI 0 "s_register_operand" "=l,rk,l,r,rk")
(match_dup 1))]
"TARGET_32BIT"
"@
cmp%?\\t%0, #0
cmp%?\\t%0, #0
subs%?\\t%0, %1, #0
subs%?\\t%0, %1, #0
subs%?\\t%0, %1, #0"
[(set_attr "conds" "set")
(set_attr "type" "alus_imm,alus_imm")]
(set_attr "arch" "t2,*,t2,t2,a")
(set_attr "type" "alus_imm")
(set_attr "length" "2,4,2,4,4")]
)
;; Subroutine to store a half word from a register into memory.
@@ -7429,12 +7460,12 @@
"#" ; "cmp\\t%Q0, %Q1\;sbcs\\t%2, %R0, %R1"
"&& reload_completed"
[(set (reg:CC CC_REGNUM)
(compare:CC (match_dup 0) (match_dup 1)))
(compare:CC (match_dup 0) (match_dup 1)))
(parallel [(set (reg:CC CC_REGNUM)
(compare:CC (match_dup 3) (match_dup 4)))
(set (match_dup 2)
(minus:SI (match_dup 5)
(ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))))])]
(compare:CC (match_dup 3) (match_dup 4)))
(set (match_dup 2)
(minus:SI (match_dup 5)
(ltu:SI (reg:CC CC_REGNUM) (const_int 0))))])]
{
operands[3] = gen_highpart (SImode, operands[0]);
operands[0] = gen_lowpart (SImode, operands[0]);
+3 -3
View File
@@ -82,7 +82,7 @@ mapcs-stack-check
Target Report Mask(APCS_STACK) Undocumented
march=
Target RejectNegative ToLower Joined Var(arm_arch_string)
Target RejectNegative Negative(march=) ToLower Joined Var(arm_arch_string)
Specify the name of the target architecture.
; Other arm_arch values are loaded from arm-tables.opt
@@ -107,7 +107,7 @@ Target Report Mask(CALLER_INTERWORKING)
Thumb: Assume function pointers may go to non-Thumb aware code.
mcpu=
Target RejectNegative ToLower Joined Var(arm_cpu_string)
Target RejectNegative Negative(mcpu=) ToLower Joined Var(arm_cpu_string)
Specify the name of the target CPU.
mfloat-abi=
@@ -232,7 +232,7 @@ Target Report Mask(TPCS_LEAF_FRAME)
Thumb: Generate (leaf) stack frames even if not needed.
mtune=
Target RejectNegative ToLower Joined Var(arm_tune_string)
Target RejectNegative Negative(mtune=) ToLower Joined Var(arm_tune_string)
Tune code for the given processor.
mprint-tune-info
+6 -2
View File
@@ -174,8 +174,12 @@ __arm_mrrc2 (const unsigned int __coproc, const unsigned int __opc1,
#endif /* (!__thumb__ || __thumb2__) && __ARM_ARCH >= 4. */
#pragma GCC push_options
#if __ARM_ARCH >= 8
#ifdef __ARM_FEATURE_CRC32
#ifdef __ARM_FP
#pragma GCC target ("arch=armv8-a+crc+simd")
#else
#pragma GCC target ("arch=armv8-a+crc")
#endif
__extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__crc32b (uint32_t __a, uint8_t __b)
@@ -235,7 +239,7 @@ __crc32cd (uint32_t __a, uint64_t __b)
}
#endif
#endif /* __ARM_ARCH >= 8. */
#endif /* __ARM_FEATURE_CRC32 */
#pragma GCC pop_options
#ifdef __cplusplus
+21
View File
@@ -358,6 +358,27 @@
(define_special_predicate "lt_ge_comparison_operator"
(match_code "lt,ge"))
;; Match a "borrow" operation for use with SBC. The precise code will
;; depend on the form of the comparison. This is generally the inverse of
;; a carry operation, since the logic of SBC uses "not borrow" in it's
;; calculation.
(define_special_predicate "arm_borrow_operation"
(match_code "geu,ltu")
{
if (XEXP (op, 1) != const0_rtx)
return false;
rtx op0 = XEXP (op, 0);
if (!REG_P (op0) || REGNO (op0) != CC_REGNUM)
return false;
machine_mode ccmode = GET_MODE (op0);
if (ccmode == CC_Cmode)
return GET_CODE (op) == GEU;
else if (ccmode == CCmode)
return GET_CODE (op) == LTU;
return false;
}
)
;; The vsel instruction only accepts the ARM condition codes listed below.
(define_special_predicate "arm_vsel_comparison_operator"
(and (match_operand 0 "expandable_comparison_operator")
+32 -9
View File
@@ -24,6 +24,8 @@
# values during the configure step. We enforce this during the
# top-level configury.
s-mlib: $(srcdir)/config/arm/t-multilib $(srcdir)/config/arm/t-aprofile $(srcdir)/config/arm/t-rmprofile
MULTILIB_OPTIONS =
MULTILIB_DIRNAMES =
MULTILIB_EXCEPTIONS =
@@ -63,6 +65,8 @@ all_early_arch := armv5tej armv6 armv6j armv6k armv6z armv6kz \
v7_a_arch_variants := $(call all_feat_combs, mp sec)
v7_a_nosimd_variants := +fp +vfpv3 +vfpv3-d16-fp16 +vfpv3-fp16 +vfpv4-d16 +vfpv4
v7_a_simd_variants := +simd +neon-fp16 +neon-vfpv4
v7_r_sp_variants := +fp.sp +fp.sp+idiv +vfpv3xd-fp16 +vfpv3xd-fp16+idiv
v7_r_dp_variants := +fp +fp+idiv +vfpv3-d16-fp16 +vfpv3-d16-fp16+idiv
v7ve_nosimd_variants := +vfpv3-d16 +vfpv3 +vfpv3-d16-fp16 +vfpv3-fp16 +fp +vfpv4
v7ve_vfpv3_simd_variants := +neon +neon-fp16
v7ve_vfpv4_simd_variants := +simd
@@ -86,8 +90,8 @@ SEP := $(and $(HAS_APROFILE),$(HAS_RMPROFILE),/)
MULTILIB_OPTIONS += marm/mthumb
MULTILIB_DIRNAMES += arm thumb
MULTILIB_OPTIONS += march=armv5te+fp/march=armv7/march=armv7+fp/$(MULTI_ARCH_OPTS_A)$(SEP)$(MULTI_ARCH_OPTS_RM)
MULTILIB_DIRNAMES += v5te v7 v7+fp $(MULTI_ARCH_DIRS_A) $(MULTI_ARCH_DIRS_RM)
MULTILIB_OPTIONS += march=armv5te+fp/march=armv7/march=armv7+fp/march=armv7-r+fp.sp/$(MULTI_ARCH_OPTS_A)$(SEP)$(MULTI_ARCH_OPTS_RM)
MULTILIB_DIRNAMES += v5te v7 v7+fp v7-r+fp.sp $(MULTI_ARCH_DIRS_A) $(MULTI_ARCH_DIRS_RM)
MULTILIB_OPTIONS += mfloat-abi=soft/mfloat-abi=softfp/mfloat-abi=hard
MULTILIB_DIRNAMES += nofp softfp hard
@@ -100,29 +104,47 @@ MULTILIB_REQUIRED += mthumb/march=armv7/mfloat-abi=soft
MULTILIB_REQUIRED += mthumb/march=armv7+fp/mfloat-abi=softfp
MULTILIB_REQUIRED += mthumb/march=armv7+fp/mfloat-abi=hard
# Map v7-r down onto common v7 code.
MULTILIB_REQUIRED += mthumb/march=armv7-r+fp.sp/mfloat-abi=softfp
MULTILIB_REQUIRED += mthumb/march=armv7-r+fp.sp/mfloat-abi=hard
# Map v7-r with double precision down onto common v7 code.
MULTILIB_MATCHES += march?armv7=march?armv7-r
MULTILIB_MATCHES += march?armv7=march?armv7-r+idiv
MULTILIB_MATCHES += march?armv7+fp=march?armv7-r+fp
MULTILIB_MATCHES += march?armv7+fp=march?armv7-r+fp+idiv
MULTILIB_MATCHES += $(foreach ARCH, $(v7_r_dp_variants), \
march?armv7+fp=march?armv7-r$(ARCH))
# Map v7-r single precision variants to v7-r with single precision.
MULTILIB_MATCHES += $(foreach ARCH, \
$(filter-out +fp.sp, $(v7_r_sp_variants)), \
march?armv7-r+fp.sp=march?armv7-r$(ARCH))
MULTILIB_MATCHES += $(foreach ARCH, $(all_early_arch), \
march?armv5te+fp=march?$(ARCH)+fp)
# Map v8-r down onto common v7 code.
# Map v8-r down onto common v7 code or v7-r sp.
MULTILIB_MATCHES += march?armv7=march?armv8-r
MULTILIB_MATCHES += $(foreach ARCH, $(v8_r_nosimd_variants), \
march?armv7=march?armv8-r$(ARCH))
MULTILIB_MATCHES += $(foreach ARCH,+simd +crypto, \
march?armv7+fp=march?armv8-r$(ARCH) \
march?armv7+fp=march?armv8-r+crc$(ARCH))
MULTILIB_MATCHES += march?armv7-r+fp.sp=march?armv8-r+fp.sp
MULTILIB_MATCHES += march?armv7-r+fp.sp=march?armv8-r+crc+fp.sp
ifeq (,$(HAS_APROFILE))
# Map all v7-a
MULTILIB_MATCHES += march?armv7=march?armv7-a
MULTILIB_MATCHES += $(foreach ARCH, $(v7_a_arch_variants), \
march?armv7=march?armv7-a$(ARCH))
MULTILIB_MATCHES += $(foreach ARCH, $(v7_a_nosimd_variants) $(v7_a_simd_variants), \
march?armv7+fp=march?armv7-a$(ARCH))
MULTILIB_MATCHES += $(foreach ARCHVAR, $(v7_a_arch_variants), \
$(foreach ARCH, $(v7_a_nosimd_variants) $(v7_a_simd_variants), \
march?armv7+fp=march?armv7-a$(ARCHVAR)$(ARCH)))
MULTILIB_MATCHES += march?armv7=march?armv7ve
# ARMv7ve FP/SIMD variants: map down to v7+fp
@@ -172,12 +194,14 @@ MULTILIB_MATCHES += march?armv7=march?armv8.5-a
MULTILIB_MATCHES += $(foreach ARCH, $(v8_5_a_simd_variants), \
march?armv7+fp=march?armv8.5-a$(ARCH))
endif # Not APROFILE.
# Use Thumb libraries for everything.
MULTILIB_REUSE += mthumb/march.armv7/mfloat-abi.soft=marm/march.armv7/mfloat-abi.soft
MULTILIB_REUSE += $(foreach ABI, hard softfp, \
$(foreach ARCH, armv7+fp, \
$(foreach ARCH, armv7+fp armv7-r+fp\.sp, \
mthumb/march.$(ARCH)/mfloat-abi.$(ABI)=marm/march.$(ARCH)/mfloat-abi.$(ABI)))
# Softfp but no FP, use the soft-float libraries.
@@ -185,4 +209,3 @@ MULTILIB_REUSE += $(foreach MODE, arm thumb, \
$(foreach ARCH, armv7, \
mthumb/march.$(ARCH)/mfloat-abi.soft=m$(MODE)/march.$(ARCH)/mfloat-abi.softfp))
endif # Not APROFILE.
+6 -5
View File
@@ -17,8 +17,8 @@ MULTILIB_DIRNAMES += eb
MULTILIB_OPTIONS += mthumb
MULTILIB_DIRNAMES += thumb
MULTILIB_OPTIONS += march=armv5te+fp/march=armv6-m/march=armv7-a/march=armv7-a+simd/march=armv7-r/march=armv7-r+fp/march=armv7-m/march=armv7e-m+fp/march=armv7e-m+fp.dp
MULTILIB_DIRNAMES += armv5te+fp armv6-m armv7-a armv7-a+simd armv7-r armv7-r+fp armv7-m armv7e-m+fp armv7e-m+fp.dp
MULTILIB_OPTIONS += march=armv5te+fp/march=armv6-m/march=armv7-a/march=armv7-a+simd/march=armv7-r/march=armv7-r+fp/mcpu=cortex-m3/mcpu=cortex-m4/mcpu=cortex-m4+nofp/mcpu=cortex-m7
MULTILIB_DIRNAMES += armv5te+fp armv6-m armv7-a armv7-a+simd armv7-r armv7-r+fp cortex-m3 cortex-m4 cortex-m4+nofp cortex-m7
MULTILIB_OPTIONS += mfloat-abi=hard
MULTILIB_DIRNAMES += hard
@@ -31,7 +31,8 @@ MULTILIB_REQUIRED += mthumb/march=armv7-a+simd/mfloat-abi=hard
MULTILIB_REQUIRED += mthumb/march=armv7-a
MULTILIB_REQUIRED += mthumb/march=armv7-r+fp/mfloat-abi=hard
MULTILIB_REQUIRED += mthumb/march=armv7-r
MULTILIB_REQUIRED += mthumb/march=armv7e-m+fp/mfloat-abi=hard
MULTILIB_REQUIRED += mthumb/march=armv7e-m+fp.dp/mfloat-abi=hard
MULTILIB_REQUIRED += mthumb/march=armv7-m
MULTILIB_REQUIRED += mthumb/mcpu=cortex-m3
MULTILIB_REQUIRED += mthumb/mcpu=cortex-m4/mfloat-abi=hard
MULTILIB_REQUIRED += mthumb/mcpu=cortex-m4+nofp
MULTILIB_REQUIRED += mthumb/mcpu=cortex-m7/mfloat-abi=hard
MULTILIB_REQUIRED += mthumb
+71 -14
View File
@@ -43,6 +43,41 @@
(define_insn "thumb1_movsi_symbol_ref"
[(set (match_operand:SI 0 "register_operand" "=l")
(match_operand:SI 1 "general_operand" ""))
]
"TARGET_THUMB1
&& arm_disable_literal_pool
&& GET_CODE (operands[1]) == SYMBOL_REF"
"*
output_asm_insn (\"movs\\t%0, #:upper8_15:%1\", operands);
output_asm_insn (\"lsls\\t%0, #8\", operands);
output_asm_insn (\"adds\\t%0, #:upper0_7:%1\", operands);
output_asm_insn (\"lsls\\t%0, #8\", operands);
output_asm_insn (\"adds\\t%0, #:lower8_15:%1\", operands);
output_asm_insn (\"lsls\\t%0, #8\", operands);
output_asm_insn (\"adds\\t%0, #:lower0_7:%1\", operands);
return \"\";
"
[(set_attr "length" "14")
(set_attr "conds" "clob")]
)
(define_split
[(set (match_operand:SI 0 "register_operand" "")
(match_operand:SI 1 "immediate_operand" ""))]
"TARGET_THUMB1
&& arm_disable_literal_pool
&& GET_CODE (operands[1]) == CONST_INT
&& !satisfies_constraint_I (operands[1])"
[(clobber (const_int 0))]
"
thumb1_gen_const_int (operands[0], INTVAL (operands[1]));
DONE;
"
)
(define_insn "*thumb1_adddi3"
[(set (match_operand:DI 0 "register_operand" "=l")
(plus:DI (match_operand:DI 1 "register_operand" "%0")
@@ -656,8 +691,8 @@
)
(define_insn "*thumb1_movsi_insn"
[(set (match_operand:SI 0 "nonimmediate_operand" "=l,l,r,l,l,l,>,l, m,*l*h*k")
(match_operand:SI 1 "general_operand" "l, I,j,J,K,>,l,mi,l,*l*h*k"))]
[(set (match_operand:SI 0 "nonimmediate_operand" "=l,l,r,l,l,l,>,l, l, m,*l*h*k")
(match_operand:SI 1 "general_operand" "l, I,j,J,K,>,l,i, mi,l,*l*h*k"))]
"TARGET_THUMB1
&& ( register_operand (operands[0], SImode)
|| register_operand (operands[1], SImode))"
@@ -669,14 +704,16 @@
#
ldmia\\t%1, {%0}
stmia\\t%0, {%1}
movs\\t%0, #:upper8_15:%1; lsls\\t%0, #8; adds\\t%0, #:upper0_7:%1; lsls\\t%0, #8; adds\\t%0, #:lower8_15:%1; lsls\\t%0, #8; adds\\t%0, #:lower0_7:%1
ldr\\t%0, %1
str\\t%1, %0
mov\\t%0, %1"
[(set_attr "length" "2,2,4,4,4,2,2,2,2,2")
(set_attr "type" "mov_reg,mov_imm,mov_imm,multiple,multiple,load_4,store_4,load_4,store_4,mov_reg")
(set_attr "pool_range" "*,*,*,*,*,*,*,1018,*,*")
(set_attr "arch" "t1,t1,v8mb,t1,t1,t1,t1,t1,t1,t1")
(set_attr "conds" "set,clob,nocond,*,*,nocond,nocond,nocond,nocond,nocond")])
[(set_attr "length" "2,2,4,4,4,2,2,14,2,2,2")
(set_attr "type" "mov_reg,mov_imm,mov_imm,multiple,multiple,load_4,store_4,alu_sreg,load_4,store_4,mov_reg")
(set_attr "pool_range" "*,*,*,*,*,*,*, *,1018,*,*")
(set_attr "arch" "t1,t1,v8mb,t1,t1,t1,t1,t1,t1,t1,t1")
(set_attr "required_for_purecode" "no,no,no,no,no,no,no,yes,no,no,no")
(set_attr "conds" "set,clob,nocond,*,*,nocond,nocond,nocond,nocond,nocond,nocond")])
; Split the load of 64-bit constant into two loads for high and low 32-bit parts respectively
; to see if we can load them in fewer instructions or fewer cycles.
@@ -829,8 +866,8 @@
(set_attr "conds" "clob,nocond,nocond,nocond,nocond,clob")])
(define_insn "*thumb1_movhf"
[(set (match_operand:HF 0 "nonimmediate_operand" "=l,l,m,*r,*h")
(match_operand:HF 1 "general_operand" "l,mF,l,*h,*r"))]
[(set (match_operand:HF 0 "nonimmediate_operand" "=l,l,l,m,*r,*h")
(match_operand:HF 1 "general_operand" "l, m,F,l,*h,*r"))]
"TARGET_THUMB1
&& ( s_register_operand (operands[0], HFmode)
|| s_register_operand (operands[1], HFmode))"
@@ -855,14 +892,34 @@
}
return \"ldrh\\t%0, %1\";
}
case 2: return \"strh\\t%1, %0\";
case 2:
{
int bits;
int high;
rtx ops[3];
bits = real_to_target (NULL, CONST_DOUBLE_REAL_VALUE (operands[1]),
HFmode);
ops[0] = operands[0];
high = (bits >> 8) & 0xff;
ops[1] = GEN_INT (high);
ops[2] = GEN_INT (bits & 0xff);
if (high != 0)
output_asm_insn (\"movs\\t%0, %1\;lsls\\t%0, #8\;adds\\t%0, %2\", ops);
else
output_asm_insn (\"movs\\t%0, %2\", ops);
return \"\";
}
case 3: return \"strh\\t%1, %0\";
default: return \"mov\\t%0, %1\";
}
"
[(set_attr "length" "2")
(set_attr "type" "mov_reg,load_4,store_4,mov_reg,mov_reg")
(set_attr "pool_range" "*,1018,*,*,*")
(set_attr "conds" "clob,nocond,nocond,nocond,nocond")])
[(set_attr "length" "2,2,6,2,2,2")
(set_attr "type" "mov_reg,load_4,mov_reg,store_4,mov_reg,mov_reg")
(set_attr "pool_range" "*,1018,*,*,*,*")
(set_attr "conds" "clob,nocond,nocond,nocond,nocond,nocond")])
;;; ??? This should have alternatives for constants.
(define_insn "*thumb1_movsf_insn"
[(set (match_operand:SF 0 "nonimmediate_operand" "=l,l,>,l, m,*r,*h")

Some files were not shown because too many files have changed in this diff Show More