190618 Commits

Author SHA1 Message Date
Tobias Burnus
be661959a6 libgomp/testsuite: Improve omp_get_device_num() tests
Related to r12-6208-gebc853deb7cc0487de9ef6e891a007ba853d1933
"libgomp: Fix GOMP_DEVICE_NUM_VAR stringification during offload image load"

That commit fixed an issue with omp_get_device_num() on gcn/nvptx that
resulted in having always the value 0.
This commit modifies the tests to iterate over all devices such that on a
multi-nonhost-device system it had detected that always-zero issue.

libgomp/ChangeLog:

	* testsuite/libgomp.c-c++-common/target-45.c: Iterate over all devices.
	* testsuite/libgomp.fortran/target10.f90: Likewise.
2022-01-04 14:58:06 +01:00
Richard Biener
ebc853deb7 tree-optimization/103690 - not up-to-date SSA and PRE DCE
This avoids running simple_dce_from_worklist on partially not up-to-date
SSA form (in unreachable code regions) by scheduling CFG cleanup
manually as is done anyway when tail-merging runs.

2022-01-04  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/103690
	* tree-pass.h (tail_merge_optimize): Adjust.
	* tree-ssa-tail-merge.c (tail_merge_optimize): Pass in whether
	to re-split critical edges, move CFG cleanup ...
	* tree-ssa-pre.c (pass_pre::execute): ... here, before
	simple_dce_from_worklist and delay freeing inserted_exprs from
	...
	(fini_pre): .. here.
2022-01-04 13:17:14 +01:00
Roger Sayle
beed3f8f60 nvptx: Transition nvptx backend to STORE_FLAG_VALUE = 1
This patch to the nvptx backend changes the backend's STORE_FLAG_VALUE
from -1 to 1, by using BImode predicates and selp instructions, instead
of set instructions (almost always followed by integer negation).

Historically, it was reasonable (through rare) for backends to use -1
for representing true during the RTL passes.  However with tree-ssa,
GCC now emits lots of code that reads and writes _Bool values, requiring
STORE_FLAG_VALUE=-1 targets to frequently convert 0/-1 pseudos to 0/1
pseudos using integer negation.  Unfortunately, this process prevents
or complicates many optimizations (negate isn't associative with logical
AND, OR and XOR, and interferes with range/vrp/nonzerobits bounds etc.).

The impact of this is that for a relatively simple logical expression
like "return (x==21) && (y==69);", the nvptx backend currently generates:

                mov.u32 %r26, %ar0;
                mov.u32 %r27, %ar1;
                set.u32.eq.u32  %r30, %r26, 21;
                neg.s32 %r31, %r30;
                mov.u32 %r29, %r31;
                set.u32.eq.u32  %r33, %r27, 69;
                neg.s32 %r34, %r33;
                mov.u32 %r32, %r34;
                cvt.u16.u8      %r39, %r29;
                mov.u16 %r36, %r39;
                cvt.u16.u8      %r39, %r32;
                mov.u16 %r37, %r39;
                and.b16 %r35, %r36, %r37;
                cvt.u32.u16     %r38, %r35;
                cvt.u32.u8      %value, %r38;

This patch tweaks nvptx to generate 0/1 values instead, requiring the
same number of instructions, using (BImode) predicate registers and selp
instructions so as to now generate the almost identical:

                mov.u32 %r26, %ar0;
                mov.u32 %r27, %ar1;
                setp.eq.u32     %r31, %r26, 21;
                selp.u32        %r30, 1, 0, %r31;
                mov.u32 %r29, %r30;
                setp.eq.u32     %r34, %r27, 69;
                selp.u32        %r33, 1, 0, %r34;
                mov.u32 %r32, %r33;
                cvt.u16.u8      %r39, %r29;
                mov.u16 %r36, %r39;
                cvt.u16.u8      %r39, %r32;
                mov.u16 %r37, %r39;
                and.b16 %r35, %r36, %r37;
                cvt.u32.u16     %r38, %r35;
                cvt.u32.u8      %value, %r38;

The hidden benefit is that this sequence can (in theory) be optimized
by the RTL passes to eventually generate a much shorter sequence using
an and.pred instruction (just like Nvidia's nvcc compiler).

This patch has been tested nvptx-none with a "make" and "make -k check"
(including newlib) hosted on x86_64-pc-linux-gnu with no new failures.

gcc/ChangeLog:

	* config/nvptx/nvptx.h (STORE_FLAG_VALUE): Change to 1.
	* config/nvptx/nvptx.md (movbi): Use P1 constraint for true.
	(setcc_from_bi): Remove SImode specific pattern.
	(setcc<mode>_from_bi): Provide more general HSDIM pattern.
	(extendbi<mode>2, zeroextendbi<mode>2): Provide instructions
	for sign- and zero-extending BImode predicates to integers.
	(setcc_int<mode>): Remove previous (-1-based) instructions.
	(cstorebi4): Remove BImode to SImode specific expander.
	(cstore<mode>4): Fix indentation.  Expand using setccsi_from_bi.
	(cstore<mode>4): For both integer and floating point modes.
2022-01-04 12:28:02 +01:00
Olivier Hainque
a54d11749f Adjust VxWorks fixincludes hack for mkdir to work for C++
For VxWorks, replace an attempt at providing a posix API for
mkdir via macro by a varargs prototype, which works better for
C++ references like std::mkdir(arg1, arg2).

2021-12-16  Olivier Hainque  <hainque@adacore.com>

fixincludes/
	* inclhack.def (vxworks_posix_mkdir): Refine to expose a
	varargs interface.
	* tests/base/sys/stat.h: Update expected results.
	* fixincl.x: Regenerate.
2022-01-04 10:27:11 +00:00
Olivier Hainque
48e2d9b7b8 Register --sysroot in the driver switches table
This change adjusts the processing of --sysroot to save the option in the
internal "switches" array, which lets self-specs test for it and provide a
default value possibly dependent on environment variables, as in

  --with-specs=%{!-sysroot*:--sysroot=%:getenv("WIND_BASE" /target)}

2021-12-20  Olivier Hainque  <hainque@adacore.com>

gcc/
	* gcc.c (driver_handle_option): do_save --sysroot.
2022-01-04 10:16:01 +00:00
Chung-Lin Tang
fbb592407c libgomp: Fix GOMP_DEVICE_NUM_VAR stringification during offload image load
In the patch that implemented omp_get_device_num(), there was an error where
the stringification of GOMP_DEVICE_NUM_VAR, which is the macro expanding to
the actual symbol used, was erroneously using the STRINGX() macro in the
libgomp offload image symbol search, and expansion of the variable name
string through the additional layer of preprocessor symbol was not properly
achieved.

This patch fixes this by changing to properly use XSTRING(), also from
include/symcat.h.

libgomp/ChangeLog:

	* plugin/plugin-gcn.c (GOMP_OFFLOAD_load_image): Change uses of STRINGX
	into XSTRING when looking for GOMP_DEVICE_NUM_VAR in offload image.
	* plugin/plugin-nvptx.c (GOMP_OFFLOAD_load_image): Likewise.
2022-01-04 17:26:23 +08:00
Richard Biener
1a15451da1 tree-optimization/103864 - SLP reduction of reductions with conversions
This generalizes the fix for PR103544 to also cover reductions that
are not reduction chains and does not consider reductions wrapped in
sign conversions for SLP reduction handling.

2022-01-04  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/103864
	PR tree-optimization/103544
	* tree-vect-slp.c (vect_analyze_slp_instance): Exclude
	reductions wrapped in conversions from SLP handling.
	(vect_analyze_slp): Revert PR103544 change.

	* gcc.dg/vect/pr103864.c: New testcase.
2022-01-04 10:16:28 +01:00
Jakub Jelinek
801b2c880c shrink-wrapping: Don't call can_get_prologue unnecessarily [PR103860]
On Thu, Dec 30, 2021 at 04:08:25AM -0600, Segher Boessenkool wrote:
> > The following simple patch makes sure we call can_get_prologue even after
> > the last former iteration when vec is already empty and only break from
> > the loop afterwards (and only if the updating of pro done because of
> > !can_get_prologue didn't push anything into vec again).

During the development of the above patch I've noticed that in many cases
we call can_get_prologue often on the same pro again and again and again,
we can have many basic blocks pushed into vec and if most of those don't
require pro updates, i.e.
      basic_block bb = vec.pop ();
      if (!can_dup_for_shrink_wrapping (bb, pro, max_grow_size))
        while (!dominated_by_p (CDI_DOMINATORS, bb, pro))
isn't true, then pro is can_get_prologue checked for each bb in the vec.

The following simple patch just remembers which bb we've verified already
and verifies again only when pro changes.  Most of the patch is just
reindentation.

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

	PR rtl-optimization/103860
	* shrink-wrap.c (try_shrink_wrapping): Don't call can_get_prologue
	uselessly for blocks for which it has been called already.
2022-01-04 10:12:17 +01:00
Cui,Lili
4bd5297f66 x86: Update model value for Alderlake and Rocketlake
gcc/ChangeLog

	* common/config/i386/cpuinfo.h (get_intel_cpu): Add new model values
	to Alderlake and Rocketlake.
2022-01-04 16:30:41 +08:00
Chung-Lin Tang
62c8b21d48 openmp: Fix ICE in gimplify_omp_affinity [PR103643]
After the PR90030 patch, which removes the universal casting of all Fortran
array pointers to 'c_char*', a Fortran descriptor based array passed into an
affinity() clause now looks like:

-     #pragma omp task private(i) shared(b) affinity(*(c_char *) a.data)
+     #pragma omp task private(i) shared(b) affinity(*(integer(kind=4)[0:] * restrict) a.data)

The 'integer(kind=4)[0:]' incomplete type appears to be causing ICE during
gimplify_expr() due to 'is_gimple_val, fb_rvalue'. The ICE appears to be fixed
just by adjusting to 'is_gimple_lvalue, fb_lvalue'. Considering the use of the
affinity() clause, which should be specifying the location of a particular
object in memory, this probably makes sense.

gcc/ChangeLog:

	PR middle-end/103643

	* gimplify.c (gimplify_omp_affinity): Adjust gimplify_expr of entire
	OMP_CLAUSE_DECL to use 'is_gimple_lvalue, fb_lvalue'

gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/pr103643.f90: New test.
2022-01-04 15:37:15 +08:00
liuhongt
05da96886e Force_reg operand 1.
Avoid ICE of move pattern from memory to memory.

gcc/ChangeLog:

	PR target/103895
	* config/i386/sse.md (*bit_and_float_vector_all_ones):
	Force_reg operand 1 to avoid ICE.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/pr103895.c: New test.
2022-01-04 11:49:58 +08:00
Andrew Pinski
d4b710a31d [COMMITTED] c++: [PR90782] Add testcase
This testcase was fixed by r12-1744-g3eecc1 as it make
sense it fixed a few other class deduction issues.
So I thought I would add a testcase for this PR and close
it as fixed.

Committed after a quick test of the testcase.

	PR c++/90782

gcc/testsuite/ChangeLog:

	* g++.dg/cpp1z/class-deduction100.C: New test.
2022-01-04 02:59:58 +00:00
Jason Merrill
43359148b2 tree-pretty-print: still indent unhandled codes
It would be nice to handle language-specific codes in the tree
pretty-printer, but until then we can at least indent them appropriately.

gcc/ChangeLog:

	* tree-pretty-print.c (do_niy): Add spc parameter.
	(NIY): Pass it.
	(print_call_name): Add spc local variable.
2022-01-03 19:36:35 -05:00
GCC Administrator
a4ae8c3701 Daily bump. 2022-01-04 00:16:40 +00:00
Marek Polacek
bb936163e2 c-family: Have -Wformat-diag accept "decl-specifier" [PR103758]
I'm tired of seeing

cp/parser.c:15923:55: warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]
cp/parser.c:15925:57: warning: misspelled term 'decl' in format; use 'declaration' instead [-Wformat-diag]

every time I compile cp/parser.c, which happens...a lot.  I'd like my
compilation to be free of warnings, otherwise I'm going to miss some
important ones.

"decl-specifiers" is a C++ grammar term; it is not actual code, so
should not be wrapped with %< %>.  I hope we can accept it as an exception
in check_tokens.

It was surrounded by %< %> in cp_parser_decl_specifier_seq, so fix that.

In passing, fix a misspelling in missspellings.

	PR c++/103758

gcc/c-family/ChangeLog:

	* c-format.c (check_tokens): Accept "decl-specifier*".

gcc/cp/ChangeLog:

	* parser.c (cp_parser_decl_specifier_seq): Replace %<decl-specifier%>
	with %qD.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/constexpr-condition.C: Adjust dg-error.
2022-01-03 15:53:59 -05:00
Uros Bizjak
1096ab1775 i386: Always enable mov<V_32:mode> patterns [PR103894]
Middle end tries to generate V4QImode moves to implement V2QImode inserts
and calls emit_move_multi_word when V4QImode moves are unavailable, as is
the case with 32-bit vector moves, constrainted with TARGET_SSE2.

However, this triggers

  gcc_assert (mode_size >= UNITS_PER_WORD);

in emit_move_multi_word, since mode_size of V4QImode operand is less than
UNITS_PER_WORD of 64-bit targets.

The patch unconditionally enables 32-bit vector moves to match 16-bit
vector moves.  This also enables implementation of 32-bit vector logic
operations with GPR in a follow-up patch.

2022-01-03  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

	PR target/103894
	* config/i386/mmx.md (mov<V_32:mode>): Remove TARGET_SSE2 constraint.
	(mov<V_32:mode>_internal): Ditto.
	(*push<V_32:mode>_rex64): Ditto.
	(movmisalign<V_32:mode>): Ditto.
	(*push<V_32:mode>_rex64 splitter): Enable for
	TARGET_64BIT && TARGET_SSE.
	(*push<V_32:mode>2): Remove insn pattern.

gcc/testsuite/ChangeLog:

	PR target/103894
	* gcc.target/i386/pr103894.c: New test.
2022-01-03 20:59:19 +01:00
Marek Polacek
122a75488c c++: Avoid narrowing in make_char_string_pack
This fixes

gcc/cp/parser.c:4618:41: warning: narrowing conversion of '(char)(*(str + ((sizetype)i)))' from 'char' to 'unsigned char' [-Wnarrowing]
 4618 |       unsigned char s[3] = { '\'', str[i], '\'' };
      |                                    ~~~~~^

gcc/cp/ChangeLog:

	* parser.c (make_char_string_pack): Add a cast to const unsigned
	char *.
2022-01-03 14:00:34 -05:00
Andrew Pinski
4003ecbced Revamp documentation for _Complex types extension
While cleaning up the bug database, I noticed there was a request
to improve the documentation of the _Complex type extensions.
So I rewrote part of the documentation to make things clearer on
__real/__imag and even added documentation about casts between
the scalar and the complex type.
I moved the documentation of __builtin_complex under this section
too because it makes more sense than having it in the other
built-in section and reference it.

OK? Built make info and make html and checked out the results to
make sure the tables look decent.

gcc/ChangeLog:

	PR c/33193
	* doc/extend.texi: Extend the documentation about Complex
	types for casting and also rewrite the __real__/__imag__
	expression portion to use tables.
	Move __builtin_complex to the Complex type section.
2022-01-03 17:52:59 +00:00
Sandra Loosemore
6447f6f983 Fortran: Fix array copy-in/copy-out for BIND(C) functions [PR103390]
The Fortran front end was generating invalid code for the array
copy-out after a call to a BIND(C) function for a dummy with the
CONTIGUOUS attribute when the actual argument was a call to the SHAPE
intrinsic or other array expressions that are not lvalues.  It was
also generating code to evaluate the argument expression multiple
times on copy-in.  This patch teaches it to recognize that a copy is
not needed in these cases.

2022-01-03  Sandra Loosemore  <sandra@codesourcery.com>

	PR fortran/103390

	gcc/fortran/
	* expr.c (gfc_is_simply_contiguous): Make it smarter about
	function calls.
	* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Do not generate
	copy loops for array expressions that are not "variables" (lvalues).

	gcc/testsuite/
	* gfortran.dg/c-interop/pr103390-1.f90: New.
	* gfortran.dg/c-interop/pr103390-2.f90: New.
	* gfortran.dg/c-interop/pr103390-3.f90: New.
	* gfortran.dg/c-interop/pr103390-4.f90: New.
	* gfortran.dg/c-interop/pr103390-6.f90: New.
	* gfortran.dg/c-interop/pr103390-7.f90: New.
	* gfortran.dg/c-interop/pr103390-8.f90: New.
	* gfortran.dg/c-interop/pr103390-9.f90: New.
2022-01-03 08:47:38 -08:00
Jakub Jelinek
6362627b27 i386, fab: Optimize __atomic_{add,sub,and,or,xor}_fetch (x, y, z) {==,!=,<,<=,>,>=} 0 [PR98737]
On Wed, Jan 27, 2021 at 12:27:13PM +0100, Ulrich Drepper via Gcc-patches wrote:
> On 1/27/21 11:37 AM, Jakub Jelinek wrote:
> > Would equality comparison against 0 handle the most common cases.
> >
> > The user can write it as
> > __atomic_sub_fetch (x, y, z) == 0
> > or
> > __atomic_fetch_sub (x, y, z) - y == 0
> > thouch, so the expansion code would need to be able to cope with both.
>
> Please also keep !=0, <0, <=0, >0, and >=0 in mind.  They all can be
> useful and can be handled with the flags.

<= 0 and > 0 don't really work well with lock {add,sub,inc,dec}, x86 doesn't
have comparisons that would look solely at both SF and ZF and not at other
flags (and emitting two separate conditional jumps or two setcc insns and
oring them together looks awful).

But the rest can work.

Here is a patch that adds internal functions and optabs for these,
recognizes them at the same spot as e.g. .ATOMIC_BIT_TEST_AND* internal
functions (fold all builtins pass) and expands them appropriately (or for
the <= 0 and > 0 cases of +/- FAILs and let's middle-end fall back).

So far I have handled just the op_fetch builtins, IMHO instead of handling
also __atomic_fetch_sub (x, y, z) - y == 0 etc. we should canonicalize
__atomic_fetch_sub (x, y, z) - y to __atomic_sub_fetch (x, y, z) (and vice
versa).

2022-01-03  Jakub Jelinek  <jakub@redhat.com>

	PR target/98737
	* internal-fn.def (ATOMIC_ADD_FETCH_CMP_0, ATOMIC_SUB_FETCH_CMP_0,
	ATOMIC_AND_FETCH_CMP_0, ATOMIC_OR_FETCH_CMP_0, ATOMIC_XOR_FETCH_CMP_0):
	New internal fns.
	* internal-fn.h (ATOMIC_OP_FETCH_CMP_0_EQ, ATOMIC_OP_FETCH_CMP_0_NE,
	ATOMIC_OP_FETCH_CMP_0_LT, ATOMIC_OP_FETCH_CMP_0_LE,
	ATOMIC_OP_FETCH_CMP_0_GT, ATOMIC_OP_FETCH_CMP_0_GE): New enumerators.
	* internal-fn.c (expand_ATOMIC_ADD_FETCH_CMP_0,
	expand_ATOMIC_SUB_FETCH_CMP_0, expand_ATOMIC_AND_FETCH_CMP_0,
	expand_ATOMIC_OR_FETCH_CMP_0, expand_ATOMIC_XOR_FETCH_CMP_0): New
	functions.
	* optabs.def (atomic_add_fetch_cmp_0_optab,
	atomic_sub_fetch_cmp_0_optab, atomic_and_fetch_cmp_0_optab,
	atomic_or_fetch_cmp_0_optab, atomic_xor_fetch_cmp_0_optab): New
	direct optabs.
	* builtins.h (expand_ifn_atomic_op_fetch_cmp_0): Declare.
	* builtins.c (expand_ifn_atomic_op_fetch_cmp_0): New function.
	* tree-ssa-ccp.c: Include internal-fn.h.
	(optimize_atomic_bit_test_and): Add . before internal fn call
	in function comment.  Change return type from void to bool and
	return true only if successfully replaced.
	(optimize_atomic_op_fetch_cmp_0): New function.
	(pass_fold_builtins::execute): Use optimize_atomic_op_fetch_cmp_0
	for BUILT_IN_ATOMIC_{ADD,SUB,AND,OR,XOR}_FETCH_{1,2,4,8,16} and
	BUILT_IN_SYNC_{ADD,SUB,AND,OR,XOR}_AND_FETCH_{1,2,4,8,16},
	for *XOR* ones only if optimize_atomic_bit_test_and failed.
	* config/i386/sync.md (atomic_<plusminus_mnemonic>_fetch_cmp_0<mode>,
	atomic_<logic>_fetch_cmp_0<mode>): New define_expand patterns.
	(atomic_add_fetch_cmp_0<mode>_1, atomic_sub_fetch_cmp_0<mode>_1,
	atomic_<logic>_fetch_cmp_0<mode>_1): New define_insn patterns.
	* doc/md.texi (atomic_add_fetch_cmp_0<mode>,
	atomic_sub_fetch_cmp_0<mode>, atomic_and_fetch_cmp_0<mode>,
	atomic_or_fetch_cmp_0<mode>, atomic_xor_fetch_cmp_0<mode>): Document
	new named patterns.

	* gcc.target/i386/pr98737-1.c: New test.
	* gcc.target/i386/pr98737-2.c: New test.
	* gcc.target/i386/pr98737-3.c: New test.
	* gcc.target/i386/pr98737-4.c: New test.
	* gcc.target/i386/pr98737-5.c: New test.
	* gcc.target/i386/pr98737-6.c: New test.
	* gcc.target/i386/pr98737-7.c: New test.
2022-01-03 14:17:26 +01:00
Richard Biener
4911609fbe middle-end/103851 - ensure SSA names are released during OMP lowering
This makes sure to release moved & remapped SSA names during OMP
outlining which happens before going into SSA but with SSA names
created by gimplification around.

2022-01-03  Richard Biener  <rguenther@suse.de>

	PR middle-end/103851
	* tree-cfg.c (move_sese_region_to_fn): Always release SSA names.

	* g++.dg/gomp/pr103851.C: New testcase.
2022-01-03 13:51:24 +01:00
Jakub Jelinek
91031bffa4 symtab: Fold &a == &b to 0 if folding_initializer [PR94716]
On Thu, Dec 09, 2021 at 06:09:12PM -0500, Jason Merrill wrote:
> For the more general comparison of decls like your a != b example above I
> think clang is in the right; in manifestly constant-evaluated context
> (folding_initializer) we should return that they are unequal and prevent a
> later alias declaration, like we do for comparison to 0 in
> maybe_nonzero_address.  It's possible that this gives a wrong answer based
> on something in another translation unit, but that's unlikely, and taking
> that chance seems better than rejecting code that needs a constant answer.

I agree.  This is an incremental patch to do that.

2022-01-03  Jakub Jelinek  <jakub@redhat.com>

	PR c++/94716
gcc/
	* symtab.c: Include fold-const.h.
	(symtab_node::equal_address_to): If folding_initializer is true,
	handle it like memory_accessed.  Simplify.
gcc/testsuite/
	* gcc.dg/init-compare-1.c: New test.
	* g++.dg/cpp0x/constexpr-compare1.C: New test.
	* g++.dg/cpp1y/constexpr-94716.C: New test.
	* g++.dg/cpp1z/constexpr-compare1.C: New test.
2022-01-03 13:47:53 +01:00
Martin Liska
814c221c9e testsuite: fix ASAN errors in i386.exp tests
gcc/testsuite/ChangeLog:

	* gcc.target/i386/avx2-i32gatherpd256-4.c: Fix ASAN errors.
	* gcc.target/i386/avx2-i32gatherq256-4.c: Likewise.
	* gcc.target/i386/avx2-i64gatherpd256-4.c: Likewise.
	* gcc.target/i386/avx2-i64gatherq256-4.c: Likewise.
	* gcc.target/i386/avx2-vpabsb256-2.c: Likewise.
	* gcc.target/i386/avx2-vpabsd256-2.c: Likewise.
	* gcc.target/i386/avx2-vpabsw256-2.c: Likewise.
	* gcc.target/i386/avx256-unaligned-load-7.c: Likewise.
	* gcc.target/i386/avx256-unaligned-store-7.c: Likewise.
	* gcc.target/i386/pr64291-1.c: Likewise.
2022-01-03 12:48:59 +01:00
Martin Liska
b043d4f93e testsuite: fix vect.exp ASAN errors
gcc/testsuite/ChangeLog:

	* gcc.dg/vect/vect-simd-18.c: Fix ASAN error.
	* gcc.dg/vect/vect-simd-19.c: Likewise.
2022-01-03 12:47:34 +01:00
Iain Buclaw
c43b590903 d: Merge upstream dmd 001bfd97b, druntime 759e6023, phobos 468788323.
D front-end changes:

    - Import latest changes to mainline.
    - Fix bad format specifiers in front-end errors (PR103840).
    - Refactoring of some leaf modules to the dmd/root package.
    - Updating copyright notice dates and urls.

Phobos changes:

    - Import latest changes to mainline.

gcc/d/ChangeLog:

	PR d/103840
	* dmd/MERGE: Merge upstream dmd 001bfd97b.
	* Make-lang.in (D_FRONTEND_OBJS): Rename d/complex.o to
	d/root-complex.o, and d/utf.o to d/root/utf.o.

libphobos/ChangeLog:

	* libdruntime/MERGE: Merge upstream druntime 759e6023.
	* src/MERGE: Merge upstream phobos 468788323.
2022-01-03 12:26:05 +01:00
Martin Liska
bd5b0fca54 docs: Use ; for function declarations.
gcc/ChangeLog:

	* doc/extend.texi: Use ; for function declarations.
2022-01-03 11:57:33 +01:00
Jakub Jelinek
134442b217 c++: Support &typeid(x) == &typeid(y) and typeid(x) == typeid(y) in constant evaluation [PR103600]
If the tinfo vars are emitted in the current TU, they are emitted at the end
of the compilation, and for some types they are exported from
libstdc++/libsupc++ and not emitted in the current TU at all.

The following patch allows constant folding of comparisons of typeid
addresses and makes it possible to implement P1328R1 - making type_info
operator== constexpr (Jonathan has a patch for that).

As mentioned in the PR, the varpool/middle-end code is trying to be
conservative with address comparisons of different vars if those vars
don't bind locally, because of possible aliases in other TUs etc.
and so while match.pd folds &typeid(int) == &typeid(int) because
it is equality comparison with the same operands, for different typeids
it doesn't fold it.

On Wed, Dec 08, 2021 at 08:53:03AM -0500, Jason Merrill wrote:
> Would it make sense to assume that DECL_ARTIFICIAL variables can't be
> aliases?  If not, could we have some way of marking a variable as
> non-aliasing, perhaps an attribute?

I think DECL_ARTIFICIAL vars generally can overlap.

The following patch adds a GCC internal attribute "non overlapping"
and uses it in symtab_node::equal_address_to.
Not sure what plans has Honza in that area and whether it would be useful
to make the attribute public and let users assert that some variable will
never overlap with other variables, won't have aliases etc.

> During constant evaluation, the operator== could compare the type_info
> address instead of the __name address, reducing this to the previous
> problem.

Ah, indeed, good idea.  FYI, clang++ seems to constant fold
&typeid(x) != &typeid(y) already, so Jonathan could use it even for
clang++ in the constexpr operator==.  But it folds even
extern int &a, &b;
constexpr bool c = &a != &b;
regardless of whether some other TU has
int a;
int b __attribute__((alias (a));
or not.

2022-01-03  Jakub Jelinek  <jakub@redhat.com>

	PR c++/103600
gcc/
	* symtab.c (symtab_node::equal_address_to): Return 0 if one of
	VAR_DECLs has "non overlapping" attribute and rs1 != rs2.
gcc/c-family/
	* c-attribs.c (handle_non_overlapping_attribute): New function.
	(c_common_attribute_table): Add "non overlapping" attribute.
gcc/cp/
	* rtti.c (get_tinfo_decl_direct): Add "non overlapping" attribute
	to DECL_TINFO_P VAR_DECLs.
gcc/testsuite/
	* g++.dg/cpp0x/constexpr-typeid2.C: New test.
2022-01-03 11:21:00 +01:00
Richard Biener
cd83fd98a7 tree-optimization/66502 - add testcase
This adds the second testcase which we now also handle eliminating
a redundant PHI node.

2022-01-03  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/66502
	* gcc.dg/tree-ssa/ssa-fre-98.c: New testcase.
2022-01-03 10:50:21 +01:00
Jakub Jelinek
7adcbafe45 Update copyright years. 2022-01-03 10:42:10 +01:00
Jakub Jelinek
5d5db19630 Add University of Illinois as external author
* update-copyright.py: Add University of Illinois as external author.
2022-01-03 10:39:25 +01:00
Jakub Jelinek
877e3c2abf Update Copyright in ChangeLog files
Do this separately from all other Copyright updates, as ChangeLog files
can be modified only separately.
2022-01-03 10:31:39 +01:00
Jakub Jelinek
abc1ac2d8d Update copyright dates.
Manual part of copyright year updates.

2022-01-03  Jakub Jelinek  <jakub@redhat.com>

gcc/
	* gcc.c (process_command): Update copyright notice dates.
	* gcov-dump.c (print_version): Ditto.
	* gcov.c (print_version): Ditto.
	* gcov-tool.c (print_version): Ditto.
	* gengtype.c (create_file): Ditto.
	* doc/cpp.texi: Bump @copying's copyright year.
	* doc/cppinternals.texi: Ditto.
	* doc/gcc.texi: Ditto.
	* doc/gccint.texi: Ditto.
	* doc/gcov.texi: Ditto.
	* doc/install.texi: Ditto.
	* doc/invoke.texi: Ditto.
gcc/ada/
	* gnat_ugn.texi: Bump @copying's copyright year.
	* gnat_rm.texi: Likewise.
gcc/d/
	* gdc.texi: Bump @copyrights-d year.
gcc/fortran/
	* gfortranspec.c (lang_specific_driver): Update copyright notice
	dates.
	* gfc-internals.texi: Bump @copying's copyright year.
	* gfortran.texi: Ditto.
	* intrinsic.texi: Ditto.
	* invoke.texi: Ditto.
gcc/go/
	* gccgo.texi: Bump @copyrights-go year.
libgomp/
	* libgomp.texi: Bump @copying's copyright year.
libitm/
	* libitm.texi: Bump @copying's copyright year.
libquadmath/
	* libquadmath.texi: Bump @copying's copyright year.
2022-01-03 10:27:43 +01:00
Jakub Jelinek
6123f29a18 Rotate ChangeLog files - step 2 - remove 2021 entries from ChangeLog files.
Can't be committed together with the previous one due to the ChangeLog vs.
other files restrictions.
2022-01-03 10:23:34 +01:00
Jakub Jelinek
d04ae83244 Rotate ChangeLog files - part 1 - add ChangeLog-2021.
2022-01-03  Jakub Jelinek  <jakub@redhat.com>

gcc/
	* ChangeLog-2021: Rotate ChangeLog.  New file.
gcc/ada/
	* ChangeLog-2021: Rotate ChangeLog.  New file.
gcc/cp/
	* ChangeLog-2021: Rotate ChangeLog.  New file.
gcc/d/
	* ChangeLog-2021: Rotate ChangeLog.  New file.
gcc/fortran/
	* ChangeLog-2021: Rotate ChangeLog.  New file.
gcc/testsuite/
	* ChangeLog-2021: Rotate ChangeLog.  New file.
libgfortran/
	* ChangeLog-2021: Rotate ChangeLog.  New file.
libstdc++-v3/
	* ChangeLog-2021: Rotate ChangeLog.  New file.
2022-01-03 10:18:16 +01:00
Richard Biener
660e583466 Add testcase for PR103615
This adds a testcase for a fixed wrong-code bug.

2022-01-03  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/103615
	* gcc.dg/torture/pr103615.c: New testcase.
2022-01-03 09:56:13 +01:00
GCC Administrator
5da23a13bd Daily bump. 2022-01-03 00:16:28 +00:00
Uros Bizjak
9ff206d386 i386: Introduce V2QImode vectorized arithmetic [PR103861]
This patch adds basic V2QImode infrastructure and V2QImode arithmetic
operations (plus, minus and neg).  The patched compiler can emit SSE
vectorized QImode operations (e.g. PADDB) with partial QImode vector,
and also synthesized double HI/LO QImode operations with integer registers.

The testcase:

typedef char __v2qi __attribute__ ((__vector_size__ (2)));
__v2qi plus  (__v2qi a, __v2qi b) { return a + b; };

compiles with -O2 to:

        movl    %edi, %edx
        movl    %esi, %eax
        addb    %sil, %dl
        addb    %ah, %dh
        movl    %edx, %eax
        ret

which is much better than what the unpatched compiler produces:

        movl    %edi, %eax
        movl    %esi, %edx
        xorl    %ecx, %ecx
        movb    %dil, %cl
        movsbl  %dh, %edx
        movsbl  %ah, %eax
        addl    %edx, %eax
        addb    %sil, %cl
        movb    %al, %ch
        movl    %ecx, %eax
        ret

The V2QImode vectorization does not require vector registers, so it can
be enabled by default also for 32-bit targets without SSE.

The patch also enables vectorized V2QImode sign/zero extends.

2021-12-30  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

	PR target/103861
	* config/i386/i386.h (VALID_SSE2_REG_MODE): Add V2QImode.
	(VALID_INT_MODE_P): Ditto.
	* config/i386/i386.c (ix86_secondary_reload): Handle
	V2QImode reloads from SSE register to memory.
	(vector_mode_supported_p): Always return true for V2QImode.
	* config/i386/i386.md (*subqi_ext<mode>_2): New insn pattern.
	(*negqi_ext<mode>_2): Ditto.
	* config/i386/mmx.md (movv2qi): New expander.
	(movmisalignv2qi): Ditto.
	(*movv2qi_internal): New insn pattern.
	(*pushv2qi2): Ditto.
	(negv2qi2 and splitters): Ditto.
	(<plusminus:insn>v2qi3 and splitters): Ditto.

gcc/testsuite/ChangeLog:

	PR target/103861
	* gcc.dg/store_merging_18.c (dg-options): Add -fno-tree-vectorize.
	* gcc.dg/store_merging_29.c (dg-options): Ditto.
	* gcc.target/i386/pr103861.c: New test.
	* gcc.target/i386/pr92658-avx512vl.c (dg-final):
	Remove vpmovqb scan-assembler xfail.
	* gcc.target/i386/pr92658-sse4.c (dg-final):
	Remove pmovzxbq scan-assembler xfail.
	* gcc.target/i386/pr92658-sse4-2.c (dg-final):
	Remove pmovsxbq scan-assembler xfail.
	* gcc.target/i386/warn-vect-op-2.c (dg-warning): Adjust warnings.
2022-01-02 21:13:14 +01:00
John David Anglin
6bec6e3aaa Adjust shadd-2 and shadd-3 scan counts.
2022-01-02  John David Anglin  <danglin@gcc.gnu.org>

gcc/testsuite/ChangeLog:

	* gcc.target/hppa/shadd-2.c: Adjust count to 3.
	* gcc.target/hppa/shadd-3.c: Likewise.
2022-01-02 18:55:50 +00:00
John David Anglin
ee4e234e9a Skip gcc.dg/guality/example.c on hppa-linux.
2022-01-02  John David Anglin  <danglin@gcc.gnu.org>

gcc/testsuite/ChangeLog:

	* gcc.dg/guality/example.c: Skip on hppa*-*-linux*.
2022-01-02 18:37:34 +00:00
Jason Merrill
c743614e70 c++: fix array cleanup with throwing temp dtor
While working on PR66139 I noticed that if the destructor of a temporary
created during array initialization throws, we were failing to destroy the
last array element constructed.  Throwing destructors are rare since C++11,
but this should be fixed.

gcc/cp/ChangeLog:

	* init.c (build_vec_init): Append the decrement to elt_init.

gcc/testsuite/ChangeLog:

	* g++.dg/eh/array2.C: New test.
2022-01-02 12:56:02 -05:00
Jason Merrill
092e60f57a c++: don't wrap cleanups that can't throw
Since C++11, the vast majority of destructors are noexcept, so
wrap_temporary_cleanups adds a bunch of useless TRY_CATCH_EXPR to be removed
later in the optimizers.  It's simple to avoid adding them in the first
place.

gcc/cp/ChangeLog:

	* decl.c (wrap_cleanups_r): Don't wrap if noexcept.

gcc/testsuite/ChangeLog:

	* g++.dg/eh/cleanup6.C: New test.
2022-01-02 12:56:02 -05:00
John David Anglin
4620531ea9 Generate illegal instruction fault if LWS syscall returns -EFAULT.
2022-01-02  John David Anglin  <danglin@gcc.gnu.org>

libgcc/ChangeLog:

	* config/pa/linux-atomic.c (_ASM_EFAULT): Define.
	(__kernel_cmpxchg): Nullify illegal iitlbp instruction if error
	return is not equal _ASM_EFAULT.
	(__kernel_cmpxchg2): Likewise.
2022-01-02 17:12:45 +00:00
John David Anglin
4759c16bee Use optab_libfunc to access sync_lock_test_and_set libfunc on hppa-linux.
2022-01-02  John David Anglin  <danglin@gcc.gnu.org>

gcc/ChangeLog:

	* config/pa/pa.md (atomic_storeq): Use optab_libfunc to access
	sync_lock_test_and_set libfunc. Call convert_memory_address to
	convert memory address to Pmode.
	(atomic_storehi, atomic_storesi, atomic_storedi): Likewise.
2022-01-02 16:40:48 +00:00
GCC Administrator
62eb5308fe Daily bump. 2022-01-02 00:16:28 +00:00
Francois-Xavier Coudert
4f3b1a09d3 Fixincludes: Handle __FLT_EVAL_METHOD__ == 16 on darwin
The darwin system headers error out on __FLT_EVAL_METHOD__ == 16, which
occurs when the compiler is called with -mavx512fp16 on i386. Allow this
value to proceed past the check (nothing else depends on it in the
system headers).

fixincludes/ChangeLog:

	* inclhack.def: Add new fix on darwin.
	* fixincl.x: Regenerate.
	* tests/base/math.h: Regenerate.
2022-01-01 13:00:41 +01:00
Andrew Pinski
5fa4f98263 Committed: Add testcases for a few PRs
These were fixed as part of the fix for PR 99766,
I thought it would be useful to add a few testcases
for the other cases that were failing.

Committed as obvious after running the tests to make
sure they work.

	PR rtl-optimization/100241
	PR rtl-optimization/99787

gcc/testsuite/ChangeLog:

	* gcc.c-torture/compile/pr100241-1.c: New test.
	* gcc.c-torture/compile/pr99787-1.c: New test.
2022-01-01 08:47:25 +00:00
Jakub Jelinek
7918d8270a testsuite: Adjust gcc.misc-tests/godump-1.c testcase
On Wed, Dec 29, 2021 at 03:54:03PM -0800, Ian Lance Taylor via Gcc-patches wrote:
> PR go/103847
> * godump.c (go_force_record_alignment): Name the alignment
> field "_".

> --- a/gcc/godump.c
> +++ b/gcc/godump.c
> @@ -651,7 +651,7 @@ go_force_record_alignment (struct obstack *ob, const char *type_string,
>                          unsigned int index, const char *error_string)
>  {
>    index = go_append_artificial_name (ob, index);
> -  obstack_grow (ob, "_align ", 7);
> +  obstack_grow (ob, "_ ", 2);
>    if (type_string == NULL)
>      obstack_grow (ob, error_string, strlen (error_string));
>    else

This change caused
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^type _ts_nested struct { u struct { s int16; Godump_0_pad \\\\[2\\\\]byte; Godump_1_align \\\\[0\\\\]u?int32; }; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^type _ts_nested2 struct { u struct { Godump_0_pad \\\\[4\\\\]byte; Godump_1_pad \\\\[2\\\\]byte; s int16; c int8; Godump_2_pad
+\\\\[1\\\\]byte; Godump_3_pad \\\\[2\\\\]byte; Godump_4_align \\\\[0\\\\]u?int32; }; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^type _tsbf_gaps struct { bf1 uint8; c uint8; bf2 uint8; Godump_0_pad \\\\[2\\\\]byte; s uint16; Godump_1_align \\\\[0\\\\]int32; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^type _tsbf_pad16_1 struct { Godump_0_pad \\\\[1\\\\]byte; c uint8; Godump_1_align \\\\[0\\\\]int16; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^type _tsbf_pad16_2 struct { Godump_0_pad \\\\[2\\\\]byte; c uint8; Godump_1_pad \\\\[.\\\\]byte; Godump_2_align \\\\[0\\\\]int16; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^type _tsbf_pad32_1 struct { Godump_0_pad \\\\[1\\\\]byte; c uint8; Godump_1_pad \\\\[.\\\\]byte; Godump_2_align \\\\[0\\\\]int32; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^type _tsbf_pad32_2 struct { Godump_0_pad \\\\[4\\\\]byte; c uint8; Godump_1_pad \\\\[.\\\\]byte; Godump_2_align \\\\[0\\\\]int32; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^type _tsbf_pad64_1 struct { Godump_0_pad \\\\[1\\\\]byte; c uint8; Godump_1_pad \\\\[.\\\\]byte; Godump_2_align \\\\[0\\\\]int64; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^type _tsbf_pad64_2 struct { Godump_0_pad \\\\[8\\\\]byte; c uint8; Godump_1_pad \\\\[.\\\\]byte; Godump_2_align \\\\[0\\\\]int64; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^type _tsn_anon struct { a uint8; s uint16; b uint8; Godump_0_pad \\\\[.\\\\]byte; Godump_1_align \\\\[0\\\\]int16; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^type _tsu_anon struct { c uint8; Godump_0_pad \\\\[7\\\\]byte; Godump_1_align \\\\[0\\\\]u?int64; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^type _tu1 struct { c uint8; Godump_0_pad \\\\[.\\\\]byte; Godump_1_align \\\\[0\\\\]u?int64; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^type _tu3_size struct { ca \\\\[4\\\\+1\\\\]uint8; Godump_0_pad \\\\[.\\\\]byte; Godump_1_align \\\\[0\\\\]u?int64; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^type _tu_nested struct { u struct { s int16; Godump_0_pad \\\\[2\\\\]byte; Godump_1_align \\\\[0\\\\]u?int32; }; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^type _tu_nested2 struct { u struct { Godump_0_pad \\\\[4\\\\]byte; Godump_1_pad \\\\[2\\\\]byte; s int16; c int8; Godump_2_pad
+\\\\[1\\\\]byte; Godump_3_pad \\\\[2\\\\]byte; Godump_4_align \\\\[0\\\\]u?int32; }; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^type _tu_size struct { ca \\\\[4\\\\+1\\\\]uint8; Godump_0_pad \\\\[.\\\\]byte; Godump_1_align \\\\[0\\\\]u?int64; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^var _s_nested struct { u struct { s int16; Godump_0_pad \\\\[2\\\\]byte; Godump_1_align \\\\[0\\\\]u?int32; }; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^var _s_nested2 struct { u struct { Godump_0_pad \\\\[4\\\\]byte; Godump_1_pad \\\\[2\\\\]byte; s int16; c int8; Godump_2_pad
+\\\\[1\\\\]byte; Godump_3_pad \\\\[2\\\\]byte; Godump_4_align \\\\[0\\\\]u?int32; }; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^var _sbf_gaps struct { bf1 uint8; c uint8; bf2 uint8; Godump_0_pad \\\\[2\\\\]byte; s uint16; Godump_1_align \\\\[0\\\\]int32; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^var _sbf_pad16_1 struct { Godump_0_pad \\\\[1\\\\]byte; c uint8; Godump_1_align \\\\[0\\\\]int16; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^var _sbf_pad16_2 struct { Godump_0_pad \\\\[2\\\\]byte; c uint8; Godump_1_pad \\\\[.\\\\]byte; Godump_2_align \\\\[0\\\\]int16; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^var _sbf_pad32_1 struct { Godump_0_pad \\\\[1\\\\]byte; c uint8; Godump_1_pad \\\\[.\\\\]byte; Godump_2_align \\\\[0\\\\]int32; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^var _sbf_pad32_2 struct { Godump_0_pad \\\\[4\\\\]byte; c uint8; Godump_1_pad \\\\[.\\\\]byte; Godump_2_align \\\\[0\\\\]int32; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^var _sbf_pad64_1 struct { Godump_0_pad \\\\[1\\\\]byte; c uint8; Godump_1_pad \\\\[.\\\\]byte; Godump_2_align \\\\[0\\\\]int64; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^var _sbf_pad64_2 struct { Godump_0_pad \\\\[8\\\\]byte; c uint8; Godump_1_pad \\\\[.\\\\]byte; Godump_2_align \\\\[0\\\\]int64; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^var _sn_anon struct { a uint8; s uint16; b uint8; Godump_0_pad \\\\[.\\\\]byte; Godump_1_align \\\\[0\\\\]int16; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^var _su_anon struct { c uint8; Godump_0_pad \\\\[7\\\\]byte; Godump_1_align \\\\[0\\\\]u?int64; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^var _u1 struct { c uint8; Godump_0_pad \\\\[.\\\\]byte; Godump_1_align \\\\[0\\\\]u?int64; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^var _u3_size struct { ca \\\\[4\\\\+1\\\\]uint8; Godump_0_pad \\\\[.\\\\]byte; Godump_1_align \\\\[0\\\\]u?int64; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^var _u_nested struct { u struct { s int16; Godump_0_pad \\\\[2\\\\]byte; Godump_1_align \\\\[0\\\\]u?int32; }; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^var _u_nested2 struct { u struct { Godump_0_pad \\\\[4\\\\]byte; Godump_1_pad \\\\[2\\\\]byte; s int16; c int8; Godump_2_pad
+\\\\[1\\\\]byte; Godump_3_pad \\\\[2\\\\]byte; Godump_4_align \\\\[0\\\\]u?int32; }; }\$
+FAIL: gcc.misc-tests/godump-1.c scan-file (?n)^var _u_size struct { ca \\\\[4\\\\+1\\\\]uint8; Godump_0_pad \\\\[.\\\\]byte; Godump_1_align \\\\[0\\\\]u?int64; }\$
on x86_64-linux.

The following patch adjusts the testcase for the above change.

2022-01-01  Jakub Jelinek  <jakub@redhat.com>

	* gcc.misc-tests/godump-1.c: Adjust for renaming of last
	field from _align suffix to _ suffix.
2022-01-01 06:30:39 +01:00
Jakub Jelinek
222dbebefb objc: Fix handling of break stmt inside of switch inside of ObjC foreach [PR103639]
The r11-3302-g3696a50beeb73f changes broke the following ObjC testcase.
in_statement is either 0 (not in a looping statement), various IN_* flags
for various kinds of looping statements (or OpenMP structured blocks) or
those flags ored with IN_SWITCH_STMT when a switch appears inside of those
contexts.  This is because break binds to switch in that last case, but
continue binds to the looping construct in that case.
The c_finish_bc_stmt function performs diagnostics on incorrect
break/continue uses and then checks if in_statement & IN_OBJC_FOREACH
and in that case jumps to the label provided by the caller, otherwise
emits a BREAK_STMT or CONTINUE_STMT.  This is incorrect if we have
ObjC foreach with switch nested in it and break inside of that,
in_statement in that case is IN_OBJC_FOREACH | IN_SWITCH_STMT and
is_break is true.  We want to handle it like other breaks inside of
switch, i.e. emit a BREAK_STMT.

The following patch fixes that.

2022-01-01  Jakub Jelinek  <jakub@redhat.com>

	PR objc/103639
	* c-typeck.c (c_finish_bc_stmt): For break inside of switch inside of
	ObjC foreach, emit normal BREAK_STMT rather than goto to label.

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

	PR objc/103639
	* objc.dg/pr103639.m: New test.
2022-01-01 06:29:36 +01:00
GCC Administrator
f17d2677bc Daily bump. 2022-01-01 00:16:17 +00:00
Francois-Xavier Coudert
cb48166e52 Fortran: Fix test on targets without REAL128
REAL128 is a named constant, so we cannot simply use
(REAL128 > 0) to conditionally compile for targets with
REAL128.

gcc/testsuite/ChangeLog:

	PR fortran/89639
	* gfortran.dg/ieee/ieee_9.f90: Adjust test for targets without
	REAL128.
2021-12-31 23:19:34 +01:00