aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2023-07-29Daily bump.GCC Administrator4-1/+314
2023-07-29PR modula2/109879 WholeIO.ReadCard and ReadInt should consume leading spaceGaius Mulley9-38/+202
The Read{TYPE} procedures in LongIO, LongWholeIO, RealIO, ShortWholeIO and WholeIO all require skip space functionality. A new module TextUtil is supplied with this functionality and the previous modules have been changed to call SkipSpaces. gcc/m2/ChangeLog: PR modula2/109879 * gm2-libs-iso/LongIO.mod (ReadReal): Call SkipSpaces. * gm2-libs-iso/LongWholeIO.mod (ReadInt): Call SkipSpaces. (ReadCard): Call SkipSpaces. * gm2-libs-iso/RealIO.mod (ReadReal): Call SkipSpaces. * gm2-libs-iso/ShortWholeIO.mod: (ReadInt): Call SkipSpaces. (ReadCard): Call SkipSpaces. * gm2-libs-iso/TextIO.mod: Import SkipSpaces. * gm2-libs-iso/WholeIO.mod (ReadInt): Call SkipSpaces. (ReadCard): Call SkipSpaces. * gm2-libs-iso/TextUtil.def: New file. * gm2-libs-iso/TextUtil.mod: New file. libgm2/ChangeLog: PR modula2/109879 * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * libm2cor/Makefile.in: Regenerate. * libm2iso/Makefile.am (M2DEFS): Add TextUtil.def. (M2MODS): Add TextUtil.mod. * libm2iso/Makefile.in: Regenerate. * libm2log/Makefile.in: Regenerate. * libm2min/Makefile.in: Regenerate. * libm2pim/Makefile.in: Regenerate. gcc/testsuite/ChangeLog: PR modula2/109879 * gm2/isolib/run/pass/testreadint.mod: New test. (cherry picked from commit 509eef9314b24eff20a5dbdd92f6ab52e2c0c786) Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-07-28[PATCH] PR modula2/108344 disable default opening of /dev/ttyGaius Mulley1-17/+20
This patch changes removes the static initialisation code for KeyBoardLEDs.cc. The module is only initialised if one of the exported functions is called. This is useful as the module will access /dev/tty which might not be available. TimerHandler.mod has also been changed to disable the scroll lock LED as a sign of life. gcc/m2/ChangeLog: PR modula2/108344 * gm2-libs-coroutines/TimerHandler.mod (EnableLED): New constant. (Timer): Test EnableLED before switching on the scroll LED. libgm2/ChangeLog: PR modula2/108344 * libm2cor/KeyBoardLEDs.cc (initialize_module): New function. (SwitchScroll): Call initialize_module. (SwitchNum): Call initialize_module. (SwitchCaps): Call initialize_module. (SwitchLEDs): Call initialize_module. (M2EXPORT): Remove initialization code. (cherry picked from commit cf4dcfa6727b89362494bd49e2a28ebd10d767ce) Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-07-28Update gcc .po filesJoseph Myers19-61503/+61504
* 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.
2023-07-28PR modula2/109830 m2iso library SeqFile.mod appending to a file overwrites ↵Gaius Mulley2-21/+101
content This patch is for the m2iso library SeqFile.mod to fix a bug when a file is opened using OpenAppend. The patch checks to see if the file exists and it uses FIO.OpenForRandom to ensure the file is not overwritten. gcc/m2/ChangeLog: PR modula2/109830 * gm2-libs-iso/SeqFile.mod (newCid): New parameter toAppend used to select FIO.OpenForRandom. (OpenRead): Pass extra parameter to newCid. (OpenWrite): Pass extra parameter to newCid. (OpenAppend): Pass extra parameter to newCid. gcc/testsuite/ChangeLog: PR modula2/109830 * gm2/isolib/run/pass/seqappend.mod: New test. (cherry picked from commit 1953c0cfb006a696723baa7d5ea14038f6d901a4) Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-07-28PR modula2/109810 ICE fix when an array is assigned by a larger stringGaius Mulley6-139/+183
This patch fixes an ICE when an array variable is assigned with a string which exceeds the array size. It improves the accuracy of the virtual token used to indicate the error message. gcc/m2/ChangeLog: PR modula2/109810 * gm2-compiler/M2ALU.mod (ConvertConstToType): Use PrepareCopyString in place of DoCopyString. * gm2-compiler/M2GenGCC.def (DoCopyString): Rename to ... (PrepareCopyString): ... this. * gm2-compiler/M2GenGCC.mod (CodeStatement): Call CodeReturnValue with a single parameter. Call CodeXIndr with a single parameter. (CodeReturnValue): Remove parameters and replace with a single quadno. Reimplement using PrepareCopyString. Issue error if the string exceeds designator space. (DoCopyString): Reimplement and rename to ... (PrepareCopyString): ... this. (CodeXIndr): Remove parameters and replace with a single quadno. Reimplement using PrepareCopyString. Issue error if the string exceeds designator space. (CodeBecomes): Remove parameters and replace with a single quadno. Reimplement using PrepareCopyString. Issue error if the string exceeds designator space. * gm2-compiler/M2Quads.def (BuildReturn): Rename parameter to tokreturn. * gm2-compiler/M2Quads.mod (BuildReturn): Rename parameter to tokreturn. Rename tokno to tokcombined. gcc/testsuite/ChangeLog: PR modula2/109810 * gm2/pim/fail/highice.mod: New test. (cherry picked from commit c787f593e62869ae0b230949b4791f4f3a26e50e) Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-07-28PR modula2/109779 isolib SkipLine skips the first character of the ↵Gaius Mulley3-67/+141
successive line This is a patch for the m2iso library to prevent SkipLine from consuming the next character on the next line. gcc/m2/ChangeLog: PR modula2/109779 * gm2-libs-iso/RTgen.mod (doLook): Remove old. Remove re-assignment of result. * gm2-libs-iso/TextIO.mod (CanRead): Rename into ... (CharAvailable): ... this. (DumpState): New procedure. (SetResult): Rename as SetNul. (WasGoodChar): Rename into ... (EofOrEoln): ... this. (SkipLine): Skip over the newline. (ReadString): Flip THEN ELSE statements after testing for EofOrEoln. (ReadRestLine): Flip THEN ELSE statements after testing for EofOrEoln. gcc/testsuite/ChangeLog: PR modula2/109779 * gm2/isolib/run/pass/skiplinetest.mod: New test. (cherry picked from commit 434dade5a11f63533cbf6059a862856c9b11c711) Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-07-28PR modula2/109729 cannot use a CHAR type as a FOR loop iteratorGaius Mulley4-30/+85
This patch introduces a new quadruple ArithAddOp which is used in the construction of FOR loop to ensure that when constant folding is applied it does not concatenate two constant char operands into a string constant. Overloading only occurs with constant operands. gcc/m2/ChangeLog: PR modula2/109729 PR modula2/110246 * gm2-compiler/M2GenGCC.mod (CodeStatement): Detect ArithAddOp and call CodeAddChecked. (ResolveConstantExpressions): Detect ArithAddOp and call FoldArithAdd. (FoldArithAdd): New procedure. (FoldAdd): Refactor to use FoldArithAdd. * gm2-compiler/M2Quads.def (QuadOperator): Add ArithAddOp. * gm2-compiler/M2Quads.mod: Remove commented imports. (QuadFrame): Changed comments to use GNU coding standards. (ArithPlusTok): New global variable. (BuildForToByDo): Use ArithPlusTok instead of PlusTok. (MakeOp): Detect ArithPlusTok and return ArithAddOp. (WriteQuad): Add ArithAddOp clause. (WriteOperator): Add ArithAddOp clause. (Init): Initialize ArithPlusTok. gcc/testsuite/ChangeLog: PR modula2/109729 * gm2/pim/run/pass/ForChar.mod: New test. (cherry picked from commit ac7c9954ece9a75c5e7c3b76a4800f2432002487) Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-07-28modula2: Remove M2LINK.o from m2/m2obj3/cc1gm2 in Make-maintainer.inGaius Mulley1-2/+2
This patch removes M2LINK.o from m2/m2obj3/cc1gm2. gcc/m2/ChangeLog: * Make-maintainer.in (m2/m2obj3/cc1gm2$(exeext)): Remove M2LINK.o from dependency and build rule. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-07-28PR modula2/109675 implementation of writeAddress is non portableGaius Mulley92-1132/+1137
The implementation of gcc/m2/gm2-libs/DynamicStrings.mod:writeAddress is non portable as it casts a void * into an unsigned long int. This procedure has been re-implemented to use snprintf. As it is a library the support tools 'mc' and 'pge' have been rebuilt. There have been linking changes in the library and the underlying boolean type is now bool since the last rebuild hence the size of the patch. gcc/m2/ChangeLog: PR modula2/109675 * Make-lang.in (MC-LIB-DEFS): Remove M2LINK.def. (BUILD-PGE-O): Remove GM2LINK.o. * Make-maintainer.in (PPG-DEFS): New define. (PPG-LIB-DEFS): Remove M2LINK.def. (BUILD-BOOT-PPG-H): Add PPGDEF .h files. (m2/ppg$(exeext)): Remove M2LINK.o (PGE-DEPS): New define. (m2/pg$(exeext)): Remove M2LINK.o. (m2/gm2-pge-boot/$(SRC_PREFIX)%.o): Add -Im2/gm2-pge-boot. (m2/pge$(exeext)): Remove M2LINK.o. (pge-maintainer): Re-implement. (pge-libs-push): Re-implement. (m2/m2obj3/cc1gm2$(exeext)): Remove M2LINK.o. * gm2-libs/DynamicStrings.mod (writeAddress): Re-implement using snprintf. * gm2-libs/M2Dependent.mod: Remove commented out imports. * mc-boot/GDynamicStrings.cc: Rebuild. * mc-boot/GFIO.cc: Rebuild. * mc-boot/GFormatStrings.cc: Rebuild. * mc-boot/GM2Dependent.cc: Rebuild. * mc-boot/GM2Dependent.h: Rebuild. * mc-boot/GM2RTS.cc: Rebuild. * mc-boot/GM2RTS.h: Rebuild. * mc-boot/GRTExceptions.cc: Rebuild. * mc-boot/GRTint.cc: Rebuild. * mc-boot/GSFIO.cc: Rebuild. * mc-boot/GStringConvert.cc: Rebuild. * mc-boot/Gdecl.cc: Rebuild. * pge-boot/GASCII.cc: Rebuild. * pge-boot/GASCII.h: Rebuild. * pge-boot/GArgs.cc: Rebuild. * pge-boot/GArgs.h: Rebuild. * pge-boot/GAssertion.cc: Rebuild. * pge-boot/GAssertion.h: Rebuild. * pge-boot/GBreak.h: Rebuild. * pge-boot/GCmdArgs.h: Rebuild. * pge-boot/GDebug.cc: Rebuild. * pge-boot/GDebug.h: Rebuild. * pge-boot/GDynamicStrings.cc: Rebuild. * pge-boot/GDynamicStrings.h: Rebuild. * pge-boot/GEnvironment.h: Rebuild. * pge-boot/GFIO.cc: Rebuild. * pge-boot/GFIO.h: Rebuild. * pge-boot/GFormatStrings.h:: Rebuild. * pge-boot/GFpuIO.h:: Rebuild. * pge-boot/GIO.cc: Rebuild. * pge-boot/GIO.h: Rebuild. * pge-boot/GIndexing.cc: Rebuild. * pge-boot/GIndexing.h: Rebuild. * pge-boot/GLists.cc: Rebuild. * pge-boot/GLists.h: Rebuild. * pge-boot/GM2Dependent.cc: Rebuild. * pge-boot/GM2Dependent.h: Rebuild. * pge-boot/GM2EXCEPTION.cc: Rebuild. * pge-boot/GM2EXCEPTION.h: Rebuild. * pge-boot/GM2RTS.cc: Rebuild. * pge-boot/GM2RTS.h: Rebuild. * pge-boot/GNameKey.cc: Rebuild. * pge-boot/GNameKey.h: Rebuild. * pge-boot/GNumberIO.cc: Rebuild. * pge-boot/GNumberIO.h: Rebuild. * pge-boot/GOutput.cc: Rebuild. * pge-boot/GOutput.h: Rebuild. * pge-boot/GPushBackInput.cc: Rebuild. * pge-boot/GPushBackInput.h: Rebuild. * pge-boot/GRTExceptions.cc: Rebuild. * pge-boot/GRTExceptions.h: Rebuild. * pge-boot/GSArgs.h: Rebuild. * pge-boot/GSEnvironment.h: Rebuild. * pge-boot/GSFIO.cc: Rebuild. * pge-boot/GSFIO.h: Rebuild. * pge-boot/GSYSTEM.h: Rebuild. * pge-boot/GScan.h: Rebuild. * pge-boot/GStdIO.cc: Rebuild. * pge-boot/GStdIO.h: Rebuild. * pge-boot/GStorage.cc: Rebuild. * pge-boot/GStorage.h: Rebuild. * pge-boot/GStrCase.cc: Rebuild. * pge-boot/GStrCase.h: Rebuild. * pge-boot/GStrIO.cc: Rebuild. * pge-boot/GStrIO.h: Rebuild. * pge-boot/GStrLib.cc: Rebuild. * pge-boot/GStrLib.h: Rebuild. * pge-boot/GStringConvert.h: Rebuild. * pge-boot/GSymbolKey.cc: Rebuild. * pge-boot/GSymbolKey.h: Rebuild. * pge-boot/GSysExceptions.h: Rebuild. * pge-boot/GSysStorage.cc: Rebuild. * pge-boot/GSysStorage.h: Rebuild. * pge-boot/GTimeString.h: Rebuild. * pge-boot/GUnixArgs.h: Rebuild. * pge-boot/Gbnflex.cc: Rebuild. * pge-boot/Gbnflex.h: Rebuild. * pge-boot/Gdtoa.h: Rebuild. * pge-boot/Gerrno.h: Rebuild. * pge-boot/Gldtoa.h: Rebuild. * pge-boot/Glibc.h: Rebuild. * pge-boot/Glibm.h: Rebuild. * pge-boot/Gpge.cc: Rebuild. * pge-boot/Gtermios.h: Rebuild. * pge-boot/Gwrapc.h: Rebuild. * mc-boot/GM2LINK.h: Removed. * pge-boot/GM2LINK.cc: Removed. * pge-boot/GM2LINK.h: Removed. (cherry picked from commit 9525daf0fbc5c836ee028f5b58612857de7da51d) Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-07-28PR modula2/108121 Re-implement overflow detection for constant literalsGaius Mulley12-354/+188
This patch fixes the overflow detection for constant literals. The ZTYPE is changed to int128 (or int64) if int128 is unavailable and constant literals are built from widest_int. The widest_int is converted into the tree type and checked for overflow. m2expr_interpret_integer and append_m2_digit are removed. gcc/m2/ChangeLog: PR modula2/108121 * gm2-compiler/M2ALU.mod (Less): Reformatted. * gm2-compiler/SymbolTable.mod (DetermineSizeOfConstant): Remove from import. (ConstantStringExceedsZType): Import. (GetConstLitType): Re-implement using ConstantStringExceedsZType. * gm2-gcc/m2decl.cc (m2decl_DetermineSizeOfConstant): Remove. (m2decl_ConstantStringExceedsZType): New function. (m2decl_BuildConstLiteralNumber): Re-implement. * gm2-gcc/m2decl.def (DetermineSizeOfConstant): Remove. (ConstantStringExceedsZType): New function. * gm2-gcc/m2decl.h (m2decl_DetermineSizeOfConstant): Remove. (m2decl_ConstantStringExceedsZType): New function. * gm2-gcc/m2expr.cc (append_digit): Remove. (m2expr_interpret_integer): Remove. (append_m2_digit): Remove. (m2expr_StrToWideInt): New function. (m2expr_interpret_m2_integer): Remove. * gm2-gcc/m2expr.def (CheckConstStrZtypeRange): New function. * gm2-gcc/m2expr.h (m2expr_StrToWideInt): New function. * gm2-gcc/m2type.cc (build_m2_word64_type_node): New function. (build_m2_ztype_node): New function. (m2type_InitBaseTypes): Call build_m2_ztype_node. * gm2-lang.cc (gm2_type_for_size): Re-write using early returns. gcc/testsuite/ChangeLog: PR modula2/108121 * gm2/pim/fail/largeconst.mod: Increased constant value test to fail now that cc1gm2 uses widest_int to represent a ZTYPE. * gm2/pim/fail/largeconst2.mod: New test. (cherry picked from commit 68201409bc2867da45791331e385198826fa4576) Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-07-28Daily bump.GCC Administrator5-1/+96
2023-07-27modula2: Add -lnsl -lsocket libraries to gcc/testsuite/lib/gm2.expGaius Mulley1-0/+4
Solaris requires -lnsl -lsocket (present in the driver) but not when running the testsuite. This patch tests target for *-*-solaris2 and conditionally appends the above libraries. gcc/testsuite/ChangeLog: * lib/gm2.exp (gm2_target_compile_default): Conditionally append -lnsl -lsocket to ldflags. (cherry picked from commit 8d7223f65799b170b1314a35bb98249d419e7215) Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-07-27PR modula2/109586 cc1gm2 ICE when compiling large source files.Gaius Mulley1-2/+2
The function m2block_RememberConstant calls m2tree_IsAConstant. However IsAConstant does not recognise TREE_CODE(t) == CONSTRUCTOR as a constant. Without this patch CONSTRUCTOR contants are garbage collected (and not preserved) resulting in a corrupt tree and crash. gcc/m2/ChangeLog: PR modula2/109586 * gm2-gcc/m2tree.cc (m2tree_IsAConstant): Add (TREE_CODE (t) == CONSTRUCTOR) to expression. (cherry picked from commit a7e1ee39e4fa37d005929c4ff9457d1a199559c6) Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-07-27range-op-float: Fix up -frounding-math frange_arithmetic +- handling [PR110755]Jakub Jelinek2-0/+47
IEEE754 says that x + (-x) and x - x result in +0 in all rounding modes but rounding towards negative infinity, in which case the result is -0 for all finite x. x + x and x - (-x) if it is zero retain sign of x. Now, range_arithmetic implements the normal rounds to even rounding, and as the addition or subtraction in those cases is exact, we don't do any further rounding etc. and e.g. on the testcase below distilled from glibc compute a range [+0, +INF], which is fine for -fno-rounding-math or if we'd have a guarantee that those statements aren't executed with rounding towards negative infinity. I believe it is only +- which has this problematic behavior and I think it is best to deal with it in frange_arithmetic; if we know -frounding-math is on, it is x + (-x) or x - x and we are asked to round to negative infinity (i.e. want low bound rather than high bound), change +0 result to -0. 2023-07-26 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/110755 * range-op-float.cc (frange_arithmetic): Change +0 result to -0 for PLUS_EXPR or MINUS_EXPR if -frounding-math, inf is negative and it is exact op1 + (-op1) or op1 - op1. * gcc.dg/pr110755.c: New test. (cherry picked from commit 21da32d995c8b574c929ec420cd3b0fcfe6fa4fe)
2023-07-27OpenMP/Fortran: Fix target + teams diagnostic with metadirectivesTobias Burnus4-9/+41
gcc/fortran/ChangeLog: * gfortran.h (gfc_omp_clauses): Rename target_first_st_is_teams to target_first_st_is_teams_or_meta. * parse.cc (parse_omp_structured_block): Handle metadirectives for target_first_st_is_teams. * openmp.cc (resolve_omp_target): Likewise to fix target+teams diagnostic with metadirectives. libgomp/ChangeLog: * testsuite/libgomp.fortran/metadirective-1.f90: Extend. * testsuite/libgomp.fortran/metadirective-6.f90: New test.
2023-07-27OpenMP/Fortran: Extend reject code between target + teams [PR71065, PR110725]Tobias Burnus5-33/+53
The previous version failed to diagnose when the 'teams' was nested more deeply inside the target region, e.g. inside a DO or some block or structured block. PR fortran/110725 PR middle-end/71065 gcc/fortran/ChangeLog: * openmp.cc (resolve_omp_target): Minor cleanup. * parse.cc (decode_omp_directive): Find TARGET statement also higher in the stack. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/teams-6.f90: Extend. (cherry picked from commit 081e25d3cfd86c4094999ded0bbe99b91762013c)
2023-07-27c++: unifying REAL_CSTs [PR110809]Patrick Palka2-2/+15
This teaches unify how to compare two REAL_CSTs. PR c++/110809 gcc/cp/ChangeLog: * pt.cc (unify) <case INTEGER_CST>: Generalize to handle REAL_CST as well. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/nontype-float3.C: New test. (cherry picked from commit 744e1f35266dbd6b6fb95c7e8422562815f8b56f)
2023-07-27openmp: Fix number of iterations computation for "omp unroll full"Frederik Harwath2-24/+146
gcc/ChangeLog: * omp-transform-loops.cc (gomp_for_number_of_iterations): Always compute "final - init" and do not take absolute value. Identify non-iterating and infinite loops for constant init, final, step values for better diagnostic messages, consistent behaviour in those corner cases, and better testability. (gomp_for_constant_iterations_p): Add new argument to pass on information about infinite loops, and ... (full_unroll): ... use from here to emit a warning and remove unrolled, known infinite loops consistently. (process_omp_for): Only print dump message if loop has not been removed by transformation. gcc/testsuite/ChangeLog: * c-c++-common/gomp/loop-transforms/unroll-8.c: New test.
2023-07-27openmp: Fix diagnostic message for "omp unroll"Frederik Harwath3-4/+4
gcc/ChangeLog: * omp-transform-loops.cc (print_optimized_unroll_partial_msg): Output "omp unroll partial" instead of "omp unroll auto". (optimize_transformation_clauses): Likewise. libgomp/ChangeLog: * testsuite/libgomp.fortran/loop-transforms/unroll-6.f90: Adjust. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/loop-transforms/unroll-8.f90: Adjust. * gfortran.dg/gomp/loop-transforms/unroll-9.f90: Adjust.
2023-07-27XFAIL parts broken deliberately by r13-1762-gf9d4c3b45c5ed5Richard Biener1-1/+1
The following XFAILs recognizing a complex store as memset. PR tree-optimization/110829 * gcc.dg/pr56837.c: XFAIL part of the testcase. (cherry picked from commit 41482832ad0aeaa0e4ae2f8d2beff17023cd00bf)
2023-07-27Merge branch 'releases/gcc-13' into devel/omp/gcc-13Tobias Burnus22-19254/+19683
Merge up to r13-7610-gf1d4b4f918a9c5b25a82b7bfccb08aa5e647f41c (27th July 2021) This is the GCC 13.2.0 release except for the follow-up commit "Bump BASE-VER" which sets the version to 13.2.1 to denote post-release branch development.
2023-07-27tree-optimization/110799 - fix bug in code hoistingRichard Biener2-5/+56
Code hoisting part of GIMPLE PRE failed to adjust the TBAA behavior of common loads in the case the alias set of the ref was the same but the base alias set was not. It also failed to adjust the base behavior, assuming it would match. The following plugs this hole. PR tree-optimization/110799 * tree-ssa-pre.cc (compute_avail): More thoroughly match up TBAA behavior of redundant loads. * gcc.dg/torture/pr110799.c: New testcase. (cherry picked from commit 565e0e80660dac24e5193873ca07542b99cd8bc3)
2023-07-27tree-optimization/110766 - missing PHI location checkRichard Biener2-0/+18
The following adds a missing PHI location check before querying the loop latch PHI arg from it. PR tree-optimization/110766 * tree-scalar-evolution.cc (analyze_and_compute_bitwise_induction_effect): Check the PHI is defined in the loop header. * gcc.dg/torture/pr110766.c: New testcase. (cherry picked from commit fb132cdfb204bc12851eb1d5852eef6f03c13af3)
2023-07-27Bump BASE-VERJakub Jelinek1-1/+1
2023-07-27 Jakub Jelinek <jakub@redhat.com> * BASE-VER: Set to 13.2.1.
2023-07-27Update ChangeLog and version files for releasereleases/gcc-13.2.0Jakub Jelinek18-1/+69
2023-07-27Daily bump.GCC Administrator2-1/+9
2023-07-26Update gcc uk.poJoseph Myers1-13/+13
* uk.po: Update.
2023-07-26Regenerate gcc.potJoseph Myers1-3194/+3232
* gcc.pot: Regenerate.
2023-07-26Daily bump.GCC Administrator2-1/+5
2023-07-25Update gcc uk.poJoseph Myers1-16049/+16356
* uk.po: Update.
2023-07-25OpenMP/Fortran: Reject declarations between target + teamsTobias Burnus6-12/+133
While commit r14-2754-g2e31fe431b08b0302e1fa8a1c18ee51adafd41df detected executable statements, declarations do not show up as executable statements. Hence, we now check whether the first statement after TARGET is TEAMS - such that we can detect data statements like type or variable declarations. Fortran semantics ensures that only executable directives/statemens can come after '!$omp end teams' such that those can be detected with the previous check. Note that statements returning ST_NONE such as 'omp nothing' or 'omp error at(compilation)' will still slip through. PR fortran/110725 PR middle-end/71065 gcc/fortran/ChangeLog: * gfortran.h (gfc_omp_clauses): Add target_first_st_is_teams. * parse.cc (parse_omp_structured_block): Set it if the first statement in the structured block of a TARGET is TEAMS or a combined/composite starting with TEAMS. * openmp.cc (resolve_omp_target): Also show an error for contains_teams_construct without target_first_st_is_teams. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/teams-6.f90: New test. (cherry picked from commit 09dda270380fe13e7b4722305cb1122df1f779a0)
2023-07-25ChangeLog.omp for: OpenMP/Fortran: Reject not strictly nested target -> ↵Tobias Burnus2-0/+23
teams [PR110725, PR71065] This adds missing the ChangeLog.omp entries for OG13 commit c05e6498ba9295835918a7abdf75b93f7842620f
2023-07-25OpenMP/Fortran: Reject not strictly nested target -> teams [PR110725, PR71065]Tobias Burnus5-3/+224
OpenMP requires: "If a teams region is nested inside a target region, the corresponding target construct must not contain any statements, declarations or directives outside of the corresponding teams construct." This commit checks now for this restriction. PR fortran/110725 PR middle-end/71065 gcc/fortran/ChangeLog: * gfortran.h (gfc_omp_clauses): Add contains_teams_construct. * openmp.cc (resolve_omp_target): New; check for teams nesting. (gfc_resolve_omp_directive): Call it. * parse.cc (decode_omp_directive): Set contains_teams_construct on enclosing ST_OMP_TARGET. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/pr99226.f90: Update dg-error. * gfortran.dg/gomp/teams-5.f90: New test. (cherry picked from commit 2e31fe431b08b0302e1fa8a1c18ee51adafd41df) With follow-up fix for pr99226.f90's dg-error update: cherry picked from commit 50656980497d77ac12a5e7179013a6af09ba32f7
2023-07-25Daily bump.GCC Administrator1-1/+1
2023-07-24Daily bump.GCC Administrator1-1/+1
2023-07-23Daily bump.GCC Administrator1-1/+1
2023-07-22Daily bump.GCC Administrator2-1/+5
2023-07-21Update gcc hr.poJoseph Myers1-9/+9
* hr.po: Update.
2023-07-21Merge remote-tracking branch 'releases/gcc-13' into devel/omp/gcc-13Tobias Burnus65-197/+913
Merge up to r13-7598-g3e95997a8dc905f0ac3a4243fb9dbf18dc70853b (21st July 2023) Except for the "Daily bump." that updated the DATESTAMP and generates ChangeLog files, that's idential to the GCC 13.2 RC (r13-7597-g9aac37ab8a7b91).
2023-07-21Daily bump.GCC Administrator3-1/+62
2023-07-20aarch64: Remove architecture dependencies from intrinsicsAndrew Carlotti13-10/+100
Many intrinsics currently depend on both an architecture version and a feature, despite the corresponding instructions being available within GCC at lower architecture versions. LLVM has already removed these explicit architecture version dependences; this patch does the same for GCC. Note that +fp16 does not imply +simd, so we need to add an explicit +simd for the Neon fp16 intrinsics. Binutils did not previously support all of these architecture+feature combinations, but this problem is already reachable from GCC. For example, compiling the test gcc.target/aarch64/usadv16qi-dotprod.c with -O3 -march=armv8-a+dotprod has resulted in an assembler error since GCC 10. This is fixed in Binutils 2.41. This patch retains explicit architecture version dependencies for features that do not currently have a separate feature flag. gcc/ChangeLog: * config/aarch64/aarch64.h (TARGET_MEMTAG): Remove armv8.5 dependency. * config/aarch64/arm_acle.h: Remove unnecessary armv8.x dependencies from target pragmas. * config/aarch64/arm_fp16.h (target): Likewise. * config/aarch64/arm_neon.h (target): Likewise. gcc/testsuite/ChangeLog: * gcc.target/aarch64/feature-bf16-backport.c: New test. * gcc.target/aarch64/feature-dotprod-backport.c: New test. * gcc.target/aarch64/feature-fp16-backport.c: New test. * gcc.target/aarch64/feature-fp16-scalar-backport.c: New test. * gcc.target/aarch64/feature-fp16fml-backport.c: New test. * gcc.target/aarch64/feature-i8mm-backport.c: New test. * gcc.target/aarch64/feature-memtag-backport.c: New test. * gcc.target/aarch64/feature-sha3-backport.c: New test. * gcc.target/aarch64/feature-sm4-backport.c: New test.
2023-07-20Revert "Use PTEST to perform AND in TImode STV of (A & B) != 0 on x86_64."Richard Biener5-129/+27
This reverts commit a56c1641e9d25e46059168e811b4a2f185f07b6b.
2023-07-20Correct Granite Rapids{, D} documentationHaochen Jiang1-6/+6
gcc/Changelog: * doc/invoke.texi: Remove AVX512VP2INTERSECT in Granite Rapids{, D} from documentation.
2023-07-20Daily bump.GCC Administrator4-1/+88
2023-07-19c++: constrained surrogate call functions [PR110535]Patrick Palka3-0/+34
We weren't checking constraints on pointer/reference-to-function conversion functions during overload resolution, which caused us to ICE on the first testcase and reject the second testcase. PR c++/110535 gcc/cp/ChangeLog: * call.cc (add_conv_candidate): Check constraints. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-surrogate1.C: New test. * g++.dg/cpp2a/concepts-surrogate2.C: New test. (cherry picked from commit 1e0f37df1b12cd91a6dbb523f5c722f9a961edaa)
2023-07-19c++: extend lookup_template_class shortcut [PR110122]Patrick Palka3-4/+60
Here when substituting the injected class name A during regeneration of the lambda, we find ourselves in lookup_template_class for A<V> with V=_ZTAXtl3BarEE (i.e. the template parameter object for Foo{}). The call to coerce_template_parms within then undesirably tries to make a copy of this class NTTP argument, which fails because Foo is not copyable. But it seems clear that this testcase shouldn't require copyability of Foo. lookup_template_class has a shortcut for looking up the current class scope, which would avoid the problematic coerce_template_parms call, but the shortcut doesn't trigger because it only considers the innermost class scope which in this case in the lambda type. So this patch fixes this by extending the lookup_template_class shortcut to consider outer class scopes too (and skipping over lambda types since they are never specialized from lookup_template_class). We also need to avoid calling coerce_template_parms when specializing a templated non-template nested class for the first time (such as A::B in the testcase). Coercion should be unnecessary there because the innermost arguments belong to the context and so should have already been coerced. PR c++/110122 gcc/cp/ChangeLog: * pt.cc (lookup_template_class): Extend shortcut for looking up the current class scope to consider outer class scopes too, and use current_nonlambda_class_type instead of current_class_type. Only call coerce_template_parms when specializing a primary template. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/nontype-class57.C: New test. * g++.dg/cpp2a/nontype-class58.C: New test. (cherry picked from commit 682d401a6ba723b2bf98779d056efc8ff2640178)
2023-07-19wide-int: Fix up wi::divmod_internal [PR110731]Jakub Jelinek2-2/+19
As the following testcase shows, wi::divmod_internal doesn't handle correctly signed division with precision > 64 when the dividend (and likely divisor as well) is the type's minimum and the precision isn't divisible by 64. A few lines above what the patch hunk changes is: /* Make the divisor and dividend positive and remember what we did. */ if (sgn == SIGNED) { if (wi::neg_p (dividend)) { neg_dividend = -dividend; dividend = neg_dividend; dividend_neg = true; } if (wi::neg_p (divisor)) { neg_divisor = -divisor; divisor = neg_divisor; divisor_neg = true; } } i.e. we negate negative dividend or divisor and remember those. But, after we do that, when unpacking those values into b_dividend and b_divisor we need to always treat the wide_ints as UNSIGNED, because divmod_internal_2 performs an unsigned division only. Now, if precision <= 64, we don't reach here at all, earlier code handles it. If dividend or divisor aren't the most negative values, the negation clears their most significant bit, so it doesn't really matter if we unpack SIGNED or UNSIGNED. And if precision is multiple of HOST_BITS_PER_WIDE_INT, there is no difference in behavior, while -0x80000000000000000000000000000000 negates to -0x80000000000000000000000000000000 the unpacking of it as SIGNED or UNSIGNED works the same. In the testcase, we have signed precision 119 and the dividend is val = { 0, 0xffc0000000000000 }, len = 2, precision = 119 both before and after negation. Divisor is val = { 2 }, len = 1, precision = 119 But we really want to divide 0x400000000000000000000000000000 by 2 unsigned and then negate at the end. If it is unsigned precision 119 division 0x400000000000000000000000000000 by 2 dividend is val = { 0, 0xffc0000000000000 }, len = 2, precision = 119 but as we unpack it UNSIGNED, it is unpacked into 0, 0, 0, 0x00400000 The following patch fixes it by always using UNSIGNED unpacking because we've already negated negative values at that point if sgn == SIGNED and so most negative constants should be treated as positive. 2023-07-19 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/110731 * wide-int.cc (wi::divmod_internal): Always unpack dividend and divisor as UNSIGNED regardless of sgn. * gcc.dg/pr110731.c: New test. (cherry picked from commit ece799607c841676f4e00c2fea98bbec6976da3f)
2023-07-19gfortran.dg/gomp/affinity-clause-1.f90: Fix scan-tree-dumpTobias Burnus2-2/+6
gcc/testsuite/ * gfortran.dg/gomp/affinity-clause-1.f90: Fix scan-tree-dump.
2023-07-19testsuite: Require vectors of doubles for pr97428.cMaciej W. Rozycki1-0/+1
The pr97428.c test assumes support for vectors of doubles, but some targets only support vectors of floats, causing this test to fail with such targets. Limit this test to targets that support vectors of doubles then. gcc/testsuite/ * gcc.dg/vect/pr97428.c: Limit to `vect_double' targets. (cherry picked from commit 5d9fc2aced3a2128527afd4a627424542f238471)