]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
7 months agotestsuite: arm: Mark pr81812.C as xfail for thumb1
Torbjörn SVENSSON [Sun, 10 Nov 2024 19:15:13 +0000 (20:15 +0100)] 
testsuite: arm: Mark pr81812.C as xfail for thumb1

Test fails for Cortex-M0 with:

.../pr81812.C:6:8: error: generic thunk code fails for method 'virtual void ChildNode::_ZTv0_n12_NK9ChildNode5errorEz(...) const' which uses '...'

According to PR108277, it's expected that thumb1 targets does not
support empty virtual functions with ellipsis.

gcc/testsuite/ChangeLog:

* g++.dg/torture/pr81812.C: Add xfail for thumb1.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
(cherry picked from commit f111d8e20b671ee97d4ed835102839e44a2a2edc)

7 months agoFortran: Pointer fcn results must not be finalized [PR117897]
Paul Thomas [Sun, 15 Dec 2024 10:42:34 +0000 (10:42 +0000)] 
Fortran: Pointer fcn results must not be finalized [PR117897]

2024-12-15  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/117897
* trans-expr.cc (gfc_trans_assignment_1): RHS pointer function
results must not be finalized.

gcc/testsuite/
PR fortran/117897
* gfortran.dg/finalize_59.f90: New test.

(cherry picked from commit a87bf1d20a37bb69c9fa6d2211ffd963aa69240d)

7 months agoDaily bump.
GCC Administrator [Tue, 17 Dec 2024 00:25:13 +0000 (00:25 +0000)] 
Daily bump.

7 months agoUpdate cpplib sr.po
Joseph Myers [Mon, 16 Dec 2024 23:53:42 +0000 (23:53 +0000)] 
Update cpplib sr.po

* sr.po: Update.

7 months agolibstdc++: Fix typo in Doxygen comment in <format>
Jonathan Wakely [Sat, 7 Dec 2024 01:34:33 +0000 (01:34 +0000)] 
libstdc++: Fix typo in Doxygen comment in <format>

libstdc++-v3/ChangeLog:

* include/std/format: Fix typo in Doxygen comment.

(cherry picked from commit b7dd0d976022c5ba20d9d676e2f684614231eb72)

7 months agodoc: Fix typos for --enable-host-pie docs in install.texi
Heiko Eißfeldt [Sat, 14 Dec 2024 12:31:58 +0000 (12:31 +0000)] 
doc: Fix typos for --enable-host-pie docs in install.texi

gcc/ChangeLog:

* doc/install.texi (Configuration): Fix typos in documentation
for --enable-host-pie.

(cherry picked from commit a7df4961d171ef071bd0972335d6f116d420eb13)

7 months agoada: Fix internal error with Atomic Volatile_Full_Access object
Eric Botcazou [Thu, 22 Aug 2024 19:18:15 +0000 (21:18 +0200)] 
ada: Fix internal error with Atomic Volatile_Full_Access object

The initial implementation of the GNAT aspect/pragma Volatile_Full_Access
made it incompatible with Atomic, because it was not decided whether the
read-modify-write sequences generated by Volatile_Full_Access would need
to be implemented atomically when Atomic was also specified, which would
have required a compare-and-swap primitive from the target architecture.

But Ada 2022 introduced Full_Access_Only and retrofitted it into Atomic
in the process, answering the above question by the negative, so the
incompatibility between Volatile_Full_Access and Atomic was lifted in
Ada 2012 as well, unfortunately without adjusting the implementation.

gcc/ada/

* gcc-interface/trans.cc (get_atomic_access): Deal specifically with
nodes that are both Atomic and Volatile_Full_Access in Ada 2012.

7 months agoDaily bump.
GCC Administrator [Mon, 16 Dec 2024 00:23:19 +0000 (00:23 +0000)] 
Daily bump.

7 months agoFortran: Fix non_overridable typebound proc problems [PR84674/117730].
Paul Thomas [Sun, 15 Dec 2024 14:48:59 +0000 (14:48 +0000)] 
Fortran: Fix non_overridable typebound proc problems [PR84674/117730].

2024-12-15  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran/ChangeLog

PR fortran/117730
PR fortran/84674
* class.cc (add_proc_comp): If the present typebound procedure
component is abstract, unconditionally check the replacement.
Only reject a non_overridable if it has no overridden procedure
and the component is already present in the vtype.

gcc/testsuite/ChangeLog

PR fortran/117730
* gfortran.dg/pr117730_a.f90: New test.
* gfortran.dg/pr117730_b.f90: New test.

PR fortran/84674
* gfortran.dg/pr84674.f90: New test.

7 months agoDaily bump.
GCC Administrator [Sun, 15 Dec 2024 00:23:20 +0000 (00:23 +0000)] 
Daily bump.

7 months ago[PATCH] PR modula2/117120: case ch with a nul char constant causes ICE
Gaius Mulley [Sat, 14 Dec 2024 11:46:57 +0000 (11:46 +0000)] 
[PATCH] PR modula2/117120: case ch with a nul char constant causes ICE

This patch fixes the ICE caused when a case clause contains
a character constant ''.  The fix was to walk the caselist and
convert any 0 length string into a char constant of value 0.

gcc/m2/ChangeLog:

PR modula2/117120
* gm2-compiler/M2CaseList.mod (CaseBoundsResolved): Rewrite.
(ConvertNulStr2NulChar): New procedure function.
(NulStr2NulChar): Ditto.
(GetCaseExpression): Ditto.
(OverlappingCaseBound): Rewrite.
* gm2-compiler/M2GCCDeclare.mod (CheckResolveSubrange): Allow
'' to be used as the subrange low limit.
* gm2-compiler/M2GenGCC.mod (FoldConvert): Rewrite.
(PopKindTree): Ditto.
(BuildHighFromString): Reformat.
* gm2-compiler/SymbolTable.mod (PushConstString): Add test for
length 0 and PushChar (nul).

gcc/testsuite/ChangeLog:

PR modula2/117120
* gm2/pim/pass/forloopnulchar.mod: New test.
* gm2/pim/pass/nulcharcase.mod: New test.
* gm2/pim/pass/nulcharvar.mod: New test.

(cherry picked from commit e0ab8816ea53e2a343f7e945f4718172bff5ce95)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
7 months agoDaily bump.
GCC Administrator [Sat, 14 Dec 2024 00:25:58 +0000 (00:25 +0000)] 
Daily bump.

7 months agodriver: fix crash with --diagnostics-plain-output [PR117942]
Marek Polacek [Mon, 9 Dec 2024 13:19:35 +0000 (08:19 -0500)] 
driver: fix crash with --diagnostics-plain-output [PR117942]

We are crashing here because decode_cmdline_options_to_array has:

  if (!strcmp (opt, "-fdiagnostics-plain-output"))
    ...

but that doesn't handle the '--FLAG' variant.

PR driver/117942

gcc/ChangeLog:

* opts-common.cc (decode_cmdline_options_to_array): Also detect
--diagnostics-plain-output.

Reviewed-by: Joseph Myers <josmyers@redhat.com>
(cherry picked from commit be2062be9a629ae18a0c87c6b9cbe1885978417e)

7 months agoc++: ICE with -Wduplicated-branches in template [PR117880]
Marek Polacek [Mon, 9 Dec 2024 20:36:25 +0000 (15:36 -0500)] 
c++: ICE with -Wduplicated-branches in template [PR117880]

In a template, for things like void() we'll create a CAST_EXPR with
a null operand.  That causes a crash with -Wduplicated-branches on:

  false ? void() : void();

because we do

  if (warn_duplicated_branches
      && (complain & tf_warning)
      && (arg2 == arg3 || operand_equal_p (arg2, arg3,
                                           OEP_ADDRESS_OF_SAME_FIELD)))

even in a template.  So one way to fix the ICE would be to check
!processing_template_decl.  But we can also do the following and
continue warning even in templates.

This ICE appeared with the removal of NON_DEPENDENT_EXPR; before,
operand_equal_p would bail on this code so there was no problem.

PR c++/117880

gcc/ChangeLog:

* fold-const.cc (operand_compare::operand_equal_p) <case tcc_unary>:
Use OP_SAME_WITH_NULL instead of OP_SAME.

gcc/testsuite/ChangeLog:

* g++.dg/warn/Wduplicated-branches8.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
(cherry picked from commit d26c166001d6a5bdfd94be6e6d17135669ed340b)

7 months ago[PATCH] PR modula2/115328: use enable forward bool and set default true
Gaius Mulley [Fri, 13 Dec 2024 14:10:19 +0000 (14:10 +0000)] 
[PATCH] PR modula2/115328: use enable forward bool and set default true

This patch introduces GetEnableForward and SetEnableForward
against which the forward procedure declaration feature is checked.
Currently this is set as default true.

gcc/m2/ChangeLog:

PR modula2/115328
* gm2-compiler/M2Options.def (GetEnableForward): New procedure
function.
(SetEnableForward): New procedure.
* gm2-compiler/M2Options.mod (GetEnableForward): New procedure
function.
(SetEnableForward): New procedure.
(EnableForward): New boolean.
* gm2-compiler/P1SymBuild.mod (EndBuildForward): Check
GetEnableForward and generate an error message if false.

gcc/testsuite/ChangeLog:

PR modula2/115328
* gm2/pim/fail/forward.mod: Move to...
* gm2/pim/pass/forward.mod: ...here.

(cherry picked from commit 548afd73cdbf310403a1e3f34226372c16c29706)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
7 months agoDaily bump.
GCC Administrator [Fri, 13 Dec 2024 00:24:16 +0000 (00:24 +0000)] 
Daily bump.

7 months agoFix precondition failure with Ada.Numerics.Generic_Real_Arrays.Eigenvalues
Eric Botcazou [Thu, 12 Dec 2024 15:25:09 +0000 (16:25 +0100)] 
Fix precondition failure with Ada.Numerics.Generic_Real_Arrays.Eigenvalues

This fixes a precondition failure triggered when the Eigenvalues routine
of Ada.Numerics.Generic_Real_Arrays is instantiated with -gnata, beause
it calls Sort_Eigensystem on an empty vector.

gcc/ada
PR ada/117996
* libgnat/a-ngrear.adb (Jacobi): Remove default value for
Compute_Vectors formal parameter.
(Sort_Eigensystem): Add Compute_Vectors formal parameter.  Do not
modify the Vectors if Compute_Vectors is False.
(Eigensystem): Pass True as Compute_Vectors to Sort_Eigensystem.
(Eigenvalues): Pass False as Compute_Vectors to Sort_Eigensystem.

gcc/testsuite
* gnat.dg/matrix1.adb: New test.

7 months agotestsuite: arm: Use -mtune=cortex-m4 for thumb-ifcvt.c test
Torbjörn SVENSSON [Thu, 21 Nov 2024 18:56:19 +0000 (19:56 +0100)] 
testsuite: arm: Use -mtune=cortex-m4 for thumb-ifcvt.c test

On Cortex-M4, the code generated is:
     cmp     r0, r1
     itte    ne
     lslne   r0, r0, r1
     asrne   r0, r0, #1
     moveq   r0, r1
     add     r0, r0, r1
     bx      lr

On Cortex-M7, the code generated is:
     cmp     r0, r1
     beq     .L3
     lsls    r0, r0, r1
     asrs    r0, r0, #1
     add     r0, r0, r1
     bx      lr
.L3:
     mov     r0, r1
     add     r0, r0, r1
     bx      lr

As Cortex-M7 only allow maximum one conditional instruction, force
Cortex-M4 to have a stable test case.

gcc/testsuite/ChangeLog:

* gcc.target/arm/thumb-ifcvt.c: Use -mtune=cortex-m4.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
(cherry picked from commit e7615f6c99f93056b344ad07ee909114ee54f471)

7 months agotestsuite: arm: Fix build error for thumb2-slow-flash-data-3.c test
Torbjörn SVENSSON [Thu, 21 Nov 2024 15:08:30 +0000 (16:08 +0100)] 
testsuite: arm: Fix build error for thumb2-slow-flash-data-3.c test

gcc/testsuite/ChangeLog:

* gcc.target/arm/thumb2-slow-flash-data-3.c: Added argument to
fn1 to avoid compile error.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
(cherry picked from commit 09499ffbb3028f2db2dd97c2b764f0efe92bf3ef)

7 months agoDaily bump.
GCC Administrator [Thu, 12 Dec 2024 00:23:25 +0000 (00:23 +0000)] 
Daily bump.

7 months agoFortran: Fix READ with padding in BLANK ZERO mode.
Jerry DeLisle [Tue, 10 Dec 2024 04:11:23 +0000 (20:11 -0800)] 
Fortran: Fix READ with padding in BLANK ZERO mode.

PR fortran/117819

libgfortran/ChangeLog:

* io/read.c (read_decimal): If the read value is short of the
specified width and pad mode is PAD yes, check for BLANK ZERO
and adjust the value accordingly.
(read_radix): Likewise.

gcc/testsuite/ChangeLog:

* gfortran.dg/pr117819.f90: New test.

(cherry picked from commit cf406a6c79ce404c45f99bcf2df3293269dbb462)

7 months agoDaily bump.
GCC Administrator [Wed, 11 Dec 2024 00:23:27 +0000 (00:23 +0000)] 
Daily bump.

7 months agoDaily bump.
GCC Administrator [Tue, 10 Dec 2024 00:25:55 +0000 (00:25 +0000)] 
Daily bump.

7 months agos390: Fix UNSPEC_CC_TO_INT canonicalization
Juergen Christ [Mon, 9 Dec 2024 14:26:54 +0000 (15:26 +0100)] 
s390: Fix UNSPEC_CC_TO_INT canonicalization

Canonicalization of comparisons for UNSPEC_CC_TO_INT missed one case
causing unnecessarily complex code.  This especially seems to hit the
Linux kernel.

gcc/ChangeLog:

* config/s390/s390.cc (s390_canonicalize_comparison): Add
missing UNSPEC_CC_TO_INT case.

gcc/testsuite/ChangeLog:

* gcc.target/s390/ccusage.c: New test.

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
(cherry picked from commit bdc572f9a42b6a68dec1a5593d5311f45bd29cc9)

8 months agotree-eh: Don't crash on GIMPLE_TRY_FINALLY with empty cleanup sequence [PR117845]
Simon Martin [Mon, 9 Dec 2024 08:21:25 +0000 (09:21 +0100)] 
tree-eh: Don't crash on GIMPLE_TRY_FINALLY with empty cleanup sequence [PR117845]

The following valid code triggers an ICE with -fsanitize=address

=== cut here ===
void l() {
    auto const ints = {0,1,2,3,4,5};
    for (auto i : { 3 } ) {
        __builtin_printf("%d ", i);
    }
}
=== cut here ===

The problem is that honor_protect_cleanup_actions does not expect the
cleanup sequence of a GIMPLE_TRY_FINALLY to be empty. It is however the
case here since r14-8681-gceb242f5302027, because lower_stmt removes the
only statement in the sequence: a ASAN_MARK statement for the array that
backs the initializer_list).

This patch simply checks that the finally block is not 0 before
accessing it in honor_protect_cleanup_actions.

PR c++/117845

gcc/ChangeLog:

* tree-eh.cc (honor_protect_cleanup_actions): Support empty
finally sequences.

gcc/testsuite/ChangeLog:

* g++.dg/asan/pr117845-2.C: New test.
* g++.dg/asan/pr117845.C: New test.

(cherry picked from commit 3076539544d3e36684cc8eed3374aeff5b44c9b1)

8 months agoDaily bump.
GCC Administrator [Mon, 9 Dec 2024 00:23:27 +0000 (00:23 +0000)] 
Daily bump.

8 months agoi386: Fix unwanted fwprop to 3dNOW! insn [PR117926]
Uros Bizjak [Fri, 6 Dec 2024 15:59:16 +0000 (16:59 +0100)] 
i386: Fix unwanted fwprop to 3dNOW! insn [PR117926]

The compiler is able to forward propagate a partial vector V4SF instruction
using XMM registers to a 3dNOW! V2SF instruction using MM registers.  Prevent
unwanted transformation by tagging 3dNOW! V2SF instructions using generic
RTXes with "(unspec [(const_int 0)] UNSPEC_3DNOW)" tag.

PR target/117926

gcc/ChangeLog:

* config/i386/mmx.md (UNSPEC_3DNOW): New unspec.
(mmx_addv2sf3): Tag insn with UNSPEC_3DNOW tag.
(*mmx_addv2sf3): Ditto.
(mmx_sub2vsf3): Ditto.
(mmx_subrv2sf3): Ditto.
(*mmx_subv2sf3): Ditto.
(mmx_mulv2sf3): Ditto.
(mmx_<smaxmin:code>v2sf3): Ditto.
(*mmx_<smaxmin:code>v2sf3): Ditto.
(mmx_ieee_<ieee_maxmin>v2sf3): Ditto.
(mmx_eqv2sf3): Ditto.
(*mmx_eqv2sf3): Ditto.
(mmx_gtv2sf3): Ditto.
(mmx_gev2sf3): Ditto.
(mmx_fix_truncv2sfv2si2): Ditto.
(mmx_floatv2siv2sf2): Ditto.

gcc/testsuite/ChangeLog:

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

(cherry picked from commit 1acc5cffbb04949a790d6e1a34a46ec71418a57b)

8 months agoDaily bump.
GCC Administrator [Sun, 8 Dec 2024 00:23:12 +0000 (00:23 +0000)] 
Daily bump.

8 months ago[PATCH] PR modula2/117948: Forward procedure declaration should only be available...
Gaius Mulley [Sat, 7 Dec 2024 15:56:21 +0000 (15:56 +0000)] 
[PATCH] PR modula2/117948: Forward procedure declaration should only be available in ISO

This patch restricts the forward procedure declaration to the ISO dialect.

gcc/m2/ChangeLog:

PR modula2/117948
* gm2-compiler/P1Build.bnf (ForwardDeclaration): Pass token
position of the FORWARD keyword to EndBuildForward.
* gm2-compiler/P1SymBuild.def (EndBuildForward): New parameter
forwardPos.
* gm2-compiler/P1SymBuild.mod (EndBuildForward): Issue an error at
forwardPos if the Iso boolean is false.

gcc/testsuite/ChangeLog:

PR modula2/117948
* gm2/pim/fail/forward.mod: New test.

(cherry picked from commit 41800372146f5ad15a8796b37f54965f78cc14fb)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months agoDaily bump.
GCC Administrator [Sat, 7 Dec 2024 00:23:41 +0000 (00:23 +0000)] 
Daily bump.

8 months agoFortran: Fix B64.0 formatted write output.
Jerry DeLisle [Wed, 4 Dec 2024 04:55:41 +0000 (20:55 -0800)] 
Fortran: Fix B64.0 formatted write output.

PR fortran/117820

libgfortran/ChangeLog:

* io/write.c (write_b): Add test for zero needed by write_boz.

gcc/testsuite/ChangeLog:

* gfortran.dg/pr117820.f90: New test.

(cherry picked from commit 7a92ba766815c9a6b73593967a26fdfbebfc7e69)

8 months agoFortran: Eliminate error prone translations.
Jerry DeLisle [Tue, 6 Aug 2024 23:10:23 +0000 (16:10 -0700)] 
Fortran: Eliminate error prone translations.

PR fortran/109105

gcc/fortran/ChangeLog:

* resolve.cc (CHECK_INTERFACES): New helper macro.
(resolve_operator): Replace use of snprintf with
gfc_error.

(cherry picked from commit 000045fdf838a21e151c2c676c4fcd056032e59f)

8 months ago[PATCH] PR modula2/117904: cc1gm2 ICE when compiling a const built from VAL and SIZE
Gaius Mulley [Fri, 6 Dec 2024 13:06:58 +0000 (13:06 +0000)] 
[PATCH] PR modula2/117904: cc1gm2 ICE when compiling a const built from VAL and SIZE

This patch fixes an ICE which occurs when a positive ZType constant
increment is used during a FOR loop.

gcc/m2/ChangeLog:

PR modula2/117904
* gm2-compiler/M2GenGCC.mod (PerformLastForIterator): Add call to
BuildConvert when increment is > 0.

gcc/testsuite/ChangeLog:

PR modula2/117904
* gm2/iso/pass/forloopbyconst.mod: New test.

(cherry picked from commit 363382ac7c2b8f6a09415e905b349bb7eaeca38a)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months agofortran: Add default to switch in gfc_trans_transfer [PR117843]
Andrew Pinski [Fri, 29 Nov 2024 09:00:11 +0000 (01:00 -0800)] 
fortran: Add default to switch in gfc_trans_transfer [PR117843]

This fixes a bootstrap failure due to a warning on enum values not being
handled. In this case, it is just checking two values and the rest should
are not handled so adding a default case fixes the issue.

Pushed as obvious.

PR fortran/117843
gcc/fortran/ChangeLog:

* trans-io.cc (gfc_trans_transfer): Add default case.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
(cherry picked from commit 48b72743b0e29871171593fe34856da62d954750)

8 months agoFortran: fix crash with bounds check writing array section [PR117791]
Harald Anlauf [Wed, 27 Nov 2024 20:11:16 +0000 (21:11 +0100)] 
Fortran: fix crash with bounds check writing array section [PR117791]

PR fortran/117791

gcc/fortran/ChangeLog:

* trans-io.cc (gfc_trans_transfer): When an array index depends on
a function evaluation or an expression, do not use optimized array
I/O of an array section and fall back to normal scalarization.

gcc/testsuite/ChangeLog:

* gfortran.dg/bounds_check_array_io.f90: New test.

(cherry picked from commit 2261a15c0715cbf5c129b66ee44fc1d3a9e36972)

8 months agoDaily bump.
GCC Administrator [Fri, 6 Dec 2024 00:24:09 +0000 (00:24 +0000)] 
Daily bump.

8 months agoc++: Don't reject pointer to virtual method during constant evaluation [PR117615]
Simon Martin [Tue, 3 Dec 2024 13:30:43 +0000 (14:30 +0100)] 
c++: Don't reject pointer to virtual method during constant evaluation [PR117615]

We currently reject the following valid code:

=== cut here ===
struct Base {
    virtual void doit (int v) const {}
};
struct Derived : Base {
    void doit (int v) const {}
};
using fn_t = void (Base::*)(int) const;
struct Helper {
    fn_t mFn;
    constexpr Helper (auto && fn) : mFn(static_cast<fn_t>(fn)) {}
};
void foo () {
    constexpr Helper h (&Derived::doit);
}
=== cut here ===

The problem is that since r6-4014-gdcdbc004d531b4, &Derived::doit is
represented with an expression with type pointer to method and using an
INTEGER_CST (here 1), and that cxx_eval_constant_expression rejects any
such expression with a non-null INTEGER_CST.

This patch uses the same strategy as r12-4491-gf45610a45236e9 (fix for
PR c++/102786), and simply lets such expressions go through.

PR c++/117615

gcc/cp/ChangeLog:

* constexpr.cc (cxx_eval_constant_expression): Don't reject
INTEGER_CSTs with type POINTER_TYPE to METHOD_TYPE.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/constexpr-virtual22.C: New test.

(cherry picked from commit 72a2380a306a1c3883cb7e4f99253522bc265af0)

8 months agoAVR: target/64242 - Copy FP to a local reg in nonlocal_goto.
Georg-Johann Lay [Wed, 4 Dec 2024 19:56:50 +0000 (20:56 +0100)] 
AVR: target/64242 - Copy FP to a local reg in nonlocal_goto.

In nonlocal_goto sets, change hard_frame_pointer_rtx only after
emit_stack_restore() restored SP.  This is needed because SP
my be stored in some frame location.

gcc/
PR target/64242
* config/avr/avr.md (nonlocal_goto): Don't restore
hard_frame_pointer_rtx directly, but copy it to local
register, and only set hard_frame_pointer_rtx from it
after emit_stack_restore().

(cherry picked from commit f7b5527d1b48b33d8ab633c1e9dcb9883667492a)

8 months agoDaily bump.
GCC Administrator [Thu, 5 Dec 2024 00:25:32 +0000 (00:25 +0000)] 
Daily bump.

8 months ago[PATCH] PR modula2/117660: Errors referring to variables of type array could display...
Gaius Mulley [Wed, 4 Dec 2024 09:03:36 +0000 (09:03 +0000)] 
[PATCH] PR modula2/117660: Errors referring to variables of type array could display full declaration

This patch ensures that the tokens defining the full declaration of an
ARRAY type is stored in the symbol table and used during production of
error messages.

gcc/m2/ChangeLog:

PR modula2/117660
* gm2-compiler/P2Build.bnf (ArrayType): Update tok with the
composite token produced during array type declaration.
* gm2-compiler/P2SymBuild.mod (EndBuildArray): Create the
combinedtok and store it into the symbol table.
Also ensure combinedtok is pushed to the quad stack.
(BuildFieldArray): Preserve typetok.
* gm2-compiler/SymbolTable.def (PutArray): Rename parameters.
* gm2-compiler/SymbolTable.mod (PutArray): Rename parameters.

gcc/testsuite/ChangeLog:

PR modula2/117660
* gm2/iso/fail/arraymismatch.mod: New test.

(cherry picked from commit ab7abf1db09519a92f4a02af30ed6b834264c45e)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months ago[PATCH] PR modula2/117371: Add check for zero step in for loop
Gaius Mulley [Wed, 4 Dec 2024 08:01:13 +0000 (08:01 +0000)] 
[PATCH] PR modula2/117371: Add check for zero step in for loop

This patch is a follow on from PR modula2/117371 which could include
a check to enforce the ISO restriction on a zero for loop step.

gcc/m2/ChangeLog:

PR modula2/117371
* gm2-compiler/M2GenGCC.mod (PerformLastForIterator):
Add check for zero step value and issue an error message.

gcc/testsuite/ChangeLog:

PR modula2/117371
* gm2/iso/fail/forloopbyzero.mod: New test.

(cherry picked from commit e37641458e9e1be1a81ff7fab4f4ab8398147d80)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months agoDaily bump.
GCC Administrator [Wed, 4 Dec 2024 00:27:27 +0000 (00:27 +0000)] 
Daily bump.

8 months ago[PATCH] PR modula2/117371: type incompatibility between INTEGER and CARDINAL
Gaius Mulley [Wed, 4 Dec 2024 00:11:22 +0000 (00:11 +0000)] 
[PATCH] PR modula2/117371: type incompatibility between INTEGER and CARDINAL

This patch enforces a const expression increment in a FOR loop.
It also fixes missing error locations.  The FOR loop last iterator
value is now calculated during M2GenGCC after all types and constants have
been resolved.  This results in fewer quadruples (as there is no need to
build two paths for step > 0 and step < 0).

gcc/m2/ChangeLog:

PR modula2/117371
* gm2-compiler/M2Base.mod (MixMetaTypes): Add parameter TRUE to
MetaErrorDecl.
(IsUserType): Test against ZType.
(MixTypesDecl): Test for ZType.
* gm2-compiler/M2GenGCC.mod (ErrorMessageDecl): Add parameter TRUE to
MetaErrorDecl.
(CodeLastForIterator): New procedure.
(FoldLastForIterator): Ditto.
(PerformLastForIterator): Ditto.
(CodeStatement): Add case clause for LastForIteratorOp.
(ErrorMessageDecl): Add iserror parameter.
Call MetaErrorDecl with iserror parameter.
(checkIncorrectMeta): Call MetaErrorDecl with TRUE parameter.
(CheckBinaryExpressionTypes): Ditto.
(CheckElementSetTypes): Ditto.
* gm2-compiler/M2LexBuf.def (MakeVirtualTok): Update comment
detailing the fall back when UnknownTokenNo is encountered.
(MakeVirtual2Tok): Ditto.
* gm2-compiler/M2LexBuf.mod (MakeVirtualTok): Check against
UnknownTokenNo.
(MakeVirtual2Tok): Ditto.
* gm2-compiler/M2MetaError.def (MetaErrorDecl): Add error parameter.
* gm2-compiler/M2MetaError.mod (MetaErrorDecl): Add error
parameter.
Issue warning if error is FALSE.
* gm2-compiler/M2Quads.def (QuadOperator): Add LastForIteratorOp.
* gm2-compiler/M2Quads.mod (AddQuadInformation): New case clause
LastForIteratorOp.
(CheckAddTuple2Read): New procedure.
(BuildForLoopToRangeCheck): Remove.
(ForLoopLastIteratorVariable): Ditto.
(ForLoopLastIteratorConstant): Ditto.
(ForLoopLastIterator): Reimplement.
(BuildForToByDo): Remove ByType from call to ForLoopLastIterator.
(WriteQuad): New case clause LastForIteratorOp.
(WriteOperator): Ditto.
* gm2-compiler/M2Students.def
(CheckForVariableThatLooksLikeKeyword): Replace with ...
(CheckVariableAgainstKeyword): ... this.
* gm2-compiler/M2Students.mod
(CheckForVariableThatLooksLikeKeyword): Replace with ...
(CheckVariableAgainstKeyword): ... this.
* gm2-compiler/M2SymInit.mod (CheckLastForIterator): New
procedure.
(CheckReadBeforeInitQuad): New case clause to call
CheckLastForIterator.
* gm2-compiler/P2SymBuild.mod: Replace
CheckForVariableThatLooksLikeKeyword with CheckVariableAgainstKeyword.

gcc/testsuite/ChangeLog:

PR modula2/117371
* gm2/iso/fail/forloopbyvar.mod: New test.
* gm2/iso/fail/forloopbyvar4.mod: New test.
* gm2/iso/fail/forloopbyvar5.mod: New test.
* gm2/iso/pass/forloopbyvar3.mod: New test.

(cherry picked from commit f242f79b8afeec58477e99c44530bd503878c6d5)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months ago[PATCH] modula2: Add dependencies for generated sources
Gaius Mulley [Tue, 3 Dec 2024 21:17:20 +0000 (21:17 +0000)] 
[PATCH] modula2: Add dependencies for generated sources

This patch adds rules and dependencies for the automatically
generated grammar sources.  Bootstrapped using make -j 160.

gcc/m2/ChangeLog:

* Make-lang.in (m2/gm2-compiler-boot/P0SyntaxCheck.c):
New rule.
(m2/gm2-compiler-boot/P0SyntaxCheck.o): Ditto.
(m2/gm2-compiler-boot/P1Build.c): Ditto.
(m2/gm2-compiler-boot/P1Build.o): Ditto.
(m2/gm2-compiler-boot/P2Build.c): Ditto.
(m2/gm2-compiler-boot/P2Build.o): Ditto.
(m2/gm2-compiler-boot/P3Build.c): Ditto.
(m2/gm2-compiler-boot/P3Build.o): Ditto.
(m2/gm2-compiler-boot/PCBuild.c): Ditto.
(m2/gm2-compiler-boot/PCBuild.o): Ditto.
(m2/gm2-compiler-boot/PHBuild.c): Ditto.
(m2/gm2-compiler-boot/PHBuild.o): Ditto.

(cherry picked from commit 3e6a7824033ffb88b8f99ad93b389f7d0eef22a4)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months ago[PATCH] modula2: Reimplement parameter declaration and checking.
Gaius Mulley [Tue, 3 Dec 2024 21:16:25 +0000 (21:16 +0000)] 
[PATCH] modula2: Reimplement parameter declaration and checking.

This patch improves the parameter declaration by saving all parameter
kinds: proper procedure, definition module procedure and forward
procedures.  This allows error messages to reference any parameter
in the three kinds of procedures.  Variables and their declaration
are also stored.  The expression, assignment and parameter checking
has been improved to highlight any variable or parameter and
its declaration causing a conflict.

gcc/m2/ChangeLog:

* gm2-compiler/M2Base.def (MixTypes): Rename parameters.
(MixTypesDecl): New procedure function.
* gm2-compiler/M2Base.mod (BuildOrdFunctions): Add
DefProcedure parameter to PutFunction.
(BuildTruncFunctions): Ditto.
(BuildFloatFunctions): Ditto.
(BuildIntFunctions): Ditto.
(InitBaseFunctions): Ditto.
(MixTypesDecl): New procedure function.
(MixTypes): Reimplement.
* gm2-compiler/M2Check.mod (checkProcType): Replace
NoOfParam with NoOfParamAny.
Replace IsVarParam with IsVarParamAny.
(checkProcedureProcType): Ditto.
* gm2-compiler/M2Error.def: Remove unnecessary export qualified list.
* gm2-compiler/M2GCCDeclare.mod: Replace NoOfParam with NoOfParamAny.
Replace IsVarParam with IsVarParamAny.
(DeclareProcedureToGccWholeProgram): Rename son to
Variable.
(DeclareProcedureToGccSeparateProgram): Ditto.
(PrintKind): New procedure.
(PrintProcedureParameters): Ditto.
(PrintProcedureReturnType): Ditto.
(PrintProcedure): Reimplement.
(PrintProcTypeParameters): New procedure.
(PrintProcType): Ditto.
(DeclareProcType): Rename Son to Parameter.
* gm2-compiler/M2GenGCC.mod: Replace NoOfParam with NoOfParamAny.
Replace IsVarParam with IsVarParamAny.
(ErrorMessageDecl): New procedure.
(checkIncorrectMeta): Replace call to MetaErrorT2 with
ErrorMessageDecl.
(ComparisonMixTypes): Add varleft and varright parameters.
Adjust all callers of ComparisonMixTypes.
* gm2-compiler/M2MetaError.def (MetaErrorDecl): New procedure.
* gm2-compiler/M2MetaError.mod (MetaErrorDecl): New procedure.
* gm2-compiler/M2Options.def (SetXCode): Add -fd flag description
to comment.
* gm2-compiler/M2Options.mod (SetXCode): Add -fd flag description
to comment.
* gm2-compiler/M2Quads.mod (CheckBreak): New procedure.
Replace NoOfParam with NoOfParamAny.
Replace IsVarParam with IsVarParamAny.
(FailParameter): Reimplement using GetVarDeclFullTok.
Generate message for formal parameter, actual parameter and
declaration of actual parameter.
(WarnParameter): Ditto.
(CheckBuildFunction): Reimplement error message using MetaErrorT1.
* gm2-compiler/M2Range.mod: Replace NoOfParam with NoOfParamAny.
Replace IsVarParam with IsVarParamAny.
* gm2-compiler/M2Scaffold.mod (DeclareScaffoldFunctions): Call
PutProcedureDefined after every procedure declaration.
(DeclareArgEnvParams): Add ProperProcedure parameter to PutParam.
* gm2-compiler/M2Size.mod (MakeSize): Add DefProcedure parameter
to PutFunction.
* gm2-compiler/M2Swig.mod: Replace NoOfParam with NoOfParamAny.
Replace IsVarParam with IsVarParamAny.
* gm2-compiler/M2SymInit.mod: Ditto.
* gm2-compiler/M2System.mod (InitSystem): Add DefProcedure
parameter to PutFunction.
* gm2-compiler/P1SymBuild.mod (StartBuildProcedure): Reimplement.
(EndBuildProcedure): Ditto.
(EndBuildForward): Ditto.
* gm2-compiler/P2Build.bnf (BuildProcedureDefinedByForward):
Remove.
(BuildProcedureDefinedByProper): Ditto.
(ForwardDeclaration): Remove BuildProcedureDefinedByForward.
(BuildNoReturnAttribute): Remove parameter.
* gm2-compiler/P2SymBuild.def (BuildNoReturnAttribute): Remove
parameter.
(BuildProcedureDefinedByForward): Remove.
(BuildProcedureDefinedByProper): Ditto.
* gm2-compiler/P2SymBuild.mod (Import): Remove
AreParametersDefinedInDefinition,
AreParametersDefinedInImplementation,
AreProcedureParametersDefined,
ParametersDefinedInDefinition,
ParametersDefinedInImplementation,
GetProcedureDeclaredDefinition,
GetProcedureDeclaredForward,
GetProcedureDeclaredProper,
GetParametersDefinedByForward,
GetParametersDefinedByProper and
PutProcedureNoReturn.
Add PutProcedureParametersDefined,
GetProcedureParametersDefined,
GetProcedureKindDesc,
GetProcedureDeclaredTok,
GetProcedureKind,
GetReturnTypeTok,
SetReturnOptional,
IsReturnOptional,
PutProcedureNoReturn and
PutProcedureDefined.
(Debug): New procedure.
(P2StartBuildDefModule): Space formatting.
(BuildVariable): Reimplement to record full declaration.
(StartBuildProcedure): Reimplement using token to determine
the kind of procedure.
(BuildProcedureHeading): Ditto.
(BuildFPSection): Ditto.
(BuildVarArgs): Ditto.
(BuildOptArg): Ditto.
(BuildProcedureDefinedByForward): Remove.
(BuildProcedureDefinedByProper): Ditto.
(BuildFormalParameterSection): Reimplement so that the
quad stack is unchanged.
(CheckFormalParameterSection): Ditto.
(RemoveFPParameters): New procedure.
(ParameterError): Reimplement.
(StartBuildFormalParameters): Add annotation.
(ParameterMismatch): Reimplement.
(EndBuildFormalParameters): Reimplement to check against
all procedure kinds.
(GetSourceDesc): Remove.
(GetCurSrcDesc): Ditto.
(GetDeclared): Ditto.
(ReturnTypeMismatch): Reimplement.
(BuildFunction): Ditto.
(BuildOptFunction): Ditto.
(CheckOptFunction): New procedure.
(BuildNoReturnAttribute): Remove parameter and obtain
procedure symbol from quad stack.
(CheckProcedureReturn): New procedure.
* gm2-compiler/P3SymBuild.mod (BuildOptArgInitializer):
Preserve ProcSym tok on the quad stack.
Add Assert.
* gm2-compiler/PCSymBuild.mod (fixupProcedureType): Replace
NoOfParam with NoOfParamAny.
* gm2-compiler/SymbolTable.def (GetNthParam): Add ProcedureKind
parameter.
(PutFunction): Ditto.
(PutOptFunction): Ditto.
(IsReturnOptional): Ditto.
(PutParam): Ditto.
(PutVarParam): Ditto.
(PutParamName): Ditto.
(PutProcedureNoReturn): Ditto.
(IsProcedureNoReturn): Ditto.
(IsVarParam): Ditto.
(IsUnboundedParam): Ditto.
(NoOfParam): Ditto.
(ForeachLocalSymDo): Ditto.
(GetProcedureKind): Ditto.
(GetProcedureDeclaredTok): Ditto.
(PutProcedureDeclaredTok): Ditto.
(GetReturnTypeTok): Ditto.
(PutReturnTypeTok): Ditto.
(PutParametersDefinedByForward): New procedure.
(PutProcedureParametersDefined): Ditto.
(PutProcedureDefined): Ditto.
(GetParametersDefinedByProper): Ditto.
(GetProcedureDeclaredForward): Ditto.
(GetProcedureDeclaredProper): Ditto.
(PutProcedureDeclaredProper): Ditto.
(GetProcedureDeclaredDefinition): Ditto.
(PutProcedureDeclaredDefinition): Ditto.
(GetProcedureDefined): Ditto.
(PutUseOptArg): Ditto.
(UsesOptArg): Ditto.
(PutOptArgInit): Ditto.
(SetReturnOptional): Ditto.
(UsesOptArgAny): Ditto.
(GetProcedureKindDesc): Ditto.
(IsReturnOptionalAny): New procedure function.
(GetNthParamAny): Ditto.
(NoOfParamAny): Ditto.
(IsProcedureAnyNoReturn): Ditto.
(AreParametersDefinedInImplementation): Remove.
(ParametersDefinedInImplementation): Ditto.
(AreParametersDefinedInDefinition): Ditto.
(AreProcedureParametersDefined): Ditto.
(ParametersDefinedInDefinition): Ditto.
(ProcedureParametersDefined): Ditto.
(PutParametersDefinedByProper): Ditto.
(PutProcedureDeclaredForward): Ditto.
(GetParametersDefinedByForward): Ditto.
(GetProcedureParametersDefined): Ditto.
(PushOffset): Ditto.
(PopSize): Ditto.
(PushParamSize): Ditto.
(PushSumOfLocalVarSize): Ditto.
(PushSumOfParamSize): Ditto.
(PopOffset): Ditto.
(PopSumOfParamSize): Ditto.
* gm2-compiler/SymbolTable.mod (MakeProcedure): Reimplement.
(PutProcedureNoReturn): Add ProcedureKind parameter.
(GetNthParam): Ditto.
(PutFunction): Ditto.
(PutOptFunction): Ditto.
(IsReturnOptional): Ditto.
(MakeVariableForParam): Ditto.
(PutParam): Ditto.
(PutVarParam): Ditto.
(PutParamName): Ditto.
(AddParameter): Ditto.
(IsVarParam): Ditto.
(IsVarParamAny): Ditto.
(NoOfParam): Ditto.
(HasVarParameters): Ditto.
(IsUnboundedParam): Ditto.
(PutUseVarArgs): Ditto.
(UsesVarArgs): Ditto.
(PutUseOptArg): Ditto.
(UsesOptArg): Ditto.
(UsesOptArgAny): Ditto.
(PutOptArgInit): Ditto.
(IsProcedure): Ditto.
(IsPointer): Ditto.
(IsRecord): Ditto.
(IsArray): Ditto.
(IsEnumeration): Ditto.
(IsUnbounded): Ditto.
(IsSet): Ditto.
(IsSetPacked): Ditto.
(CheckUnbounded): Ditto.
(IsOAFamily): Ditto.
(IsModuleWithinProcedure): Ditto.
(GetDeclaredDef): Ditto.
(GetDeclaredMod): Ditto.
(GetDeclaredFor): Ditto.
(GetProcedureDeclaredForward): Ditto.
(GetProcedureKind): Ditto.
(PutProcedureDeclaredForward): Ditto.
(GetProcedureDeclaredTok): Ditto.
(GetProcedureDeclaredProper): Ditto.
(PutProcedureDeclaredTok): Ditto.
(PutProcedureDeclaredProper): Ditto.
(GetReturnTypeTok): Ditto.
(GetProcedureDeclaredDefinition): Ditto.
(PutReturnTypeTok): Ditto.
(PutProcedureDeclaredDefinition): Ditto.
(GetProcedureKindDesc): Ditto.
(IsProcedureVariable): Ditto.
(IsAModula2Type): Ditto.
(GetParam): Ditto.
(ProcedureParametersDefined): Ditto.
(AreParametersDefinedInImplementation): Remove.
(AreParametersDefinedInDefinition): Ditto.
(AreProcedureParametersDefined): Ditto.
(IsSizeSolved): Ditto.
(IsOffsetSolved): Ditto.
(IsValueSolved): Ditto.
(IsSumOfParamSizeSolved): Ditto.
(PushSize): Ditto.
(PushOffset): Ditto.
(PopSize): Ditto.
(PushValue): Ditto.
(PushParamSize): Ditto.
(PushSumOfLocalVarSize): Ditto.
(PushSumOfParamSize): Ditto.
(PushVarSize): Ditto.
(PopValue): Ditto.
(PopSize): Ditto.
(PopOffset): Ditto.
(PopSumOfParamSize): Ditto.
(PutParametersDefinedByForward): New procedure.
(PutProcedureParametersDefined): Ditto.
(PutProcedureDefined): Ditto.
(GetParametersDefinedByProper): Ditto.
(GetProcedureDeclaredForward): Ditto.
(GetProcedureDeclaredProper): Ditto.
(PutProcedureDeclaredProper): Ditto.
(GetProcedureDeclaredDefinition): Ditto.
(PutProcedureDeclaredDefinition): Ditto.
(GetProcedureDefined): Ditto.
(PutUseOptArg): Ditto.
(UsesOptArg): Ditto.
(PutOptArgInit): Ditto.
(SetReturnOptional): Ditto.
(UsesOptArgAny): Ditto.
(GetProcedureKindDesc): Ditto.
(PutParametersDefinedByProper): Ditto.
(GetParametersDefinedByProper): Ditto.
(IsReturnOptionalAny): New procedure function.
(IsProcedureAnyDefaultBoolean): Ditto.
(IsProcedureAnyBoolean): Ditto.
(IsProcedureAnyNoReturn): Ditto.
(GetNthParamAny): Ditto.
(NoOfParamAny): Ditto.
(IsProcedureAnyNoReturn): Ditto.
(GetProcedureKind): Ditto.
(IsVarParamAny): Ditto.
(IsUnboundedParamAny): Ditto.
(ForeachParamSymDo): New comment.
* gm2-libs-coroutines/SYSTEM.mod: Reformat.

gcc/testsuite/ChangeLog:

* gm2/iso/fail/badexpression3.mod: New test.
* gm2/iso/fail/badparam4.def: New test.
* gm2/iso/fail/badparam4.mod: New test.

(cherry picked from commit 95960cd473297cd0d2c9e75a1a424b870cee32f5)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months agoUpdate gcc zh_CN.po
Joseph Myers [Tue, 3 Dec 2024 18:28:09 +0000 (18:28 +0000)] 
Update gcc zh_CN.po

* zh_CN.po: Update.

8 months agomiddle-end:For multiplication try swapping operands when matching complex multiply...
Tamar Christina [Thu, 21 Nov 2024 15:10:24 +0000 (15:10 +0000)] 
middle-end:For multiplication try swapping operands when matching complex multiply [PR116463]

This commit fixes the failures of complex.exp=fast-math-complex-mls-*.c on the
GCC 14 branch and some of the ones on the master.

The current matching just looks for one order for multiplication and was relying
on canonicalization to always give the right order because of the TWO_OPERANDS.

However when it comes to the multiplication trying only one order is a bit
fragile as they can be flipped.

The failing tests on the branch are:

void fms180snd(_Complex TYPE a[restrict N], _Complex TYPE b[restrict N],
               _Complex TYPE c[restrict N]) {
  for (int i = 0; i < N; i++)
    c[i] -= a[i] * (b[i] * I * I);
}

void fms180fst(_Complex TYPE a[restrict N], _Complex TYPE b[restrict N],
               _Complex TYPE c[restrict N]) {
  for (int i = 0; i < N; i++)
    c[i] -= (a[i] * I * I) * b[i];
}

The issue is just a small difference in commutative operations.
we look for {R,R} * {R,I} but found {R,I} * {R,R}.

Since the DF analysis is cached, we should be able to swap operands and retry
for multiply cheaply.

There is a constraint being checked by vect_validate_multiplication for the data
flow of the operands feeding the multiplications.  So e.g.

between the nodes:

note:   node 0x4d1d210 (max_nunits=2, refcnt=3) vector(2) double
note:   op template: _27 = _10 * _25;
note:      stmt 0 _27 = _10 * _25;
note:      stmt 1 _29 = _11 * _25;
note:   node 0x4d1d060 (max_nunits=2, refcnt=2) vector(2) double
note:   op template: _26 = _11 * _24;
note:      stmt 0 _26 = _11 * _24;
note:      stmt 1 _28 = _10 * _24;

we require the lanes to come from the same source which
vect_validate_multiplication checks.  As such it doesn't make sense to flip them
individually because that would invalidate the earlier linear_loads_p checks
which have validated that the arguments all come from the same datarefs.

This patch thus flips the operands in unison to still maintain this invariant,
but also honor the commutative nature of multiplication.

gcc/ChangeLog:

PR tree-optimization/116463
* tree-vect-slp-patterns.cc (complex_mul_pattern::matches,
complex_fms_pattern::matches): Try swapping operands on multiply.

(cherry picked from commit a9473f9c6f2d755d2eb79dbd30877e64b4bc6fc8)

8 months ago[PATCH] modula2: M2MetaError.{def,mod} and P2SymBuild.mod further cleanup
Gaius Mulley [Tue, 3 Dec 2024 15:58:27 +0000 (15:58 +0000)] 
[PATCH] modula2: M2MetaError.{def,mod} and P2SymBuild.mod further cleanup

Further cleanups and improve the wording of an error message.

gcc/m2/ChangeLog:

* gm2-compiler/M2MetaError.mod (op): Corrected ordering.
* gm2-compiler/P2SymBuild.def: Remove comment.
* gm2-compiler/P2SymBuild.mod (GetComparison): Replace
the word less with fewer.

(cherry picked from commit 961c02313f7e7a918e06851964ba54ea2e342cfa)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months ago[PATCH] modula2: Tidyup gm2-compiler/M2MetaError.mod
Gaius Mulley [Tue, 3 Dec 2024 14:39:03 +0000 (14:39 +0000)] 
[PATCH] modula2: Tidyup gm2-compiler/M2MetaError.mod

This patch is a tidyup for gm2-compiler/M2MetaError.mod.

gcc/m2/ChangeLog:

* gm2-compiler/M2MetaError.mod (op): Alphabetically order
each case label and comment.

(cherry picked from commit 7fa9fd47f161d6b8177439ae2b46a2048a5eaa24)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months ago[PATCH] PR modula2/115328 The FORWARD keyword is not implemented
Gaius Mulley [Tue, 3 Dec 2024 13:37:01 +0000 (13:37 +0000)] 
[PATCH] PR modula2/115328 The FORWARD keyword is not implemented

This patch implements the FORWARD keyword found in the ISO standard.
The patch checks incoming parameters against the prior declaration
found in definition/forward sections and will issue an error based
on virtual tokens highlighing the full parameter declaration.

gcc/m2/ChangeLog:

PR modula2/115328
* gm2-compiler/M2MetaError.def: Extend comment documentating
new format specifiers.
* gm2-compiler/M2MetaError.mod (GetTokProcedure): New declaration.
(doErrorScopeModule): New procedure.
(doErrorScopeForward): Ditto.
(doErrorScopeMod): Reimplement.
(doErrorScopeFor): New procedure.
(declarationMod): Ditto.
(doErrorScopeDefinition): Ditto.
(doErrorScopeDef): Reimplement.
(declaredDef): New procedure.
(declaredFor): Ditto.
(doErrorScopeProc): Ditto.
(declaredVar): Ditto.
(declaredType): Ditto.
(declaredFull): Ditto.
* gm2-compiler/M2Options.mod (SetAutoInit): Add missing
return type.
(GetDumpGimple): Remove duplicate implementation.
* gm2-compiler/M2Quads.def (DupFrame): New procedure.
* gm2-compiler/M2Quads.mod (DupFrame): New procedure.
* gm2-compiler/M2Reserved.def (ForwardTok): New variable.
* gm2-compiler/M2Reserved.mod (ForwardTok): Initialize variable.
* gm2-compiler/M2Scaffold.mod (DeclareArgEnvParams): Add
tokno parameter for call to PutParam.
* gm2-compiler/P0SymBuild.def (EndForward): New procedure.
* gm2-compiler/P0SymBuild.mod (EndForward): New procedure.
* gm2-compiler/P0SyntaxCheck.bnf (BlockAssert): New procedure.
(ProcedureDeclaration): Reimplement rule.
(PostProcedureHeading): New rule.
(ForwardDeclaration): Ditto.
(ProperProcedure): Ditto.
* gm2-compiler/P1Build.bnf (ProcedureDeclaration): Reimplement rule.
(PostProcedureHeading): New rule.
(ForwardDeclaration): Ditto.
(ProperProcedure): Ditto.
* gm2-compiler/P1SymBuild.def (Export): Removed unnecessary
export.
(EndBuildForward): New procedure.
* gm2-compiler/P1SymBuild.mod (StartBuildProcedure): Reimplement.
(EndBuildProcedure): Ditto.
(EndBuildForward): Ditto.
* gm2-compiler/P2Build.bnf (ProcedureDeclaration): Reimplement rule.
(PostProcedureHeading): New rule.
(ForwardDeclaration): Ditto.
(ProperProcedure): Ditto.
* gm2-compiler/P2SymBuild.def (BuildProcedureDefinedByForward):
New procedure.
(BuildProcedureDefinedByProper): Ditto.
(CheckProcedure): Ditto.
(EndBuildForward): Ditto.
* gm2-compiler/P2SymBuild.mod (EndBuildProcedure): Reimplement.
(EndBuildForward): New procedure.
(BuildFPSection): Reimplement to allow forward declaration or
checking of parameters.
(BuildProcedureDefinedByProper): New procedure.
(BuildProcedureDefinedByForward): Ditto
(FailParameter): Remove.
(ParameterError): New procedure.
(ParameterMismatch): Ditto.
(EndBuildFormalParameters): Add parameter number check.
(GetComparison): New procedure function.
(GetSourceDesc): Ditto.
(GetCurSrcDesc): Ditto.
(GetDeclared): New procedure.
(ReturnTypeMismatch): Ditto.
(BuildFunction): Reimplement.
(CheckProcedure): New procedure.
(CheckFormalParameterSection): Reimplement using ParameterError.
* gm2-compiler/P3Build.bnf (ProcedureDeclaration): Reimplement rule.
(PostProcedureHeading): New rule.
(ForwardDeclaration): Ditto.
(ProperProcedure): Ditto.
* gm2-compiler/P3SymBuild.def (Export): Remove unnecessary export.
(EndBuildForward): New procedure.
* gm2-compiler/P3SymBuild.mod (EndBuildForward): New procedure.
* gm2-compiler/PCBuild.bnf (ProcedureDeclaration): Reimplement rule.
(PostProcedureHeading): New rule.
(ForwardDeclaration): Ditto.
(ProperProcedure): Ditto.
* gm2-compiler/PCSymBuild.def (EndBuildForward): New procedure.
* gm2-compiler/PCSymBuild.mod (EndBuildForward): Ditto.
* gm2-compiler/PHBuild.bnf (ProcedureDeclaration): Reimplement rule.
(PostProcedureHeading): New rule.
(ForwardDeclaration): Ditto.
(ProperProcedure): Ditto.
* gm2-compiler/SymbolTable.def (PutVarTok): New procedure.
(PutParam): Add typetok parameter.
(PutVarParam): Ditto.
(PutParamName): Ditto.
(GetDeclaredFor): New procedure function.
(AreParametersDefinedInDefinition): Ditto.
(PutParametersDefinedByForward): New procedure.
(GetParametersDefinedByForward): New procedure function.
(PutParametersDefinedByProper): New procedure.
(GetParametersDefinedByProper): New procedure function.
(GetProcedureDeclaredForward): Ditto.
(PutProcedureDeclaredForward): New procedure.
(GetProcedureDeclaredProper): New procedure function.
(PutProcedureDeclaredProper): New procedure.
(GetProcedureDeclaredDefinition): New procedure function.
(PutProcedureDeclaredDefinition): New procedure.
(GetVarDeclTypeTok): Ditto.
(PutVarDeclTypeTok): New procedure.
(GetVarDeclTok): Ditto.
(PutVarDeclTok): New procedure.
(GetVarDeclFullTok): Ditto.
* gm2-compiler/SymbolTable.mod (ProcedureDecl): New record type.
(VarDecl): Ditto.
(SymProcedure): Add new field Declared.
(SymVar): Add new field Declared.
(PutVarTok): New procedure.
(PutParam): Add typetok parameter.
(PutVarParam): Ditto.
(PutParamName): Ditto.
(GetDeclaredFor): New procedure function.
(AreParametersDefinedInDefinition): Ditto.
(PutParametersDefinedByForward): New procedure.
(GetParametersDefinedByForward): New procedure function.
(PutParametersDefinedByProper): New procedure.
(GetParametersDefinedByProper): New procedure function.
(GetProcedureDeclaredForward): Ditto.
(PutProcedureDeclaredForward): New procedure.
(GetProcedureDeclaredProper): New procedure function.
(PutProcedureDeclaredProper): New procedure.
(GetProcedureDeclaredDefinition): New procedure function.
(PutProcedureDeclaredDefinition): New procedure.
(GetVarDeclTypeTok): Ditto.
(PutVarDeclTypeTok): New procedure.
(GetVarDeclTok): Ditto.
(PutVarDeclTok): New procedure.
(GetVarDeclFullTok): Ditto.
(MakeProcedure): Initialize Declared field.
(MakeVar): Initialize Declared field.
* gm2-libs-log/FileSystem.def (FileNameChar): Add
missing return type.
* m2.flex: Add FORWARD keyword.

gcc/testsuite/ChangeLog:

PR modula2/115328
* gm2/iso/fail/badparam.def: New test.
* gm2/iso/fail/badparam.mod: New test.
* gm2/iso/fail/badparam2.def: New test.
* gm2/iso/fail/badparam2.mod: New test.
* gm2/iso/fail/badparam3.def: New test.
* gm2/iso/fail/badparam3.mod: New test.
* gm2/iso/fail/badparamarray.def: New test.
* gm2/iso/fail/badparamarray.mod: New test.
* gm2/iso/fail/simpledef1.def: New test.
* gm2/iso/fail/simpledef1.mod: New test.
* gm2/iso/fail/simpleforward.mod: New test.
* gm2/iso/fail/simpleforward2.mod: New test.
* gm2/iso/fail/simpleforward3.mod: New test.
* gm2/iso/fail/simpleforward4.mod: New test.
* gm2/iso/fail/simpleforward5.mod: New test.
* gm2/iso/fail/simpleforward7.mod: New test.
* gm2/iso/pass/simpleforward.mod: New test.
* gm2/iso/pass/simpleforward6.mod: New test.

(cherry picked from commit e751639e3d20efe97186faa7dca33e7761ba1e79)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months agoDaily bump.
GCC Administrator [Tue, 3 Dec 2024 00:26:40 +0000 (00:26 +0000)] 
Daily bump.

8 months agolibstdc++: Use constexpr instead of _GLIBCXX20_CONSTEXPR in <vector>
Jonathan Wakely [Wed, 18 Sep 2024 15:17:28 +0000 (16:17 +0100)] 
libstdc++: Use constexpr instead of _GLIBCXX20_CONSTEXPR in <vector>

For the operator<=> overload we can use the 'constexpr' keyword
directly, because we know the language dialect is at least C++20.

libstdc++-v3/ChangeLog:

* include/bits/stl_vector.h (operator<=>): Use constexpr
instead of _GLIBCXX20_CONSTEXPR macro.

(cherry picked from commit b6463161c3cd0b1f764697290d9569c7153b8a5b)

8 months agolibstdc++: avoid -Wsign-compare
Jason Merrill [Tue, 27 Aug 2024 17:17:20 +0000 (13:17 -0400)] 
libstdc++: avoid -Wsign-compare

-Wsign-compare complained about these comparisons between (unsigned) size_t
and (signed) streamsize, or between (unsigned) native_handle_type
and (signed) -1.  Fixed by adding casts to unify the types.

libstdc++-v3/ChangeLog:

* include/std/istream: Add cast to avoid -Wsign-compare.
* include/std/stacktrace: Likewise.

(cherry picked from commit 4246cf4f18053eeb47cb2a241fffa9a41573916e)

8 months agolibstdc++: fix testcase regexp
Jason Merrill [Tue, 27 Aug 2024 17:16:47 +0000 (13:16 -0400)] 
libstdc++: fix testcase regexp

The unescaped * broke the match.

libstdc++-v3/ChangeLog:

* testsuite/20_util/default_delete/void_neg.cc: Fix regexp quoting.

(cherry picked from commit 7bd2a2f9e3ef9f7de4c2f478241f7083cc54d7d3)

8 months agolibstdc++: avoid -Wzero-as-null-pointer-constant
Jason Merrill [Tue, 27 Aug 2024 17:15:52 +0000 (13:15 -0400)] 
libstdc++: avoid -Wzero-as-null-pointer-constant

libstdc++-v3/ChangeLog:

* include/std/coroutine (coroutine_handle): Use nullptr instead of
0 as initializer for _M_fr_ptr.

(cherry picked from commit 28f94bf91a536395347a2da5558f0ddf014e814f)

8 months agolibstdc++: remove extra semicolons
Jason Merrill [Tue, 27 Aug 2024 17:13:40 +0000 (13:13 -0400)] 
libstdc++: remove extra semicolons

The semicolons after each macro invocation here end up following the closing
brace of a function, leading to -Wextra-semi pedwarns.

libstdc++-v3/ChangeLog:

* include/decimal/decimal.h (_DEFINE_DECIMAL_BINARY_OP_WITH_INT):
Remove redundant semicolons.

(cherry picked from commit 7b500fa34ad88d5fdd4bf74eb2737b214749075b)

8 months agolibstdc++: Fix -Wunused-parameter warnings in Networking TS headers
Jonathan Wakely [Wed, 28 Aug 2024 11:21:56 +0000 (12:21 +0100)] 
libstdc++: Fix -Wunused-parameter warnings in Networking TS headers

libstdc++-v3/ChangeLog:

* include/experimental/io_context: Remove name of unused
parameter.
* include/experimental/socket: Add [[maybe_unused]] attribute.

(cherry picked from commit 51b0fef4e6ee01ed2509bd54a448d2564a89c518)

8 months agolibstdc++: Silence -Woverloaded-virtual warning in cxx11-ios_failure.cc
Jonathan Wakely [Wed, 18 Sep 2024 14:38:02 +0000 (15:38 +0100)] 
libstdc++: Silence -Woverloaded-virtual warning in cxx11-ios_failure.cc

libstdc++-v3/ChangeLog:

* src/c++11/cxx11-ios_failure.cc (__iosfail_type_info): Unhide
the three-arg overload of __do_upcast.

(cherry picked from commit d842eb5ee6cb4d8a2795730ac88c4c2960f94bf4)

8 months agolibstdc++: Silence -Wattributes warning in exception_ptr
Jonathan Wakely [Wed, 18 Sep 2024 14:41:05 +0000 (15:41 +0100)] 
libstdc++: Silence -Wattributes warning in exception_ptr

libstdc++-v3/ChangeLog:

* libsupc++/exception_ptr.h (__exception_ptr::_M_safe_bool_dummy):
Remove __attribute__((const)) from function returning void.

(cherry picked from commit 164c1b1f812da5d1e00fc10a415e80f7c508efcb)

8 months agolibstdc++: Remove unused typedef in <ranges>
Jonathan Wakely [Wed, 28 Aug 2024 10:49:08 +0000 (11:49 +0100)] 
libstdc++: Remove unused typedef in <ranges>

This local typedef should have been removed in r14-6199-g45630fbcf7875b.

libstdc++-v3/ChangeLog:

* include/std/ranges (to): Remove unused typedef.

(cherry picked from commit a59f1cc31cf6c7ed30a78cef134ea3ed5e139414)

8 months agolibstdc++: Improve comment for _Hashtable::_M_insert_unique_node
Jonathan Wakely [Thu, 7 Nov 2024 16:51:58 +0000 (16:51 +0000)] 
libstdc++: Improve comment for _Hashtable::_M_insert_unique_node

Clarify the effects if rehashing is needed. Document the __n_elt
parameter.

libstdc++-v3/ChangeLog:

* include/bits/hashtable.h (_M_insert_unique_node): Improve
comment.

(cherry picked from commit e97179bacd067ccd3ee765632e0c034df152ccb6)

8 months agolibstdc++: Fix get<0> constraint for lvalue ranges::subrange (LWG 3589)
Jonathan Wakely [Thu, 14 Nov 2024 17:31:43 +0000 (17:31 +0000)] 
libstdc++: Fix get<0> constraint for lvalue ranges::subrange (LWG 3589)

Approved at October 2021 plenary.

libstdc++-v3/ChangeLog:

* include/bits/ranges_util.h (subrange::begin): Fix constraint,
as per LWG 3589.
* testsuite/std/ranges/subrange/lwg3589.cc: New test.

(cherry picked from commit 4a3a0be34f723df192361e43bb48b9292dfe3a54)

8 months agolibstdc++: Check feature test macros in unordered containers
Jonathan Wakely [Fri, 1 Nov 2024 10:50:02 +0000 (10:50 +0000)] 
libstdc++: Check feature test macros in unordered containers

Replace some `__cplusplus > 201402L` preprocessor checks with more
expressive checks for the appropriate feature test macros.

libstdc++-v3/ChangeLog:

* include/bits/unordered_map.h: Check __glibcxx_node_extract and
__glibcxx_unordered_map_try_emplace instead of __cplusplus.
* include/bits/unordered_set.h: Check __glibcxx_node_extract
instead of __cplusplus.

(cherry picked from commit 1a5bdeb1128ecfa4ce233218d02ccbb88ce0d8a8)

8 months agolibstdc++: Use appropriate feature test macro for std::byte
Jonathan Wakely [Fri, 11 Oct 2024 12:29:06 +0000 (13:29 +0100)] 
libstdc++: Use appropriate feature test macro for std::byte

libstdc++-v3/ChangeLog:

* include/bits/cpp_type_traits.h (__is_byte<byte>): Guard with
__glibcxx_byte macro instead of checking __cplusplus.

(cherry picked from commit 00a87ee76f47d0fa5a10ef982101cb3c3b8e9c99)

8 months agolibstdc++: Make equal and is_permutation short-circuit (LWG 3560)
Jonathan Wakely [Thu, 14 Nov 2024 16:57:17 +0000 (16:57 +0000)] 
libstdc++: Make equal and is_permutation short-circuit (LWG 3560)

We already implement short-circuiting for random access iterators, but
we also need to do so for ranges::equal and ranges::is_permutation when
given sized ranges that are not random access ranges (e.g. std::list).

libstdc++-v3/ChangeLog:

* include/bits/ranges_algo.h (__is_permutation_fn::operator()):
Short-circuit for sized ranges with different sizes, as per LWG
3560.
* include/bits/ranges_algobase.h (__equal_fn::operator()):
Likewise.
* include/bits/stl_algo.h (__is_permutation): Use if-constexpr
for random access iterator branches.
* include/bits/stl_algobase.h (__equal4): Likewise.
* testsuite/25_algorithms/equal/lwg3560.cc: New test.
* testsuite/25_algorithms/is_permutation/lwg3560.cc: New test.

Reviewed-by: Patrick Palka <ppalka@redhat.com>
(cherry picked from commit 45cc42d6dc0642612e7076e95820438a1aab5479)

8 months agolibstdc++: Implement LWG 3798 for range adaptors [PR106676]
Jonathan Wakely [Sun, 13 Oct 2024 21:28:16 +0000 (22:28 +0100)] 
libstdc++: Implement LWG 3798 for range adaptors [PR106676]

LWG 3798 modified the iterator_category of the iterator types for
transform_view, join_with_view, zip_transform_view and
adjacent_transform_view, to allow the iterator's reference type to be an
rvalue reference.

libstdc++-v3/ChangeLog:

PR libstdc++/106676
* include/bits/iterator_concepts.h (__cpp17_fwd_iterator): Use
is_reference instead of is_value_reference.
rvalue references.
* include/std/ranges (transform_view:__iter_cat::_S_iter_cat):
Likewise.
(zip_transform_view::__iter_cat::_S_iter_cat): Likewise.
(adjacent_transform_view::__iter_cat::_S_iter_cat): Likewise.
(join_with_view::__iter_cat::_S_iter_cat): Likewise.
* testsuite/std/ranges/adaptors/transform.cc: Check
iterator_category when the transformation function returns an
rvalue reference type.

Reviewed-by: Patrick Palka <ppalka@redhat.com>
(cherry picked from commit 7f65f94917866c6b18d9698eec6451c1bf21e0f9)

8 months agolibstdc++: Fix -Wsign-compare warning in std::string::resize_for_overwrite
Jonathan Wakely [Fri, 27 Sep 2024 14:51:56 +0000 (15:51 +0100)] 
libstdc++: Fix -Wsign-compare warning in std::string::resize_for_overwrite

libstdc++-v3/ChangeLog:

* include/bits/basic_string.tcc (resize_for_overwrite): Fix
-Wsign-compare warning.
* include/bits/cow_string.h (resize_for_overwrite): Likewise.

(cherry picked from commit 7040c207baa6b5d5f6065a47dd3559f3d3974a1b)

8 months agolibstdc++: Fix std::vector<bool>::emplace to forward parameter
Jonathan Wakely [Sat, 26 Oct 2024 20:24:58 +0000 (21:24 +0100)] 
libstdc++: Fix std::vector<bool>::emplace to forward parameter

If the parameter is not lvalue-convertible to bool then the current code
will fail to compile. The parameter should be forwarded to restore the
original value category.

libstdc++-v3/ChangeLog:

* include/bits/stl_bvector.h (emplace_back, emplace): Forward
parameter pack to preserve value category.
* testsuite/23_containers/vector/bool/emplace_rvalue.cc: New
test.

(cherry picked from commit f1c844be5202f4be446f165d9a7625eb7ec4c5b4)

8 months agolibstdc++: Fix typo in comment in hashtable.h
Jonathan Wakely [Tue, 5 Nov 2024 23:55:08 +0000 (23:55 +0000)] 
libstdc++: Fix typo in comment in hashtable.h

And tweak grammar in a couple of comments.

libstdc++-v3/ChangeLog:

* include/bits/hashtable.h: Fix spelling in comment.

(cherry picked from commit bcf40c70f8b0fbc54ec14adea31f274e1791b1ed)

8 months agolibstdc++: Minor comment improvements in <bits/hashtable.h>
Jonathan Wakely [Fri, 1 Nov 2024 12:46:26 +0000 (12:46 +0000)] 
libstdc++: Minor comment improvements in <bits/hashtable.h>

libstdc++-v3/ChangeLog:

* include/bits/hashtable.h: Improve comments.

(cherry picked from commit db798ee38a3f81eff207e889c36c727bb370112c)

8 months agolibstdc++: Add missing parts of LWG 3480 for directory iterators [PR117560]
Jonathan Wakely [Thu, 14 Nov 2024 01:14:44 +0000 (01:14 +0000)] 
libstdc++: Add missing parts of LWG 3480 for directory iterators [PR117560]

It looks like I only read half the resolution of LWG 3480 and decided we
already supported it. As well as making the non-member overloads of end
take their parameters by value, we need some specializations of the
enable_borrowed_range and enable_view variable templates.

libstdc++-v3/ChangeLog:

PR libstdc++/117560
* include/bits/fs_dir.h (enable_borrowed_range, enable_view):
Define specializations for directory iterators, as per LWG 3480.
* testsuite/27_io/filesystem/iterators/lwg3480.cc: New test.

(cherry picked from commit eec6e8923586b9a54e37f32cef112d26d86e8f01)

8 months agolibstdc++: Fix calculation of system time in performance tests
Jonathan Wakely [Wed, 13 Nov 2024 16:47:04 +0000 (16:47 +0000)] 
libstdc++: Fix calculation of system time in performance tests

The system_time() function used the wrong element of the splits array.

Also add a comment about the units for time measurements.

libstdc++-v3/ChangeLog:

* testsuite/util/testsuite_performance.h (time_counter): Add
comment about times.
(time_counter::system_time): Use correct split value.

(cherry picked from commit 19d0720f68c2617f1b9b686d3884333b60ca75da)

8 months agolibstdc++: Use __is_single_threaded() in performance tests
Jonathan Wakely [Wed, 13 Nov 2024 16:37:24 +0000 (16:37 +0000)] 
libstdc++: Use __is_single_threaded() in performance tests

With recent glibc releases the __gthread_active_p() function is always
true, so we always append "-thread" onto performance benchmark names.

Use the __gnu_cxx::__is_single_threaded() function instead.

libstdc++-v3/ChangeLog:

* testsuite/util/testsuite_performance.h: Use
__gnu_cxx::__is_single_threaded instead of __gthread_active_p().

(cherry picked from commit 2b92007016ce8de3fc0a8c4508a789b822ea8e6b)

8 months agolibstdc++: Add missing constraint to operator+ for std::move_iterator
Jonathan Wakely [Thu, 14 Nov 2024 10:50:34 +0000 (10:50 +0000)] 
libstdc++: Add missing constraint to operator+ for std::move_iterator

This constraint was added by the One Ranges proposal (P0896R4) and
then fixed by LWG 3293, but it was missing from libstdc++.

libstdc++-v3/ChangeLog:

* include/bits/stl_iterator.h (operator+): Add constraint to
move_iterator operator.
* testsuite/24_iterators/move_iterator/rel_ops_c++20.cc:

(cherry picked from commit f91e34644e66b2eb7f4930f17a30da9f49e7d4d2)

8 months agolibstdc++: Fix allocator-extended move ctor for std::basic_stacktrace [PR117822]
Jonathan Wakely [Thu, 28 Nov 2024 10:24:00 +0000 (10:24 +0000)] 
libstdc++: Fix allocator-extended move ctor for std::basic_stacktrace [PR117822]

libstdc++-v3/ChangeLog:

PR libstdc++/117822
* include/std/stacktrace (stacktrace(stacktrace&&, const A&)):
Fix typo in qualified-id for is_always_equal trait.
* testsuite/19_diagnostics/stacktrace/stacktrace.cc: Test
allocator-extended constructors and allocator propagation.

(cherry picked from commit fe04901737112abb6b1a71fe645f727384dc986a)

8 months agolibstdc++: Fix std::basic_stracktrace to not assume allocators throw std::bad_alloc
Jonathan Wakely [Tue, 24 Sep 2024 11:44:09 +0000 (12:44 +0100)] 
libstdc++: Fix std::basic_stracktrace to not assume allocators throw std::bad_alloc

The standard allows allocators to throw any kind of exception, not only
something that can be caught as std::bad_alloc. std::basic_stracktrace
was assuming std::bad_alloc.

libstdc++-v3/ChangeLog:

* include/std/stacktrace (basic_stacktrace::_Impl::_M_allocate):
Do not assume allocators only throw std::bad_alloc.

(cherry picked from commit c45844eb7dadcd48e3ce84444a45c270382f7ad1)

8 months ago[PATCH] PR modula2/116918 -fswig correct syntax fixup
Gaius Mulley [Mon, 2 Dec 2024 21:34:38 +0000 (21:34 +0000)] 
[PATCH] PR modula2/116918 -fswig correct syntax fixup

This patch adds a missing % escape in DoCheckUnbounded.

gcc/m2/ChangeLog:

PR modula2/116918
* gm2-compiler/M2Swig.mod (DoCheckUnbounded): Escape
the % character used in array_functions with %%.

(cherry picked from commit e2a701cd0419a1898a2a359711572a8bcf4f8eb3)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months agoFortran: passing inquiry ref of complex array to assumed rank dummy [PR117774]
Harald Anlauf [Mon, 25 Nov 2024 21:55:10 +0000 (22:55 +0100)] 
Fortran: passing inquiry ref of complex array to assumed rank dummy [PR117774]

PR fortran/117774

gcc/fortran/ChangeLog:

* trans-expr.cc (gfc_conv_procedure_call): When passing an array
to an assumed-rank dummy, terminate search for array reference of
actual argument before an inquiry reference (e.g. INQUIRY_RE,
INQUIRY_IM) so that bounds update works properly.

gcc/testsuite/ChangeLog:

* gfortran.dg/assumed_rank_25.f90: New test.

(cherry picked from commit eff7e72815ada5c70c974d42f6a419e29a03eb27)

8 months ago[PATCH] PR modula2/116918 -fswig correct syntax
Gaius Mulley [Mon, 2 Dec 2024 20:25:25 +0000 (20:25 +0000)] 
[PATCH] PR modula2/116918 -fswig correct syntax

This patch fixes the syntax for the generated swig interface file.
The % characters in fprintf require escaping.

gcc/m2/ChangeLog:

PR modula2/116918
* gm2-compiler/M2Swig.mod (AnnotateProcedure): Capitalize
the generated comment, split comment into multiple lines and
terminate the comment with ".  */".
(DoCheckUnbounded): Escape the % character with %%.
(DoWriteFile): Ditto.

(cherry picked from commit fda30a3c8a7c6b06f02be40e3fd0740f893a1b4f)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months ago[PATCH] modula2: Add noreturn attribute to m2/gm2-libs/M2RTS.mod
Gaius Mulley [Mon, 2 Dec 2024 18:03:31 +0000 (18:03 +0000)] 
[PATCH] modula2: Add noreturn attribute to m2/gm2-libs/M2RTS.mod

This patch removes a build warning by adding a noreturn attribute
to the M2RTS.mod:HaltC procedure.  Also add an infinite loop to
gm2-libs-min/M2RTS.mod.

gcc/m2/ChangeLog:

* Make-lang.in (m2/gm2-libs-boot/M2RTS.o): Remove
--suppress-noreturn.
* gm2-libs/M2RTS.mod (HaltC): Add noreturn attribute.
* gm2-libs-min/M2RTS.mod (HALT): Add LOOP END.

(cherry picked from commit 5ef52ec422b8b92539baaa761ad878ccb6f82db8)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months ago[PATCH] PR modula2/117555: Add missing return statement after raise
Gaius Mulley [Mon, 2 Dec 2024 14:34:32 +0000 (14:34 +0000)] 
[PATCH] PR modula2/117555: Add missing return statement after raise

This patch adds missing return statements after a call to RAISE.  Four
of the modules in libgm2 have procedure functions with missing return
statements.  These errors were exposed after the reimplementation of
parameter declaration patch and triggered by -Wreturn-type.  The patch
also adds exit statements to the M2RTS noreturn functions.

gcc/m2/ChangeLog:

PR modula2/117555
* gm2-libs-iso/EXCEPTIONS.mod (CurrentNumber): Add return
statement.
* gm2-libs-iso/IOChan.mod (ReadResult): Ditto.
(CurrentFlags): Ditto.
(DeviceError): Ditto.
* gm2-libs-iso/IOLink.mod (DeviceTablePtrValue): Ditto.
* gm2-libs-iso/LongConv.mod (ValueReal): Ditto.
* gm2-libs/M2RTS.mod (Halt): Add noreturn attribute.
Add exit (1).
(HaltC): Add exit (1).
* pge-boot/GM2RTS.cc (M2RTS_Halt): Add exit (1).
(M2RTS_HaltC): Ditto.

(cherry picked from commit e77fd9aa89c210db6006fcefb03d80bae0fae851)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months agoarm, mve: Adding missing Runtime Library Exception to header files
Andre Vieira [Mon, 2 Dec 2024 13:35:03 +0000 (13:35 +0000)] 
arm, mve: Adding missing Runtime Library Exception to header files

Add missing Runtime Library Exception to mve header files to bring them into
line with other similar headers. Not adding it in the first place was an
oversight.

gcc/ChangeLog:

* config/arm/arm_mve.h: Add Runtime Library Exception.
* config/arm/arm_mve_types.h: Likewise.

(cherry picked from commit cde7ce0628f66a5d03cc97c70d4695e6f2acd4db)

8 months ago[PATCH] PR modula2/117555: libgm2 build failure after r15-5081-g95960cd473297c
Gaius Mulley [Mon, 2 Dec 2024 13:25:14 +0000 (13:25 +0000)] 
[PATCH] PR modula2/117555: libgm2 build failure after r15-5081-g95960cd473297c

This patch adds missing return statements to library procedure
functions.  These missing statements occur after a call to RAISE.

gcc/m2/ChangeLog:

PR modula2/117555
* gm2-libs-iso/M2EXCEPTION.mod (M2Exception): Add missing
return statement.
* gm2-libs-iso/RealConv.mod (ValueReal): Ditto.
* gm2-libs-iso/RndFile.mod (StartPos): Ditto.
(EndPos): Ditto.
(NewPos): Ditto.
* gm2-libs-iso/ShortConv.mod (ValueReal): Ditto.
* gm2-libs-iso/WholeConv.mod (ValueInt): Ditto.
(ValueCard): Ditto.

(cherry picked from commit 6d90f5d0ae928320e6e4ce9fce8e658404d8cb72)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months agoDaily bump.
GCC Administrator [Mon, 2 Dec 2024 00:24:12 +0000 (00:24 +0000)] 
Daily bump.

8 months ago[PATCH] modula2: Tidyup remove unnecessary parameters
Gaius Mulley [Sun, 1 Dec 2024 23:09:44 +0000 (23:09 +0000)] 
[PATCH] modula2: Tidyup remove unnecessary parameters

This patch removes ununsed parameters from gm2-compiler/M2Comp.mod.

gcc/m2/ChangeLog:

* gm2-compiler/M2Comp.mod (GenerateDependencies): Remove
unused parameter.
(WriteDep): Remove parameter dep.
(WritePhoneDep): Ditto.

(cherry picked from commit 20486ec75734f3e641a3ade4297f6ba64881bca8)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months ago[PATCH] modula2: Remove unused parameter warnings seen in build
Gaius Mulley [Sun, 1 Dec 2024 14:41:40 +0000 (14:41 +0000)] 
[PATCH] modula2: Remove unused parameter warnings seen in build

This patch removes unused parameters in gm2-compiler/M2Check.mod.
It also removes a --fixme-- and completes the missing code
which type checks unbounded arrays.  The patch also fixes a
build error seen when building m2/stage2/cc1gm2.

gcc/m2/ChangeLog:

* gm2-compiler/M2Check.mod (checkUnboundedArray): New
procedure function.
(checkUnboundedUnbounded): Ditto.
(checkUnbounded): Rewrite to check the unbounded data
type.
(checkPair): Add comment.
(doCheckPair): Add comment.
Remove tinfo parameter from the call to checkTypeKindViolation.
(checkTypeKindViolation): Remove ununsed parameter tinfo.
* gm2-libs-ch/UnixArgs.cc (GM2RTS.h): Remove include.
* gm2-libs-ch/m2rts.h (M2RTS_INIT): New define.
(M2RTS_DEP): Ditto.
(M2RTS_RegisterModule): New prototype.
(GM2RTS.h): Add include to the MC_M2 block.

gcc/testsuite/ChangeLog:

* gm2/iso/fail/testarrayunbounded2.mod: New test.
* gm2/iso/fail/testarrayunbounded3.mod: New test.
* gm2/iso/fail/testarrayunbounded4.mod: New test.
* gm2/iso/fail/testarrayunbounded5.mod: New test.
* gm2/iso/fail/testarrayunbounded6.mod: New test.
* gm2/iso/pass/testarrayunbounded.mod: New test.

(cherry picked from commit 2828ec526eaf5612178b62d48bfd8443c7ecd674)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months agoDaily bump.
GCC Administrator [Sun, 1 Dec 2024 00:26:11 +0000 (00:26 +0000)] 
Daily bump.

8 months agoFortran: Fix failing character pointer fcn assignment [PR105054]
Paul Thomas [Wed, 13 Nov 2024 08:57:55 +0000 (08:57 +0000)] 
Fortran: Fix failing character pointer fcn assignment [PR105054]

2024-11-14  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/105054
* resolve.cc (get_temp_from_expr): If the pointer function has
a deferred character length, generate a new deferred charlen
for the temporary.

gcc/testsuite/
PR fortran/105054
* gfortran.dg/ptr_func_assign_6.f08: New test.

(cherry picked from commit f530a8c61383b174a476b64f46d56adeedf49dc4)

8 months ago[PATCH] modula2: gcc/m2/Make-lang.in fix includes during bootstrap build
Gaius Mulley [Sat, 30 Nov 2024 02:22:37 +0000 (02:22 +0000)] 
[PATCH] modula2: gcc/m2/Make-lang.in fix includes during bootstrap build

This patch fixes the include directories used when building objects in
gm2-compiler-boot.  It adds the missing gm2-gcc directory and uses a
new variable GM2_BOOT_INCLUDES for all gm2-compiler-boot rules.

gcc/m2/ChangeLog:

* Make-lang.in (GM2_BOOT_INCLUDES): New variable.
(m2/gm2-compiler-boot/M2GCCDeclare.o): Rewrite to use
GM2_BOOT_INCLUDES.
(m2/gm2-compiler-boot/M2Error.o): Ditto.
(m2/gm2-compiler-boot/%.o): Ditto.

(cherry picked from commit 58bc39c73ca9aeca3d62d2d963be0121d0efeeac)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months agoDaily bump.
GCC Administrator [Sat, 30 Nov 2024 00:25:55 +0000 (00:25 +0000)] 
Daily bump.

8 months ago[PATCH] PR modula2/116181 Use GCC tree location_t and separate pointer types
Gaius Mulley [Fri, 29 Nov 2024 22:34:49 +0000 (22:34 +0000)] 
[PATCH] PR modula2/116181 Use GCC tree location_t and separate pointer types

This patch fixes all remaining -Wodr warnings in the modula-2 front end.
It removes the m2 Tree and m2 Location definitions and uses tree and
location_t throughout.  This allows the bootstrap tool mc to pick up the
GCC definitions for these data types (for the C translation of m2 sources).

The patch introduces a new module CDataTypes which contain two pointer
types: CharStar and ConstCharStar.  These map onto their C counterparts
when processed by mc however currently gm2 treats them as ADDRESS.
It might be sensible to have the gm2 versions of these data types
implemented though a builtin module in the future.

gcc/m2/ChangeLog:

PR modula2/116181
* Make-lang.in (GM2-GCC-DEFS): Add gcctypes.def and
CDataTypes.def.
(MC-LIB-DEFS): Add CDataTypes.def.
* Make-maintainer.in (m2/gm2-pge-boot/$(SRC_PREFIX)M2RTS.o):
Change include path to pge-boot.
(m2/gm2-pge-boot/$(SRC_PREFIX)SymbolKey.o): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)NameKey.o): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)Lists.o): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)Output.o): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)bnflex.o): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)RTentity.h): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)RTentity.o): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)%.o): Ditto.
(GM2PATH): Add -I$(srcdir)/m2/gm2-gcc.
(m2/mc-boot-gen/$(SRC_PREFIX)%.h): Add -I$(srcdir)/m2/gm2-gcc.
(m2/mc-boot-gen/$(SRC_PREFIX)%.cc): Ditto.
* gm2-compiler/M2ALU.def (PushIntegerTree): Replace Tree with tree.
(PopIntegerTree): Ditto.
(PushRealTree): Ditto.
(PopRealTree): Ditto.
(PushComplexTree): Ditto.
(PopComplexTree): Ditto.
(PushSetTree): Ditto.
(PopSetTree): Ditto.
(PopConstructorTree): Ditto.
(ConstructSetConstant): Ditto.
(BuildRange): Ditto.
(CheckOrResetOverflow): Ditto.
(PushTypeOfTree): Ditto.
* gm2-compiler/M2ALU.mod (Tree): Replace with ...
(tree): ... this.
(gcctypes): Import location_t and tree.
(m2linemap): Remove import of location_t.
* gm2-compiler/M2Base.def (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/M2Base.mod (gcctypes): Import of location_t.
(m2linemap): Remove import of location_t.
* gm2-compiler/M2Bitset.mod (m2tree): Remove import of Tree.
* gm2-compiler/M2CaseList.mod (gcctypes): Import tree.
(m2tree): Remove import of Tree.
(Tree): Replace with ...
(tree): ... this.
* gm2-compiler/M2Emit.def (gcctypes): Import location_t.
* gm2-compiler/M2GCCDeclare.def (gcctypes): Import tree.
(PromoteToString): Replace Tree with tree.
(PromoteToCString): Ditto.
(ConstantKnownAndUsed): Ditto.
* gm2-compiler/M2GCCDeclare.mod (gcctypes): Import tree.
(m2tree): Remove import of Tree.
(Tree): Replace with ...
(tree): ... this.
* gm2-compiler/M2GenGCC.def (gcctypes): Import tree.
(m2tree): Remove import of Tree.
(Tree): Replace with ...
(tree): ... this.
(GetHighFromUnbounded): Replace Tree with tree.
(StringToChar): Ditto.
(LValueToGenericPtr): Ditto.
(ZConstToTypedConst): Ditto.
(PrepareCopyString): Ditto.
* gm2-compiler/M2GenGCC.mod (gcctypes): Import tree.
(m2tree): Remove import of Tree.
(Tree): Replace with ...
(tree): ... this.
* gm2-compiler/M2LangDump.def (gcctypes): Import tree.
(m2tree): Remove import of Tree.
(Tree): Replace with ...
(tree): ... this.
* gm2-compiler/M2LangDump.mod (Tree): Replace with ...
(tree): ... this.
* gm2-compiler/M2LexBuf.def (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/M2LexBuf.mod (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/M2Options.def (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/M2Options.mod (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/M2Range.def (m2linemap): Replace with ...
(gcctypes): ... this.
(CDataTypes): Import ConstCharStar.
(CodeErrorCheck): Replace Tree with tree.
(OverlapsRange): Ditto.
(IsEqual): Ditto.
(IsGreaterOrEqual): Ditto.
(IsGreater): Ditto.
(BuildIfCallWholeHandlerLoc): Replace Tree with tree.
Replace ADDRESS with ConstCharStar.
(BuildIfCallRealHandlerLoc): Ditto.
(GetMinMax): Ditto.
* gm2-compiler/M2Range.mod (m2tree): Remove Tree.
(CodeErrorCheck): Replace Tree with tree.
(OverlapsRange): Ditto.
(IsEqual): Ditto.
(IsGreaterOrEqual): Ditto.
(IsGreater): Ditto.
(GetMinMax): Ditto.
(BuildIfCallWholeHandlerLoc): Replace Tree with tree.
Replace ADDRESS with ConstCharStar.
(BuildIfCallRealHandlerLoc): Ditto.
* gm2-compiler/M2System.def (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/M2System.mod (m2linemap): Replace with ...
(gcctypes): ... this.
(CreateMinMaxFor): Replace Tree with tree.
(CreateType): Ditto.
(AttemptToCreateType): Ditto.
(CreateSetType): Ditto.
(AttemptToCreateSetType): Ditto.
* gm2-compiler/P2SymBuild.mod (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/SymbolConversion.def (m2tree): Replace with ...
(gcctypes): ... this.
(Mod2Gcc): Replace Tree with tree.
(Gcc2Mod): Ditto.
(AddModGcc): Ditto.
* gm2-compiler/SymbolConversion.mod (m2tree): Replace with ...
(gcctypes): ... this.
(Mod2Gcc): Replace Tree with tree.
(Gcc2Mod): Ditto.
(AddModGcc): Ditto.
(Mod2GccWithoutGCCPoison): Ditto.
* gm2-compiler/SymbolTable.def (m2tree): Replace with ...
(gcctypes): ... this.
(PutModuleFinallyFunction): Replace Tree with tree.
(GetModuleFinallyFunction): Ditto.
* gm2-compiler/SymbolTable.mod (m2tree): Replace with ...
(gcctypes): ... this.
(PutModuleFinallyFunction): Replace Tree with tree.
(GetModuleFinallyFunction): Ditto.
* gm2-compiler/m2flex.def (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-gcc/init.def (PerCompilationInit): Replace ADDRESS with ConstCharStar.
(CDataTypes): Import ConstCharStar.
* gm2-gcc/m2block.def (SYSTEM): Remove import.
(CDataTypes): Import ConstCharStar.
(m2linemap): Remove import.
(m2tree): Remove import.
(gcctypes): Import tree.
(global_constant): Replace Tree with tree.
(RememberInitModuleFunction): Ditto.
(DumpGlobalConstants): Ditto.
(RememberConstant): Ditto.
(RememberType): Ditto.
(pushDecl): Ditto.
(popFunctionScope): Ditto.
(pushFunctionScope): Ditto.
(finishFunctionCode): Ditto.
(finishFunctionDecl): Ditto.
(GetErrorNode): Ditto.
(includeDecl): Ditto.
(GetGlobals): Ditto.
(GetGlobalContext): Ditto.
(begin_statement_list): Ditto.
(push_statement_list): Ditto.
(pop_statement_list): Ditto.
(getLabel): Replace Tree with tree.
Replace ADDRESS with ConstCharStar.
* gm2-gcc/m2builtins.def (CDataTypes): Import ConstCharStar.
(GetBuiltinConst): Replace Tree with tree.
(GetBuiltinConstType): Ditto.
(GetBuiltinTypeInfoType): Ditto.
(GetBuiltinTypeInfo): Ditto.
(BuiltinExists): Ditto.
(BuildBuiltinTree): Ditto.
(BuiltinMemCopy): Ditto.
(BuiltinMemSet): Ditto.
(BuiltInAlloca): Ditto.
(BuiltInIsfinite): Ditto.
* gm2-gcc/m2convert.def (CDataTypes): Import ConstCharStar.
(ToWord): Ditto.
(ToCardinal): Ditto.
(ToInteger): Ditto.
(ToBitset): Ditto.
(ConvertToPtr): Ditto.
(BuildConvert): Ditto.
(ConvertConstantAndCheck): Ditto.
(ConvertString): Ditto.
(GenericToType): Ditto.
* gm2-gcc/m2decl.cc (m2decl_BuildParameterDeclaration): Add
const attribute.
* gm2-gcc/m2decl.def (CDataTypes): Import ConstCharStar.
(BuildModuleCtor): Ditto.
(DeclareModuleCtor): Ditto.
(DeclareM2linkForcedModuleInitOrder): Ditto.
(DeclareM2linkStaticInitialization): Ditto.
(BuildPtrToTypeString): Ditto.
(BuildIntegerConstant): Ditto.
(BuildStringConstantType): Ditto.
(DeclareKnownVariable): Ditto.
(DeclareKnownConstant): Ditto.
(BuildParameterDeclaration): Ditto.
(BuildEndFunctionDeclaration): Ditto.
(RememberVariables): Ditto.
(BuildConstLiteralNumber): Ditto.
(BuildStringConstant): Ditto.
(BuildCStringConstant): Ditto.
(GetDeclContext): Ditto.
* gm2-gcc/m2decl.h (m2decl_BuildParameterDeclaration): Add
const attribute.
* gm2-gcc/m2except.def (CDataTypes): Import ConstCharStar.
(BuildThrow): Ditto.
(BuildTryBegin): Ditto.
(BuildTryEnd): Ditto.
(BuildCatchBegin): Ditto.
(BuildCatchEnd): Ditto.
* gm2-gcc/m2expr.def (CDataTypes): Import ConstCharStar.
(CSTIntToString): Ditto.
(CSTIntToChar): Ditto.
(CheckConstStrZtypeRange): Ditto.
(CompareTrees): Ditto.
(GetPointerOne): Ditto.
(GetPointerZero): Ditto.
(GetWordOne): Ditto.
(GetWordZero): Ditto.
(GetIntegerOne): Ditto.
(GetIntegerZero): Ditto.
(GetCardinalOne): Ditto.
(GetCardinalZero): Ditto.
(GetSizeOfInBits): Ditto.
(GetSizeOf): Ditto.
(BuildLogicalRotate): Ditto.
(BuildLRRn): Ditto.
(BuildLRLn): Ditto.
(BuildMask): Ditto.
(BuildMult): Ditto.
(BuildMultCheck): Ditto.
(BuildLRR): Ditto.
(BuildLRL): Ditto.
(BuildLogicalShift): Ditto.
(BuildLSR): Ditto.
(BuildLSL): Ditto.
(BuildDivM2): Ditto.
(BuildDivM2Check): Ditto.
(BuildModM2): Ditto.
(BuildModM2Check): Ditto.
(BuildModFloor): Ditto.
(BuildDivCeil): Ditto.
(BuildModCeil): Ditto.
(BuildDivFloor): Ditto.
(BuildModTrunc): Ditto.
(BuildDivTrunc): Ditto.
(BuildDivTruncCheck): Ditto.
(BuildRDiv): Ditto.
(BuildSubCheck): Ditto.
(BuildAddCheck): Ditto.
(BuildSub): Ditto.
(BuildAdd): Ditto.
(FoldAndStrip): Ditto.
(StringLength): Ditto.
(TreeOverflow): Ditto.
(RemoveOverflow): Ditto.
(BuildCoerce): Ditto.
(BuildTrunc): Ditto.
(BuildNegate): Ditto.
(BuildNegateCheck): Ditto.
(BuildSetNegate): Ditto.
(BuildTBitSize): Ditto.
(BuildSize): Ditto.
(BuildAddr): Ditto.
(BuildOffset1): Ditto.
(BuildOffset): Ditto.
(BuildLogicalOrAddress): Ditto.
(BuildLogicalOr): Ditto.
(BuildLogicalAnd): Ditto.
(BuildSymmetricDifference): Ditto.
(BuildLogicalDifference): Ditto.
(BuildLessThan): Ditto.
(BuildGreaterThan): Ditto.
(BuildLessThanOrEqual): Ditto.
(BuildGreaterThanOrEqual): Ditto.
(BuildEqualTo): Ditto.
(BuildNotEqualTo): Ditto.
(BuildIsSuperset): Ditto.
(BuildIsNotSuperset): Ditto.
(BuildIsSubset): Ditto.
(BuildIsNotSubset): Ditto.
(BuildIfConstInVar): Ditto.
(BuildIfNotConstInVar): Ditto.
(BuildIfVarInVar): Ditto.
(BuildIfNotVarInVar): Ditto.
(BuildForeachWordInSetDoIfExpr): Ditto.
(BuildIfInRangeGoto): Ditto.
(BuildIfNotInRangeGoto): Ditto.
(BuildArray): Ditto.
(BuildComponentRef): Ditto.
(BuildIndirect): Ditto.
(IsTrue): Ditto.
(IsFalse): Ditto.
(GetCstInteger): Ditto.
(AreConstantsEqual): Ditto.
(AreRealOrComplexConstantsEqual): Ditto.
(DetermineSign): Ditto.
(BuildCap): Ditto.
(BuildAbs): Ditto.
(BuildRe): Ditto.
(BuildIm): Ditto.
(BuildCmplx): Ditto.
(BuildBinaryForeachWordDo): Ditto.
(BuildBinarySetDo): Ditto.
(ConstantExpressionWarning): Ditto.
(BuildAddAddress): Ditto.
(calcNbits): Ditto.
(OverflowZType): Ditto.
(BuildCondIfExpression): Ditto.
* gm2-gcc/m2linemap.def (CDataTypes): Import ConstCharStar.
* gm2-gcc/m2misc.def (m2tree): Replace with ...
(gcctypes): ... this.
(DebugTree): Replace Tree with tree.
* gm2-gcc/m2pp.def (m2tree): Replace with ...
(gcctypes): ... this.
(DumpGimpleFd): Replace Tree with tree.
* gm2-gcc/m2statement.cc (m2statement_BuildBuiltinCallTree):
Remove unused location parameter.
* gm2-gcc/m2statement.def (m2linemap): Replace with ...
(gcctypes): ... this.
(CDataTypes): Import CharStar.
(DoJump): Replace Tree with tree.
Replace ADDRESS with CharStar.
(BuildStartFunctionCode): Replace Tree with tree.
(BuildEndFunctionCode): Ditto.
(BuildReturnValueCode): Ditto.
(BuildAssignmentTree): Ditto.
(BuildAssignmentStatement): Ditto.
(BuildGoto): Ditto.
(DeclareLabel): Ditto.
(BuildIfThenDoEnd): Ditto.
(BuildIfThenElseEnd): Ditto.
(BuildParam): Ditto.
(BuildFunctionCallTree): Ditto.
(BuildProcedureCallTree): Ditto.
(BuildIndirectProcedureCallTree): Ditto.
(BuildFunctValue): Ditto.
(BuildCall2): Ditto.
(BuildCall3): Ditto.
(SetLastFunction): Ditto.
(GetLastFunction): Ditto.
(GetParamTree): Ditto.
(BuildTryFinally): Ditto.
(BuildCleanUp): Ditto.
(BuildAsm): Ditto.
(BuildUnaryForeachWordDo): Ditto.
(BuildExcludeVarConst): Ditto.
(BuildExcludeVarVar): Ditto.
(BuildIncludeVarConst): Ditto.
(BuildIncludeVarVar): Ditto.
(BuildStart): Ditto.
(BuildEnd): Ditto.
(BuildCallInner): Ditto.
(BuildBuiltinCallTree):  Remove unused location parameter.
* gm2-gcc/m2statement.h (m2statement_BuildBuiltinCallTree): Remove
unused location parameter.
* gm2-gcc/m2tree.def (gcctypes): Import tree.
(IsAConstant): Replace Tree with tree.
(IsOrdinal): Ditto.
(IsTreeOverflow): Ditto.
(skip_const_decl): Ditto.
(skip_type_decl): Ditto.
(is_type): Ditto.
(is_array): Ditto.
(is_var): Ditto.
(debug_tree): Ditto.
(IstreeOverflow): Ditto.
* gm2-gcc/m2treelib.def (m2linemap): Replace with ...
(gcctypes): ... this.
(get_set_address_if_var): Ditto.
(get_set_field_rhs): Ditto.
(get_set_field_lhs): Ditto.
(get_set_address): Ditto.
(get_set_value): Ditto.
(get_field_no): Ditto.
(get_rvalue): Ditto.
(DoCall): Ditto.
(build_modify_expr): Ditto.
(do_jump_if_bit): Ditto.
* gm2-gcc/m2type.def (m2linemap): Replace with ...
(gcctypes): ... this.
(m2tree): Remove.
(CDataTypes): Import ConstCharStar and charStar.
(ValueInTypeRange): Replace Tree with tree.
(ValueOutOfTypeRange): Ditto.
(ExceedsTypeRange): Ditto.
(WithinTypeRange): Ditto.
(BuildSubrangeType): Ditto.
(BuildCharConstant): Ditto.
(BuildCharConstantChar): Ditto.
(BuildArrayConstructorElement): Ditto.
(BuildEndArrayConstructor): Ditto.
(BuildStartArrayConstructor): Ditto.
(BuildRecordConstructorElement): Ditto.
(BuildEndRecordConstructor): Ditto.
(BuildStartRecordConstructor): Ditto.
(BuildEndSetConstructor): Ditto.
(BuildSetConstructorElement): Ditto.
(BuildStartSetConstructor): Ditto.
(BuildSetType): Ditto.
(BuildConstPointerType): Ditto.
(BuildPointerType): Ditto.
(BuildEnumerator): Ditto.
(BuildEndEnumeration): Ditto.
(BuildStartEnumeration): Ditto.
(BuildTypeDeclaration): Ditto.
(GetMaxFrom): Ditto.
(GetMinFrom): Ditto.
(GetDefaultType): Ditto.
(BuildEndType): Ditto.
(BuildStartType): Ditto.
(BuildVariableArrayAndDeclare): Ditto.
(BuildProcTypeParameterDeclaration): Ditto.
(BuildStartFunctionType): Ditto.
(BuildEndFunctionType): Ditto.
(GetTreeType): Ditto.
(DeclareKnownType): Ditto.
(GetM2ZType): Ditto.
(GetM2RType): Ditto.
(BuildSetTypeFromSubrange): Ditto.
(BuildSmallestTypeRange): Ditto.
(GetBooleanType): Ditto.
(GetBooleanFalse): Ditto.
(GetBooleanTrue): Ditto.
(GetPackedBooleanType): Ditto.
(GetCharType): Ditto.
(GetByteType): Ditto.
(GetVoidType): Ditto.
(GetBitnumType): Ditto.
(GetRealType): Ditto.
(GetLongRealType): Ditto.
(GetShortRealType): Ditto.
(GetLongIntType): Ditto.
(GetPointerType): Ditto.
(GetCardinalType): Ditto.
(GetIntegerType): Ditto.
(GetWordType): Ditto.
(GetM2CardinalType): Ditto.
(GetBitsetType): Ditto.
(GetM2CType): Ditto.
(GetProcType): Ditto.
(GetM2ComplexType): Ditto.
(GetM2LongComplexType): Ditto.
(GetM2ShortComplexType): Ditto.
(GetM2Complex128): Ditto.
(GetM2Complex96): Ditto.
(GetM2Complex64): Ditto.
(GetM2Complex32): Ditto.
(GetM2Real128): Ditto.
(GetM2Real96): Ditto.
(GetM2Real64): Ditto.
(GetM2Real32): Ditto.
(GetM2Bitset32): Ditto.
(GetM2Bitset16): Ditto.
(GetM2Bitset8): Ditto.
(GetM2Word64): Ditto.
(GetM2Word32): Ditto.
(GetM2Word16): Ditto.
(GetM2Cardinal64): Ditto.
(GetM2Cardinal32): Ditto.
(GetM2Cardinal16): Ditto.
(GetM2Cardinal8): Ditto.
(GetM2Integer64): Ditto.
(GetM2Integer32): Ditto.
(GetM2Integer16): Ditto.
(GetM2Integer8): Ditto.
(GetISOLocType): Ditto.
(GetISOByteType): Ditto.
(GetISOWordType): Ditto.
(GetShortCardType): Ditto.
(GetM2ShortCardType): Ditto.
(GetShortIntType): Ditto.
(GetM2ShortIntType): Ditto.
(GetM2LongCardType): Ditto.
(GetM2LongIntType): Ditto.
(GetM2LongRealType): Ditto.
(GetM2RealType): Ditto.
(GetM2ShortRealType): Ditto.
(GetM2IntegerType): Ditto.
(GetM2CharType): Ditto.
(GetCSizeTType): Ditto.
(GetCSSizeTType): Ditto.
(BuildArrayStringConstructor): Ditto.
(RealToTree): Ditto.
(BuildStartRecord): Ditto.
(BuildStartUnion): Ditto.
(BuildStartVarient): Ditto.
(BuildEndVarient): Ditto.
(BuildStartFieldVarient): Ditto.
(BuildEndFieldVarient): Ditto.
(BuildStartFieldRecord): Ditto.
(BuildFieldRecord): Ditto.
(ChainOn): Ditto.
(ChainOnParamValue): Ditto.
(AddStringToTreeList): Ditto.
(BuildEndRecord): Ditto.
(SetAlignment): Ditto.
(SetDeclPacked): Ditto.
(SetTypePacked): Ditto.
(SetRecordFieldOffset): Ditto.
(BuildPackedFieldRecord): Ditto.
(BuildNumberOfArrayElements): Ditto.
(AddStatement): Ditto.
(MarkFunctionReferenced): Ditto.
(BuildArrayIndexType): Ditto.
(GetArrayNoOfElements): Ditto.
(BuildEndArrayType): Ditto.
(PutArrayType): Ditto.
(BuildStartArrayType): Ditto.
(IsAddress): Ditto.
(SameRealType): Ditto.
* m2.flex (Gm2linemap.h): Include.
* mc-boot/GDynamicStrings.cc: Rebuild.
* mc-boot/GFIO.cc: Ditto.
* mc-boot/GIndexing.cc: Ditto.
* mc-boot/GM2Dependent.cc: Ditto.
* mc-boot/GSArgs.cc: Ditto.
* mc-boot/GStringConvert.cc: Ditto.
* mc-boot/Gdecl.cc: Ditto.
* mc-boot/Gdecl.h: Ditto.
* mc-boot/Gdtoa.h: Ditto.
* mc-boot/Gkeyc.cc: Ditto.
* mc-boot/Gkeyc.h: Ditto.
* mc-boot/Glibc.h: Ditto.
* mc-boot/GmcComp.cc: Ditto.
* mc-boot/GmcLexBuf.cc: Ditto.
* mc-boot/GmcPreprocess.cc: Ditto.
* mc-boot/GmcStream.cc: Ditto.
* mc-boot/Gmcp1.cc: Ditto.
* mc-boot/Gmcp3.cc: Ditto.
* mc-boot/Gmcp4.cc: Ditto.
* mc-boot/Gmcp5.cc: Ditto.
* mc-boot/GnameKey.cc: Ditto.
* mc-boot/Gvarargs.cc: Ditto.
* mc/decl.def (putDefUnqualified): New procedure function.
(isDefUnqualified): Ditto.
* mc/decl.mod (defT): Add unqualified field.
(charStarN): New variable.
(constCharStarN): Ditto.
(checkGccType): New procedure.
(checkCDataTypes): Ditto.
(import): Call checkGccType and checkCDataTypes.
(putDefUnqualified): New procedure function.
(isDefUnqualified): Ditto.
* mc/keyc.def (useGccTree): New procedure.
(useGccLocation): Ditto.
* mc/keyc.mod (checkGccConfigSystem): Call checkGccConfigSystem.
(useGccTree): New procedure.
(useGccLocation): Ditto.
* mc/mcp1.bnf (decl): Import putDefUnqualified.
(Export): Call putDefUnqualified.
* gm2-gcc/CDataTypes.def: New file.
* gm2-gcc/gcctypes.def: New file.

(cherry picked from commit f6e629a7134c6b83be4542b8cd26b7c4483d17f4)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months ago[PATCH] PR modula2/116557 Remove physical address from the GPL header comment
Gaius Mulley [Fri, 29 Nov 2024 18:34:33 +0000 (18:34 +0000)] 
[PATCH] PR modula2/116557 Remove physical address from the GPL header comment

This patch removes the physical address from all the header comments
in the m2 subdirectory.  The physical address is replaced with the
text "You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>." instead.

gcc/m2/ChangeLog:

PR modula2/116557
* gm2-lang.cc: Replace physical address with URL in GPL header.
* gm2-lang.h: Ditto.
* images/LICENSE.IMG: Ditto.
* m2-tree.def: Ditto.
* mc-boot/GIndexing.cc: Ditto.
* mc-boot/Gkeyc.cc: Ditto.
* mc-boot/Glists.cc: Ditto.
* mc-boot/GmcComp.cc: Ditto.
* mc-boot/GmcDebug.cc: Ditto.
* mc-boot/GmcFileName.cc: Ditto.
* mc-boot/GmcMetaError.cc: Ditto.
* mc-boot/GmcOptions.cc: Ditto.
* mc-boot/GmcPreprocess.cc: Ditto.
* mc-boot/GmcPretty.cc: Ditto.
* mc-boot/GmcPrintf.cc: Ditto.
* mc-boot/GmcQuiet.cc: Ditto.
* mc-boot/GmcReserved.cc: Ditto.
* mc-boot/GmcSearch.cc: Ditto.
* mc-boot/GmcStack.cc: Ditto.
* mc/Indexing.mod: Ditto.
* mc/keyc.mod: Ditto.
* mc/lists.mod: Ditto.
* mc/mcComp.mod: Ditto.
* mc/mcDebug.mod: Ditto.
* mc/mcFileName.mod: Ditto.
* mc/mcMetaError.mod: Ditto.
* mc/mcOptions.mod: Ditto.
* mc/mcPreprocess.mod: Ditto.
* mc/mcPretty.mod: Ditto.
* mc/mcPrintf.mod: Ditto.
* mc/mcQuiet.mod: Ditto.
* mc/mcReserved.mod: Ditto.
* mc/mcSearch.mod: Ditto.
* mc/mcStack.mod: Ditto.
* tools-src/buildpg: Ditto.
* tools-src/calcpath: Ditto.
* tools-src/checkmeta.py: Ditto.
* tools-src/def2doc.py: Ditto.
* tools-src/makeSystem: Ditto.
* tools-src/tidydates.py: Ditto.

(cherry picked from commit 78dc2e2575c602c62d50a9522ea976020a5bf7aa)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months ago[PATCH] PR modula2/116181: m2rts fix -Wodr warning
Gaius Mulley [Fri, 29 Nov 2024 16:36:14 +0000 (16:36 +0000)] 
[PATCH] PR modula2/116181: m2rts fix -Wodr warning

This patch fixes the -Wodr warning seen in pge-boot/m2rts.h
when building pge.

gcc/m2/ChangeLog:

PR modula2/116181
* pge-boot/GM2RTS.h: Regenerate.
* pge-boot/m2rts.h: Ditto.

(cherry picked from commit 87ce8172f0bf649a8a79ef7481fb3bf35882083f)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months ago[PATCH] PR modula2/116181 remove ODR warnings from library interface files
Gaius Mulley [Fri, 29 Nov 2024 15:30:44 +0000 (15:30 +0000)] 
[PATCH] PR modula2/116181 remove ODR warnings from library interface files

This patch removes the warnings generated by -Wodr from the library
interface between modula-2 and C.

gcc/m2/ChangeLog:

PR modula2/116181
* Make-lang.in (MC_SRC_FLAGS): New macro.
(m2/mc-boot/$(SRC_PREFIX)%.o): Use MC_SRC_FLAGS.
(m2/mc-boot-ch/$(SRC_PREFIX)%.o): Ditto.
(m2/gm2-libs-boot/M2RTS.o): Ditto.
(m2/gm2-libs-boot/%.o): Ditto.
(GM2-LIBS-BOOT-H): New macro.
(m2/gm2-libs-boot/RTcodummy.o): Use MC_SRC_FLAGS.
Remove gm2-libs-host.h from the dependancy.
(m2/gm2-libs-boot/wrapc.o): Use MC_SRC_FLAGS.
Add dependancy GM2-LIBS-BOOT-H.
(m2/gm2-libs-boot/UnixArgs.o): Ditto.
(m2/gm2-libs-boot/choosetemp.o): Ditto.
(m2/gm2-libs-boot/errno.o): Ditto.
(m2/gm2-libs-boot/dtoa.o): Ditto.
(m2/gm2-libs-boot/ldtoa.o): Ditto.
(m2/gm2-libs-boot/termios.o): Ditto.
(m2/gm2-libs-boot/SysExceptions.o): Ditto.
(m2/gm2-compiler-boot/M2GCCDeclare.o): Add gm2-libs-ch to the
search path.
(m2/gm2-compiler-boot/M2Error.o): Ditto.
(m2/gm2-compiler-boot/%.o): Ditto.
(m2/pge-boot/%.o): Ditto.
* gm2-gcc/m2color.cc (m2color_colorize_start): Replace parameter
type char to void and recast to char * when calling colorize_start.
* gm2-gcc/m2color.h (m2color_colorize_start): Replace parameter
type char to void.
* gm2-gcc/m2type.h: Remove #if 0 block.
* gm2-libs-ch/SysExceptions.c (DECL_PROC_T): Provide alternative
defines for MC an gm2.
(PROC_FUNC): Ditto.
(EXTERN): Force undefine and redefine.
(SysExceptions_InitExceptionHandlers): Rewrite function
declaration using defined macros.
(_M2_SysExceptions_init): Use EXTERN.
(_M2_SysExceptions_finish): Replace with ...
(_M2_SysExceptions_fini): ... this and add parameters.
* gm2-libs-ch/UnixArgs.cc (gm2-libs-host.h): Include.
(GUnixArgs.h): Include.
(GM2RTS.h): Include.
(UnixArgs_GetArgV): Change return type to void *.
(UnixArgs_GetEnvV): Ditto.
* gm2-libs-ch/m2rts.h (M2RTS_RegisterModule_Cstr): Add new
conditional macro.
(M2RTS_RequestDependant): Remove.
(M2RTS_RegisterModule): Ditto.
(M2RTS_Terminate): Ditto.
(M2RTS_DeconstructModules): Ditto.
(M2RTS_Halt): Ditto.
(_M2_M2RTS_init): Ditto.
(M2RTS_ConstructModules): Ditto.
* gm2-libs-ch/termios.c (_termios_C): Define.
(EXTERN): Add conditional definition.
(doSetUnset): New function.
(_M2_termios_init): Add correct parameters.
(_M2_termios_finish): Ditto.
(_M2_termios_fini): Ditto.
* mc-boot-ch/GSysExceptions.c (DECL_PROC_T): New define.
(PROC_FUNC): Ditto.
(EXTERN): Force undef.
(SysExceptions_InitExceptionHandlers): Rewrite.
* mc-boot-ch/Glibc.c (libc_open): Rename parameter
oflag to flags.
* mc-boot-ch/Gtermios.cc (_termios_C): New define.
(KillTermios): Change parameter type from
struct termios * to termios_TERMIOS.
(tcsnow): Rewrite.
(tcsnow): Rewrite.
(tcsdrain): Rewrite.
(tcsflush): Rewrite.
(cfgetospeed): Rewrite.
(cfgetispeed): Rewrite.
(cfsetospeed): Rewrite.
(cfsetispeed): Rewrite.
(cfsetspeed): Rewrite.
(cfsetspeed): Rewrite.
(tcgetattr): Rewrite.
(tcsetattr): Rewrite.
(cfmakeraw): Rewrite.
(tcsendbreak): Rewrite.
(tcdrain): Rewrite.
(tcflushi): Rewrite.
(tcflusho): Rewrite.
(tcflushio): Rewrite.
(tcflowoni): Rewrite.
(tcflowoffi): Rewrite.
(tcflowono): Rewrite.
(tcflowoffo): Rewrite.
(GetFlag): Rewrite.
(SetFlag): Rewrite.
(GetChar): Rewrite.
(SetChar): Rewrite.
(InitTermios): Rewrite.
* pge-boot/GM2RTS.cc: Regenerate.
* pge-boot/GSysExceptions.cc: Ditto.
* pge-boot/Gtermios.cc: Ditto.
* pge-boot/m2rts.h: Rewrite.
* mc-boot-ch/GSYSTEM.h: New file.
* mc-boot-ch/GSysExceptions.h: New file.
* mc-boot-ch/Gtermios.h: New file.

(cherry picked from commit b8ef805e4d850971b9926fd81b4f0612ddffaf82)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
8 months agotree-optimization/117594 - fix live op vectorization for length masked case
Richard Biener [Mon, 18 Nov 2024 12:46:52 +0000 (13:46 +0100)] 
tree-optimization/117594 - fix live op vectorization for length masked case

The code was passing factor == 0 to vect_get_loop_len which always
returns an unmodified length, even if the number of scalar elements
doesn't agree.  It also failed to insert the eventually generated
code.

PR tree-optimization/117594
* tree-vect-loop.cc (vectorizable_live_operation_1): Pass
factor == 1 to vect_get_loop_len, insert generated stmts.

* gcc.dg/vect/pr117594.c: New testcase.

(cherry picked from commit c108785c425b2042f63fa975c58c274d19a8d160)

8 months agotree-optimization/117574 - bougs niter lt-to-ne
Richard Biener [Fri, 15 Nov 2024 10:56:14 +0000 (11:56 +0100)] 
tree-optimization/117574 - bougs niter lt-to-ne

When trying to change a IV from IV0 < IV1 to IV0' != IV1' we apply
fancy adjustments to the may_be_zero condition we compute rather
than using the obvious IV0->base >= IV1->base expression (to be
able to use > instead of >=?).  This doesn't seem to go well.

PR tree-optimization/117574
* tree-ssa-loop-niter.cc (number_of_iterations_lt_to_ne):
Use the obvious may_be_zero condition.

* gcc.dg/torture/pr117574-1.c: New testcase.

(cherry picked from commit ff5a14abeb31cd6bd0ca55e7043d05c8141a8c7f)

8 months agomiddle-end/117433 - ICE with gimple BLKmode reg copy
Richard Biener [Mon, 4 Nov 2024 10:39:05 +0000 (11:39 +0100)] 
middle-end/117433 - ICE with gimple BLKmode reg copy

When we end up expanding a SSA name copy with BLKmode regs which can
happen for vectors, possibly wrapped in a NOP-conversion or
a PAREN_EXPR and we are not optimizing we can end up with two
BLKmode MEMs that expand_gimple_stmt_1 doesn't properly handle
when expanding, trying to emit_move_insn them.  Looking at store_expr
which what expand_gimple_stmt_1 is really doing reveals a lot of
magic that's missing.  It eventually falls back to emit_block_move
(store_expr isn't exported), so this is what I ended up using here
given I think we'll only have BLKmode "registers" for vectors.

PR middle-end/117433
* cfgexpand.cc (expand_gimple_stmt_1): Use emit_block_move
when moving temp to BLKmode target.

* gcc.dg/pr117433.c: New testcase.

(cherry picked from commit 2fc25a21820001c67258d30f0960ac9cd0f268cf)

8 months agotree-optimization/117417 - ICE with complex load optimization
Richard Biener [Tue, 12 Nov 2024 10:15:15 +0000 (11:15 +0100)] 
tree-optimization/117417 - ICE with complex load optimization

When we decompose a complex load only used as real and imaginary
parts we fail to honor IL constraints which are that a BIT_FIELD_REF
of register type should be outermost in a ref.  The following
simply avoids the transform when the complex load has such a
BIT_FIELD_REF.

PR tree-optimization/117417
* tree-ssa-forwprop.cc (pass_forwprop::execute): Avoid
decomposing BIT_FIELD_REF complex load.

* gcc.dg/torture/pr117417.c: New testcase.

(cherry picked from commit d976daa931642d940b7b27032ca6139210c07eed)

8 months agotree-optimization/117333 - ICE with NULL access size DR
Richard Biener [Tue, 29 Oct 2024 08:42:12 +0000 (09:42 +0100)] 
tree-optimization/117333 - ICE with NULL access size DR

dr_may_alias_p ICEs when TYPE_SIZE of DR->ref is NULL but this is
valid IL when the access size of an aggregate copy can be infered
from the RHS.

PR tree-optimization/117333
* tree-data-ref.cc (dr_may_alias_p): Guard against NULL
access size.

* gcc.dg/torture/pr117333.c: New testcase.

(cherry picked from commit 0e99b22aa666f107c4035d32bfb5ab11534a9d2f)

8 months agotree-optimization/117307 - STMT_VINFO_SLP_VECT_ONLY mis-computation
Richard Biener [Mon, 28 Oct 2024 08:52:08 +0000 (09:52 +0100)] 
tree-optimization/117307 - STMT_VINFO_SLP_VECT_ONLY mis-computation

STMT_VINFO_SLP_VECT_ONLY isn't properly computed as union of all
group members and when the group is later split due to duplicates
not all sub-groups inherit the flag.

PR tree-optimization/117307
* tree-vect-data-refs.cc (vect_analyze_data_ref_accesses):
Properly compute STMT_VINFO_SLP_VECT_ONLY.  Set it on all
parts of a split group.

* gcc.dg/vect/pr117307.c: New testcase.

(cherry picked from commit 19722308a286d9a00eead8ac82b948da8c4ca38b)