Commit Graph

185235 Commits

Author SHA1 Message Date
Jonathan Wakely
e3b6d3a887 libstdc++: Allow lualatex to be used for Doxygen PDF
This allows the Doxygen PDF to be built using lualatex instead of
pdflatex, which solves a problem with pdflatex running out of memory
sometimes. This is done by adding a --latex_cmd option to the
run_doxygen script, which then sets the specified command in the
generated user.cfg file used by Doxygen. The makefile is adjusted to
pass --latex_cmd=$(LATEX_CMD) to the script, so using running make with
LATEX_CMD=lualatex will override the default.

Additionally, this does some refactoring of the doc/Makefile.am rules
and the run_doxygen script.

libstdc++-v3/ChangeLog:

	* doc/Makefile.am: Simplify doxygen recipes and use --latex_cmd.
	* doc/Makefile.in: Regenerate.
	* doc/doxygen/user.cfg.in (LATEX_CMD_NAME): Add placeholder
	value.
	* scripts/run_doxygen (print_usage): Always print to stdout and
	do not exit.
	(fail): New function for exiting on error.
	(parse_options): Handle --latex_cmd. Do not treat --help the
	same as errors. Simplify handling of required arguments.
2021-05-17 12:13:41 +01:00
Joern Rennecke
a8e19fa419 Avoid outputting corrupt string constructor when host/target chars mismatch.
* c-common.c (braced_list_to_string): Return CTOR unchanged
	if host and target character sizes don't match.
2021-05-17 11:20:03 +01:00
Martin Liska
3cbcb5d0cf LTO: merge -flto=foo both from IL and linker cmdline
gcc/ChangeLog:

	* lto-wrapper.c (merge_flto_options): Factor out a new function.
	(merge_and_complain): Use it.
	(run_gcc): Merge also linker command line -flto=foo argument
	with IL files.
2021-05-17 11:46:05 +02:00
Christophe Lyon
b050cf6a4d testsuite: Require openmp effective-target for PR100515
The related test uses -fopenmp, which is not supported by newlib-based
targets such as arm-eabi or aarch64-elf.

Requiring the openmp effective-target makes the test unsupported
rather than failed.

2021-05-17  Christophe Lyon  <christophe.lyon@linaro.org>

	PR debug/100515
	gcc/testsuite
	* gcc.dg/debug/dwarf2/pr100515.c: Require openmp effective-target.
2021-05-17 09:29:05 +00:00
Richard Biener
2ec80a3457 Update mpfr version to 3.1.6
This updates the mpfr version to 3.1.6 which is the last bugfix
release from the 3.1.x series and avoids printing the version
is buggy but acceptable from our configury.

2021-05-17  Richard Biener  <rguenther@suse.de>

contrib/ChangeLog:
	* download_prerequisites: Update mpfr version to 3.1.6.
	* prerequisites.md5: Update.
	* prerequisites.sha512: Likewise.
2021-05-17 08:56:28 +02:00
Richard Biener
52a812098a Revert "download_prerequisites: update MPFR version to recommended"
This reverts commit fe108dad32.
2021-05-17 08:52:51 +02:00
GCC Administrator
1dfb5d8ab5 Daily bump. 2021-05-17 00:16:31 +00:00
David Edelsohn
e49ff61d41 testsuite: Silence psabi warning
* g++.dg/ext/attrib63.C: Add -Wno-psabi option.
2021-05-16 19:22:12 -04:00
David Edelsohn
2fa3e5740b testsuite: Require fsanitize support on the target.
* g++.dg/warn/uninit-pr93100.C: Require fsantize support.
2021-05-16 19:17:10 -04:00
Christophe Lyon
4a322345ca arm: remove error in CPP_SPEC when -mlittle-endian and -mbig-endian are used together
arm.h has had this error message since 1997, but it is no longer
needed since option parsing has been improved: -mXXX-endian is handled
via arm.opt and updates the BIG_END mask. So, the last
instance of -mXXX-endian on the command line wins.

Tested on many arm* configurations, with no impact on the testsuite results.

2021-05-16  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/
	* config/arm/arm.h (CPP_SPEC): Remove error message about
	-mlittle-endian/-mbig-endian conflict.
2021-05-16 13:48:21 +00:00
Christophe Lyon
f1146b50e8 testsuite/arm: Improve unsigned-float.c
The test requires an FPU, so use -march=armv7-a+fp -mfpu=auto instead
of -march=armv7-a.

We also remove dg-require-effective-target arm_fp_ok, but keep
dg-add-options arm_fp: this enables the test to pass on arm-eabi
configured with default cpu/fpu/mode.

dg-require-effective-target arm_fp_ok fails on such a configuration
for lack of FPU, since dg-options are not taken into account by
dg-require-effective-target.

Add -march=armv7-a+fp -mfpu=auto is sufficient for arm_fp options to
be acceptable.

This enables the test to pass on all the arm-eabi configurations I'm
testing, as well as arm-linux-gnueabi when forcing -march=armv5t.

2021-05-16  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/testsuite/
	* gcc.target/arm/unsigned-float.c: Remove arm_fp_ok, adjust
	dg-options.
2021-05-16 13:46:06 +00:00
GCC Administrator
1ba3f0ef54 Daily bump. 2021-05-16 00:16:37 +00:00
Bill Schmidt
5bd66c6826 rs6000: Add ROP tests
2021-05-13  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/testsuite/
	* gcc.target/powerpc/rop-1.c: New.
	* gcc.target/powerpc/rop-2.c: New.
	* gcc.target/powerpc/rop-3.c: New.
	* gcc.target/powerpc/rop-4.c: New.
	* gcc.target/powerpc/rop-5.c: New.
2021-05-15 14:05:12 -05:00
Bill Schmidt
3ec3a9feb8 rs6000: Conditionally define __ROP_PROTECT__
2021-05-13  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
	* config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Define
	__ROP_PROTECT__ if -mrop-protect is selected.
2021-05-15 14:05:05 -05:00
Bill Schmidt
af979a98bc rs6000: Emit ROP-mitigation instructions in prologue and epilogue
2021-05-14  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
	* config/rs6000/rs6000-internal.h (rs6000_stack): Add
	rop_hash_save_offset and rop_hash_size.
	* config/rs6000/rs6000-logue.c (rs6000_stack_info): Compute
	rop_hash_size and rop_hash_save_offset.
	(debug_stack_info): Dump rop_hash_save_offset and rop_hash_size.
	(rs6000_emit_prologue): Emit hashst[p] in prologue.
	(rs6000_emit_epilogue): Emit hashchk[p] in epilogue.
	* config/rs6000/rs6000.md (unspec): Add UNSPEC_HASHST and
	UNSPEC_HASHCHK.
	(hashst): New define_insn.
	(hashchk): Likewise.
2021-05-15 14:04:56 -05:00
Bill Schmidt
0df864ed1d rs6000: Add -mrop-protect and -mprivileged flags
2021-05-14  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
	* config/rs6000/rs6000.c (rs6000_option_override_internal):
	Disable shrink wrap when inserting ROP-protect instructions.
	* config/rs6000/rs6000.opt (mrop-protect): New option.
	(mprivileged): Likewise.
	* doc/invoke.texi: Document mrop-protect and mprivileged.
2021-05-15 14:04:44 -05:00
Hans-Peter Nilsson
57d2342fbb reorg.c (fill_slots_from_thread): Reinstate code typoed out in "Remove CC0".
The typo here, is obviously mistaken removal of lines next
to a line that was validly removed.  Targets affected are
those with a delay-slot *and* defining TARGET_FLAGS_REGNUM.
In-tree, a git-grep says the only ones matching are CRIS,
h8300 and visium.  The code removal has the effect of
wrong-code, not reverting the effect of r11-2814.

I'm "guessing" it was the effect of an incorrect conflict
resolution in preparatory work for the r12-440 /
bd1cd0d0e0 / "Remove CC0" commit, when rebasing a related
branch, and not testing any of the affected targets.  Either
way, the effect was a btest-gcc.sh state of "regress-1152"
for cris-elf.  FWIW, I wrote the removed code (sans the
validly removed cc0 line), a part of what was committed at
2020-08-24 as 0e6c51de8e / r11-2814.

This commit gets cris-elf test-results back to a sane state
(tested at 0ffdbc85d9 / r12-761).

gcc:
	* reorg.c (fill_slots_from_thread): Reinstate code typoed out in
	"Remove CC0".
2021-05-15 20:34:01 +02:00
Martin Jambor
af42043e66 Revert "tree-sra: Avoid refreshing into const base decls (PR 100453)"
This reverts commit ca9bb74a5f.
...because of Ada issues I did not catch with original testing.

gcc/ChangeLog:

2021-05-12  Martin Jambor  <mjambor@suse.cz>

	Revert:
        PR tree-optimization/100453
	* tree-sra.c (sra_modify_assign): All const base accesses do not
	need refreshing, not just those from decl_pool.
	(sra_modify_assign): Do not refresh into a const base decl.

gcc/testsuite/ChangeLog:

2021-05-12  Martin Jambor  <mjambor@suse.cz>

	Revert:
        PR tree-optimization/100453
	* gcc.dg/tree-ssa/pr100453.c: New test.
2021-05-15 10:21:47 +02:00
Jakub Jelinek
425ad87dcf regcprop: Fix another cprop_hardreg bug [PR100342]
On Tue, Jan 19, 2021 at 04:10:33PM +0000, Richard Sandiford via Gcc-patches wrote:
> Ah, ok, thanks for the extra context.
>
> So AIUI the problem when recording xmm2<-di isn't just:
>
>  [A] partial_subreg_p (vd->e[sr].mode, GET_MODE (src))
>
> but also that:
>
>  [B] partial_subreg_p (vd->e[sr].mode, vd->e[vd->e[sr].oldest_regno].mode)
>
> For example, all registers in this sequence can be part of the same chain:
>
>     (set (reg:HI R1) (reg:HI R0))
>     (set (reg:SI R2) (reg:SI R1)) // [A]
>     (set (reg:DI R3) (reg:DI R2)) // [A]
>     (set (reg:SI R4) (reg:SI R[0-3]))
>     (set (reg:HI R5) (reg:HI R[0-4]))
>
> But:
>
>     (set (reg:SI R1) (reg:SI R0))
>     (set (reg:HI R2) (reg:HI R1))
>     (set (reg:SI R3) (reg:SI R2)) // [A] && [B]
>
> is problematic because it dips below the precision of the oldest regno
> and then increases again.
>
> When this happens, I guess we have two choices:
>
> (1) what the patch does: treat R3 as the start of a new chain.
> (2) pretend that the copy occured in vd->e[sr].mode instead
>     (i.e. copy vd->e[sr].mode to vd->e[dr].mode)
>
> I guess (2) would need to be subject to REG_CAN_CHANGE_MODE_P.
> Maybe the optimisation provided by (2) compared to (1) isn't common
> enough to be worth the complication.
>
> I think we should test [B] as well as [A] though.  The pass is set
> up to do some quite elaborate mode changes and I think rejecting
> [A] on its own would make some of the other code redundant.
> It also feels like it should be a seperate “if” or “else if”,
> with its own comment.

Unfortunately, we now have a testcase that shows that testing also [B]
is a problem (unfortunately now latent on the trunk, only reproduces
on 10 and 11 branches).

The comment in the patch tries to list just the interesting instructions,
we have a 64-bit value, copy low 8 bit of those to another register,
copy full 64 bits to another register and then clobber the original register.
Before that (set (reg:DI r14) (const_int ...)) we have a chain
DI r14, QI si, DI bp , that instruction drops the DI r14 from that chain, so
we have QI si, DI bp , si being the oldest_regno.
Next DI si is copied into DI dx.  Only the low 8 bits of that are defined,
the rest is unspecified, but we would add DI dx into that same chain at the
end, so QI si, DI bp, DI dx [*].  Next si is overwritten, so the chain is
DI bp, DI dx.  And then we see (set (reg:DI dx) (reg:DI bp)) and remove it
as redundant, because we think bp and dx are already equivalent, when in
reality that is true only for the lowpart 8 bits.
I believe the [*] marked step above is where the bug is.

The committed regcprop.c (copy_value) change (but only committed to
trunk/11, not to 10) added
  else if (partial_subreg_p (vd->e[sr].mode, GET_MODE (src))
           && partial_subreg_p (vd->e[sr].mode,
                                vd->e[vd->e[sr].oldest_regno].mode))
    return;
and while the first partial_subreg_p call returns true, the second one
doesn't; before the (set (reg:DI r14) (const_int ...)) insn it would be
true and we'd return, but as that reg got clobbered, si became the oldest
regno in the chain and so vd->e[vd->e[sr].oldest_regno].mode is QImode
and vd->e[sr].mode is QImode too, so the second partial_subreg_p is false.
But as the testcase shows, what is the oldest_regno in the chain is
something that changes over time, so relying on it for anything is
problematic, something could have a different oldest_regno and later
on get a different oldest_regno (perhaps with different mode) because
the oldest_regno got overwritten and it can change both ways.

The following patch effectively implements your (2) above.

2021-05-15  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/100342
	* regcprop.c (copy_value): When copying a source reg in a wider
	mode than it has recorded for the value, adjust recorded destination
	mode too or punt if !REG_CAN_CHANGE_MODE_P.

	* gcc.target/i386/pr100342.c: New test.
2021-05-15 10:12:11 +02:00
GCC Administrator
87a7d10c2e Daily bump. 2021-05-15 00:16:27 +00:00
Tobias Burnus
0e3702f8da Fortran/OpenMP: Support 'omp parallel master'
gcc/fortran/ChangeLog:

	* dump-parse-tree.c (show_omp_node, show_code_node): Handle
	EXEC_OMP_PARALLEL_MASTER.
	* frontend-passes.c (gfc_code_walker): Likewise.
	* gfortran.h (enum gfc_statement): Add ST_OMP_PARALLEL_MASTER and
	ST_OMP_END_PARALLEL_MASTER.
	(enum gfc_exec_op): Add EXEC_OMP_PARALLEL_MASTER..
	* match.h (gfc_match_omp_parallel_master): Handle it.
	* openmp.c (gfc_match_omp_parallel_master, resolve_omp_clauses,
	omp_code_to_statement, gfc_resolve_omp_directive): Likewise.
	* parse.c (decode_omp_directive, case_exec_markers,
	gfc_ascii_statement, parse_omp_structured_block,
	parse_executable): Likewise.
	* resolve.c (gfc_resolve_blocks, gfc_resolve_code): Likewise.
	* st.c (gfc_free_statement): Likewise.
	* trans-openmp.c (gfc_trans_omp_parallel_master,
	gfc_trans_omp_workshare, gfc_trans_omp_directive): Likewise.
	* trans.c (trans_code): Likewise.

libgomp/ChangeLog:

	* testsuite/libgomp.fortran/parallel-master.f90: New test.

gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/parallel-master-1.f90: New test.
	* gfortran.dg/gomp/parallel-master-2.f90: New test.
2021-05-14 19:21:47 +02:00
Tobias Burnus
62e1bd651f Fortran/OpenMP: Handle implicit SAVE for variables in main
gcc/fortran/ChangeLog:

	* resolve.c (resolve_symbol): Handle implicit SAVE of main-program
	for vars in 'omp threadprivate' and 'omp declare target'.

gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/implicit-save.f90: New test.
2021-05-14 19:19:26 +02:00
Jason Merrill
2f1bb00ba3 c++: simplify enclosing_instantiation_of [PR95870]
Comparing DECL_SOURCE_LOCATION like the GCC 11 patch for PR 95870 will also
work for user-defined functions, if we update their location when
instantiating.  Another option would be to use LAMBDA_EXPR_REGEN_INFO for
lambdas, but this way is even simpler.

gcc/cp/ChangeLog:

	PR c++/95870
	* pt.c (enclosing_instantiation_of): Just compare
	DECL_SOURCE_LOCATION.
	(regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
2021-05-14 12:11:12 -04:00
Jason Merrill
1ff863ab01 intl: add comments to _, N_, and G_
gcc/ChangeLog:

	* intl.h: Add comments.
2021-05-14 12:11:12 -04:00
Kyrylo Tkachov
ff3809b459 aarch64: Make sqdmlal2 patterns match canonical RTL
The sqdmlal2 patterns are hidden beneath the SBINQOPS iterator and unfortunately they don't match
canonical RTL because the simple accumulate operand comes in the first arm of the SS_PLUS.
This patch splits the SS_PLUS and SS_MINUS forms with the SS_PLUS operands set up to match
the canonical form, where the complex operand comes first.

gcc/ChangeLog:

	* config/aarch64/aarch64-simd.md
	(aarch64_sqdml<SBINQOPS:as>l2_lane<mode>_internal): Split into...
	(aarch64_sqdmlsl2_lane<mode>_internal): ... This...
	(aarch64_sqdmlal2_lane<mode>_internal): ... And this.
	(aarch64_sqdml<SBINQOPS:as>l2_laneq<mode>_internal): Split into ...
	(aarch64_sqdmlsl2_laneq<mode>_internal): ... This...
	(aarch64_sqdmlal2_laneq<mode>_internal): ... And this.
	(aarch64_sqdml<SBINQOPS:as>l2_n<mode>_internal): Split into...
	(aarch64_sqdmlsl2_n<mode>_internal): ... This...
	(aarch64_sqdmlal2_n<mode>_internal): ... And this.
2021-05-14 15:31:25 +01:00
Jakub Jelinek
4206171605 testsuite: Add testcase for already fixed PR [PR95226]
2021-05-14  Jakub Jelinek  <jakub@redhat.com>

	PR c++/95226
	* g++.dg/cpp1y/pr95226.C: New test.
2021-05-14 16:29:49 +02:00
Jakub Jelinek
3cafe627d6 testsuite: Add testcase for already fixed PR [PR94616]
2021-05-14  Jakub Jelinek  <jakub@redhat.com>

	PR c++/94616
	* g++.dg/cpp0x/pr94616.C: New test.
2021-05-14 15:35:55 +02:00
Jakub Jelinek
d25809dbfe testsuite: Add testcase for already fixed PR [PR90019]
2021-05-14  Jakub Jelinek  <jakub@redhat.com>

	PR c++/90019
	* g++.dg/cpp0x/sfinae68.C: New test.
2021-05-14 14:56:28 +02:00
Bernd Edlinger
cb787efa45 Cleanup temp files in libphobos unittest at src/std/process.d
2021-05-14  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* src/std/process.d (unittest): Remove tmpname on exit.
	* src/MERGE: Merge upstream phobos 63f4caa90.
2021-05-14 14:21:36 +02:00
Jakub Jelinek
f05627d404 testsuite: Add testcase for already fixed PR [PR88872]
2021-05-14  Jakub Jelinek  <jakub@redhat.com>

	* g++.dg/cpp1y/pr88872.C: New test.
2021-05-14 13:24:12 +02:00
prathamesh.kulkarni
36ecd44bd2 arm/PR66791: Replace calls to vtst builtin with it's boolean logic equivalent.
gcc/ChangeLog:

2021-05-14  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	PR target/66791
	* config/arm/arm_neon.h (vtst_s8): Replace call to vtst builtin with it's
	boolean logic equivalent.
	(vtst_s16): Likewise.
	(vtst_s32): Likewise.
	(vtst_u8): Likewise.
	(vtst_u16): Likewise.
	(vtst_u32): Likewise.
	(vtst_p8): Likewise.
	(vtst_p16): Likewise.
	(vtstq_s8): Likewise.
	(vtstq_s16): Likewise.
	(vtstq_s32): Likewise.
	(vtstq_u8): Likewise.
	(vtstq_u16): Likewise.
	(vtstq_u32): Likewise.
	(vtstq_p8): Likewise.
	(vtstq_p16): Likewise.

	* config/arm/arm_neon_builtins.def: Remove entry for vtst.
	* config/arm/neon.md (neon_vtst<mode>): Remove pattern.
2021-05-14 16:04:36 +05:30
Martin Liska
4d0385dfe0 Fix my name in ChangeLog files. 2021-05-14 12:14:22 +02:00
Michael de Lang
80b4ce1a51 TSAN: add new test
gcc/testsuite/ChangeLog:

	* g++.dg/tsan/pthread_cond_clockwait.C: New test.
2021-05-14 12:09:58 +02:00
Martin Liska
fe108dad32 download_prerequisites: update MPFR version to recommended
contrib/ChangeLog:

	* download_prerequisites: Use version 4.1.0.
2021-05-14 12:01:08 +02:00
Martin Liska
40a2f88838 opts: add Warning keyword for 2 options
gcc/c-family/ChangeLog:

	* c.opt: Add Warning keyword for 2 options.
2021-05-14 11:42:44 +02:00
Jakub Jelinek
df18a1343d Closing of 8 branch.
2021-05-14  Jakub Jelinek  <jakub@redhat.com>

contrib/
	* gcc-changelog/git_update_version.py: Remove releases/gcc-8 from
	active_refs.
maintainer-scripts/
	* crontab: Stop doing gcc-8 snapshots.
2021-05-14 11:25:30 +02:00
Kyrylo Tkachov
543c0cbca0 aarch64: Merge sqdmlal2 and sqdmlsl2 expanders
The various sqdmlal2 and sqdmlsl2 expanders perform almost identical functions and can be
merged using code iterators and attributes to reduce the code in the MD file.
No behavioural change is expected.

gcc/ChangeLog:

	* config/aarch64/aarch64-simd.md (aarch64_sqdmlal2<mode>): Merge into...
	(aarch64_sqdml<SBINQOPS:as>l2<mode>): ... This.
	(aarch64_sqdmlsl2<mode>): Delete.
	(aarch64_sqdmlal2_lane<mode>): Merge this...
	(aarch64_sqdmlsl2_lane<mode>): ... And this...
	(aarch64_sqdml<SBINQOPS:as>l2_lane<mode>): ... Into this.
	(aarch64_sqdmlal2_laneq<mode>): Merge this...
	(aarch64_sqdmlsl2_laneq<mode>): ... And this...
	(aarch64_sqdml<SBINQOPS:as>l2_laneq<mode>): ... Into this.
	(aarch64_sqdmlal2_n<mode>): Merge this...
	(aarch64_sqdmlsl2_n<mode>): ... And this...
	(aarch64_sqdml<SBINQOPS:as>l2_n<mode>): ... Into this.
2021-05-14 09:56:45 +01:00
Martin Liska
3489257a33 Port gnat-style to Sphinx.
gcc/ada/ChangeLog:

	* doc/Makefile: Add gnat-style target.
	* doc/share/conf.py: Likewise.
	* doc/gnat-style.rst: New file.
2021-05-14 10:51:02 +02:00
Martin Liska
ae3e0b8bc2 gcc-changelog: detect Co-Authored-By before ChangeLog entries
contrib/ChangeLog:

	* gcc-changelog/git_commit.py: Support Co-Authored-By before
	a first ChangeLog entry.
2021-05-14 10:44:33 +02:00
H.J. Lu
f3b1516d9d libsanitizer: cherry-pick from upstream
cherry-pick:

72797dedb720 [sanitizer] Use size_t on g_tls_size to fix build on x32
2021-05-13 18:23:55 -07:00
Marek Polacek
149061188c c++: Check attributes on friend declarations [PR99032]
This patch implements [dcl.attr.grammar]/5: "If an attribute-specifier-seq
appertains to a friend declaration ([class.friend]), that declaration shall
be a definition."

This restriction applies to C++11-style attributes as well as GNU
attributes with the exception that we allow GNU attributes that require
a type, such as vector_size to continue accepting code as in attrib63.C.
There are various forms of friend declarations, we have friend
templates, C++11 extended friend declarations, and so on.  In some cases
we already ignore the attribute and warn that it was ignored.  But
certain cases weren't diagnosed, and with this patch we'll give a hard
error.  I tried hard not to emit both a warning and error and I think it
worked out.

Jason provided the cp_parser_decl_specifier_seq hunk to detect using
standard attributes in the middle of decl-specifiers, which is invalid.

Co-authored-by: Jason Merrill <jason@redhat.com>

gcc/cp/ChangeLog:

	PR c++/99032
	* cp-tree.h (any_non_type_attribute_p): Declare.
	* decl.c (grokdeclarator): Diagnose when an attribute appertains to
	a friend declaration that is not a definition.
	* decl2.c (any_non_type_attribute_p): New.
	* parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
	in the middle of decl-specifiers.
	(cp_parser_elaborated_type_specifier): Diagnose when an attribute
	appertains to a friend declaration that is not a definition.
	(cp_parser_member_declaration): Likewise.

gcc/testsuite/ChangeLog:

	PR c++/99032
	* g++.dg/cpp0x/friend7.C: New test.
	* g++.dg/cpp0x/gen-attrs-4.C: Add dg-error.
	* g++.dg/cpp0x/gen-attrs-39-1.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-74.C: New test.
	* g++.dg/ext/attrib63.C: New test.
2021-05-13 21:13:32 -04:00
GCC Administrator
f9af11c7f1 Daily bump. 2021-05-14 00:16:30 +00:00
Martin Sebor
5380e3c137 PR middle-end/100574 - ICE in size_remaining, at builtins.c
gcc/ChangeLog:

	PR middle-end/100574
	* builtins.c (access_ref::get_ref): Improve detection of PHIs with
	all null arguments.
2021-05-13 16:20:45 -06:00
Martin Sebor
2efe245bb8 Avoid -Wuninitialized false negatives with sanitization and VLAs.
Resolves:
PR tree-optimization/93100 - gcc -fsanitize=address inhibits -Wuninitialized
PR middle-end/98583 - missing -Wuninitialized reading from a second VLA in its own block

gcc/ChangeLog:

	PR tree-optimization/93100
	PR middle-end/98583
	* tree-ssa-uninit.c (check_defs): Exclude intrinsic functions that
	don't modify referenced objects.

gcc/testsuite/ChangeLog:

	PR tree-optimization/93100
	PR middle-end/98583
	* g++.dg/warn/uninit-pr93100.C: New test.
	* gcc.dg/uninit-pr93100.c: New test.
	* gcc.dg/uninit-pr98583.c: New test.
2021-05-13 16:06:51 -06:00
Martin Jambor
ca9bb74a5f tree-sra: Avoid refreshing into const base decls (PR 100453)
When SRA transforms an assignment where the RHS is an aggregate decl
that it creates replacements for, the (least efficient) fallback
method of dealing with them is to store all the replacements back into
the original decl and then let the original assignment takes itc
sourse.

That of course should not need to be done for TREE_READONLY bases
which cannot change contents.  The SRA code handled this situation in
one of two necessary places but only for DECL_IN_CONSTANT_POOL const
decls, this patch modifies both to check TREE_READONLY.

gcc/ChangeLog:

2021-05-12  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/100453
	* tree-sra.c (sra_modify_assign): All const base accesses do not
	need refreshing, not just those from decl_pool.
	(sra_modify_assign): Do not refresh into a const base decl.

gcc/testsuite/ChangeLog:

2021-05-12  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/100453
	* gcc.dg/tree-ssa/pr100453.c: New test.
2021-05-13 23:26:32 +02:00
Iain Sandoe
1f6fc2826d libsanitizer : Update LOCAL_PATCHES.
This adds the local patch to handle missing __builtin_os_log_format
on Darwin.

libsanitizer/ChangeLog:

	* LOCAL_PATCHES: Add Darwin patch for __builtin_os_log_format.
2021-05-13 21:19:19 +01:00
Iain Sandoe
adab7b2bf4 libsanitizer, Darwin : Handle missing __builtin_os_log_format.
GCC does not, currently, define __builtin_os_log_format, which
is needed by os/log.h.  Do not include that header unless the
builtin is defined (since the header errors out on the same
condition).  Provide a work-around solution to the missing API
provided via the header.

libsanitizer/ChangeLog:

	* sanitizer_common/sanitizer_mac.cpp : Check for the
	availability of __builtin_os_log_format before trying to
	include a header depending on it.
	(OS_LOG_DEFAULT): New.
	(os_log_error): Define to a fall-back using an older API.
2021-05-13 21:18:18 +01:00
Dimitar Dimitrov
8aa8a2af8f libgcc: pru: Place mpyll into its own section
This should help LD's --gc-sections feature to reduce final ELF size.

libgcc/ChangeLog:

	* config/pru/mpyll.S (__pruabi_mpyll): Place into own section.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2021-05-13 23:11:01 +03:00
Martin Sebor
e554887df0 Fix compilation error in ILP32.
gcc/testsuite/ChangeLog:
	* g++.dg/pr100574.C: Use size_t as operator new argument type.
2021-05-13 11:35:03 -06:00
Martin Liska
9feb5822b7 attributes: target_clone expects a string argument
PR middle-end/100504

gcc/c-family/ChangeLog:

	* c-attribs.c (handle_target_clones_attribute): Expect a string
	argument to target_clone argument.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/pr100504.c: New test.
2021-05-13 19:30:18 +02:00