diff options
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/ChangeLog | 23 | ||||
| -rw-r--r-- | gcc/DATESTAMP | 2 | ||||
| -rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/ada/sem_attr.adb | 53 | ||||
| -rw-r--r-- | gcc/algol68/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/calls.cc | 29 | ||||
| -rw-r--r-- | gcc/config/riscv/riscv.cc | 13 | ||||
| -rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
| -rw-r--r-- | gcc/fortran/ChangeLog | 31 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 47 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.dg/pr122947.c | 45 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.target/riscv/pr122675-1.c | 4 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.target/riscv/pr91420.c | 46 | ||||
| -rw-r--r-- | gcc/testsuite/gfortran.dg/pdt_76.f03 | 21 |
14 files changed, 300 insertions, 33 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3a9b1bd..ed720db 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,26 @@ +2025-12-06 Alexandre Oliva <oliva@adacore.com> + + PR rtl-optimization/122947 + * calls.cc (expand_call): Add stack function usage in + non-ACCUMULATE_OUTGOING_ARGS configurations. + +2025-12-06 Alexandre Oliva <oliva@adacore.com> + + PR target/91420 + * config/riscv/riscv.cc (riscv_symbolic_constant_p): Require + offsets smaller than +/- 1GiB for PCREL symbols. + +2025-12-06 Jakub Jelinek <jakub@redhat.com> + + * attribs.cc (decl_attributes): Use attribute_value_equal to + compare attribute values instead of simple_cst_equal. + +2025-12-06 Dimitar Dimitrov <dimitar@dinux.eu> + + PR rtl-optimization/122675 + * bb-reorder.cc (edge_order): Fix BB edge ordering to be + descending. + 2025-12-05 Vladimir N. Makarov <vmakarov@redhat.com> PR rtl-optimization/122215 diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 00fc5a3..47f4b89 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20251206 +20251207 diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f6a0fd3..fca1a9e 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2025-12-06 Denis Mazzucato <mazzucato@adacore.com> + + * sem_attr.adb (Resolve_Attribute): Check if the reducer is a + procedure before giving the warning. + 2025-12-05 Javier Miranda <miranda@adacore.com> * einfo.ads (Has_Unsigned_Base_Range_Aspect): Update documentation. diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index d38e71a..ca19cad 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -13204,32 +13204,6 @@ package body Sem_Attr is return; end if; - -- If the Accum_Typ is an unconstrained array then a - -- Constraint_Error will be raised at runtime as most - -- computations will change its length type during the - -- reduction execution, RM 4.5.10(25/5). For instance, this is - -- the case with: [...]'Reduce ("&", ...). When the expression - -- yields non-empty strings, the reduction repeatedly executes - -- the following assignment: - -- Acc := Expr (I) & Acc; - -- which will raise a Constraint_Error since the number of - -- elements is increasing. - - if not Is_Numeric_Type (Base_Type (Accum_Typ)) - and then not Is_Constrained (Accum_Typ) - then - declare - Discard : Node_Id; - pragma Unreferenced (Discard); - begin - Discard := Compile_Time_Constraint_Error - (Reducer_N, - "potential length mismatch!!??", - Accum_Typ); - return; - end; - end if; - -- If no error has been posted and the accumulation type is -- constrained, then the resolution of the reducer can start. @@ -13311,6 +13285,33 @@ package body Sem_Attr is if Is_Limited_Type (Accum_Typ) then Error_Msg_N ("accumulated subtype of Reduce must be nonlimited", N); + + -- If the Accum_Typ is an unconstrained array and the reducer + -- subprogram is a function then a Constraint_Error will be + -- raised at runtime as most computations will change its + -- length type during the reduction execution, RM 4.5.10(25/5). + -- For instance, this is the case with: + -- [...]'Reduce ("&", ...) + -- When the expression yields non-empty strings, the reduction + -- repeatedly executes the following assignment: + -- Acc := Expr (I) & Acc; + -- which will raise a Constraint_Error since the number of + -- elements is increasing. + + elsif Nkind (Reducer_E) /= N_Attribute_Reference + and then Ekind (Reducer_E) = E_Function + and then not Is_Numeric_Type (Base_Type (Accum_Typ)) + and then not Is_Constrained (Accum_Typ) + then + declare + Discard : Node_Id; + pragma Unreferenced (Discard); + begin + Discard := Compile_Time_Constraint_Error + (Reducer_N, + "potential length mismatch!!??", + Accum_Typ); + end; end if; -- Complete the resolution of the reduction expression by diff --git a/gcc/algol68/ChangeLog b/gcc/algol68/ChangeLog index eeb8ff5..b55a123 100644 --- a/gcc/algol68/ChangeLog +++ b/gcc/algol68/ChangeLog @@ -1,3 +1,8 @@ +2025-12-06 Jose E. Marchesi <jose.marchesi@oracle.com> + + PR algol68/123007 + * a68-lang.cc (a68_type_for_size): Handle intTI_type_node. + 2025-12-03 Jose E. Marchesi <jose.marchesi@oracle.com> PR algol68/122954 diff --git a/gcc/calls.cc b/gcc/calls.cc index bb8a6d0..85d6ea4 100644 --- a/gcc/calls.cc +++ b/gcc/calls.cc @@ -3579,7 +3579,8 @@ expand_call (tree exp, rtx target, int ignore) && check_sibcall_argument_overlap (before_arg, &args[i], true))) sibcall_failure = true; - } + gcc_checking_assert (!args[i].stack || argblock); + } if (args[i].stack) call_fusage @@ -3676,6 +3677,32 @@ expand_call (tree exp, rtx target, int ignore) && !must_preallocate && reg_parm_stack_space > 0) anti_adjust_stack (GEN_INT (reg_parm_stack_space)); + /* Cover pushed arguments with call usage, so that cselib knows to + invalidate the stores in them at the call insn. */ + if (pass == 1 && !argblock + && (maybe_ne (adjusted_args_size.constant, 0) + || adjusted_args_size.var)) + { + rtx addr = virtual_outgoing_args_rtx; + poly_int64 size = adjusted_args_size.constant; + if (!STACK_GROWS_DOWNWARD) + { + if (adjusted_args_size.var) + /* ??? We can't compute the exact base address. */ + addr = gen_rtx_PLUS (GET_MODE (addr), addr, + gen_rtx_SCRATCH (GET_MODE (addr))); + else + addr = plus_constant (GET_MODE (addr), addr, -size); + } + rtx fu = gen_rtx_MEM (BLKmode, addr); + if (adjusted_args_size.var == 0) + set_mem_size (fu, size); + call_fusage + = gen_rtx_EXPR_LIST (BLKmode, + gen_rtx_USE (VOIDmode, fu), + call_fusage); + } + /* Pass the function the address in which to return a structure value. */ if (pass != 0 && structure_value_addr && ! structure_value_addr_parm) diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 1804d5a..7b6a29d 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -1840,8 +1840,19 @@ riscv_symbolic_constant_p (rtx x, enum riscv_symbol_type *symbol_type) /* Nonzero offsets are only valid for references that don't use the GOT. */ switch (*symbol_type) { - case SYMBOL_ABSOLUTE: case SYMBOL_PCREL: + /* In 64-bit mode, PC-relative offsets with ranges beyond +/-1GiB are + more likely than not to end up out of range for an auipc instruction + randomly-placed within the 2GB range usable by medany, and such + offsets are quite unlikely to come up by chance, so be conservative + and separate the offset for them when in 64-bit mode, where they don't + wrap around. */ + if (TARGET_64BIT) + return sext_hwi (INTVAL (offset), 30) == INTVAL (offset); + + /* Fall through. */ + + case SYMBOL_ABSOLUTE: case SYMBOL_TLS_LE: /* GAS rejects offsets outside the range [-2^31, 2^31-1]. */ return sext_hwi (INTVAL (offset), 32) == INTVAL (offset); diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0084a0f..3ad8d16 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +2025-12-06 Jakub Jelinek <jakub@redhat.com> + + * decl2.cc (is_late_template_attribute): Call lookup_attribute_spec + on TREE_PURPOSE (attr) rather than name. Only call + attribute_takes_identifier_p if get_attribute_namespace (attr) is + gnu_identifier. + * pt.cc (tsubst_attribute): Only call attribute_takes_identifier_p + if get_attribute_namespace (t) is gnu_identifier. + 2025-12-05 Tobias Burnus <tburnus@baylibre.com> * pt.cc (tsubst_omp_clauses): Handle OMP_CLAUSE_DYN_GROUPPRIVATE. diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index b8a9e3e..724da5b 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,34 @@ +2025-12-06 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/122693 + * array.cc (gfc_match_array_constructor): Stash and restore + gfc_current_ns after the call to 'gfc_match_type_spec'. + +2025-12-06 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/122670 + * decl.cc (gfc_get_pdt_instance): Ensure that, in an interface + body, PDT instances imported implicitly if the template has + been explicitly imported. + * module.cc (read_module): If a PDT template appears in a use + only statement, implicitly add the instances as well. + +2025-12-06 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/122669 + * resolve.cc (resolve_allocate_deallocate): Mold expressions + with an array reference and a constant size must be resolved + for each allocate object. + +2025-12-06 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/122578 + * primary.cc (gfc_match_varspec): Try to resolve a typebound + generic procedure selector expression to provide the associate + name with a type. Also, resolve component calls. In both cases, + make a copy of the selector expression to guard against changes + made by gfc_resolve_expr. + 2025-12-05 Harald Anlauf <anlauf@gmx.de> PR fortran/122977 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0139ece..8f13d2c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,50 @@ +2025-12-06 Alexandre Oliva <oliva@adacore.com> + + PR rtl-optimization/122947 + * gcc.dg/pr122947.c: New. + +2025-12-06 Alexandre Oliva <oliva@adacore.com> + + PR target/91420 + * gcc.target/riscv/pr91420.c: New. + +2025-12-06 Jeff Law <jlaw@ventanamicro.com> + + PR rtl-optimization/122675 + * gcc.target/riscv/pr122675-1.c: Adjust expected output. + +2025-12-06 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/103414 + * gfortran.dg/pdt_76.f03: New test. + +2025-12-06 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/122693 + * gfortran.dg/pdt_75.f03: New test. + +2025-12-06 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/122670 + * gfortran.dg/pdt_74.f03: New test. + +2025-12-06 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/122669 + * gfortran.dg/pdt_73.f03: New test. + +2025-12-06 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/122578 + * gfortran.dg/pdt_72.f03: New test. + +2025-12-06 Dimitar Dimitrov <dimitar@dinux.eu> + + PR rtl-optimization/122675 + * gcc.target/aarch64/pr122675-1.c: New test. + * gcc.target/i386/pr122675-1.c: New test. + * gcc.target/riscv/pr122675-1.c: New test. + 2025-12-06 Jakub Jelinek <jakub@redhat.com> PR middle-end/99782 diff --git a/gcc/testsuite/gcc.dg/pr122947.c b/gcc/testsuite/gcc.dg/pr122947.c new file mode 100644 index 0000000..945a61a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr122947.c @@ -0,0 +1,45 @@ +/* PR rtl-optimization/122947 based on PR 117239 */ +/* { dg-do run } */ +/* { dg-options "-fno-inline -O2" } */ +/* { dg-additional-options "-fschedule-insns -mno-accumulate-outgoing-args" { target x86 } } */ + +int c = 1; + +struct A { + int e, f, g, h; + short i; + int j; +}; + +void +bar (int x, struct A y) +{ + if (y.j == 1) + c = 0; +} + +/* Simplest pure way to force baz's x.j back to memory. + So simple that IPA "inlines" it, so we disable IPA and mark as pure. */ +int __attribute__ ((noipa, pure)) +bad (struct A const *x) +{ + return x->j; +} + +int +baz (struct A x) +{ + x.j = 0; + return bad (&x); +} + +int +main () +{ + struct A k = { 0, 0, 0, 0, 0, 1 }; + int d = baz (k); + bar (0, k); + if (c + d != 0) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/riscv/pr122675-1.c b/gcc/testsuite/gcc.target/riscv/pr122675-1.c index 6f49ef3..3187b10 100644 --- a/gcc/testsuite/gcc.target/riscv/pr122675-1.c +++ b/gcc/testsuite/gcc.target/riscv/pr122675-1.c @@ -7,10 +7,6 @@ /* **test: **... -**.LFB[0-9]+: -**... -** .cfi_startproc -**... ** beq a0,zero,.L[0-9]* **... ** call f1 diff --git a/gcc/testsuite/gcc.target/riscv/pr91420.c b/gcc/testsuite/gcc.target/riscv/pr91420.c new file mode 100644 index 0000000..936d998 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/pr91420.c @@ -0,0 +1,46 @@ +/* { dg-do assemble } */ +/* { dg-options "-O2 -mcmodel=medany -save-temps" } */ + +int a[1]; + +__UINTPTR_TYPE__ +foo(void) +{ + return (__UINTPTR_TYPE__)a + 0x7fffffff; +} + +__UINTPTR_TYPE__ +bfoo(void) +{ + return (__UINTPTR_TYPE__)a + 0x40000000; +} + +__UINTPTR_TYPE__ +sfoo(void) +{ + return (__UINTPTR_TYPE__)a + 0x3fffffff; +} + +__UINTPTR_TYPE__ +bar(void) +{ + return (__UINTPTR_TYPE__)a - 0x80000000; +} + +__UINTPTR_TYPE__ +bbar(void) +{ + return (__UINTPTR_TYPE__)a - 0x40000000; +} + +__UINTPTR_TYPE__ +sbar(void) +{ + return (__UINTPTR_TYPE__)a - 0x3fffffff; +} + +/* /* dg-final { scan-assembler-times "lla\ta[0-9]*, a$" 4 { target riscv64-*-* } } } */ +/* /* dg-final { scan-assembler-times "lla\ta[0-9]*, a[-+]" 2 { target riscv64-*-* } } } */ + +/* /* dg-final { scan-assembler-times "lla\ta[0-9]*, a[-+]$" 6 { target riscv32-*-* } } } */ +/* /* dg-final { scan-assembler-not "lla\ta[0-9]*, a$" { target riscv32-*-* } } } */ diff --git a/gcc/testsuite/gfortran.dg/pdt_76.f03 b/gcc/testsuite/gfortran.dg/pdt_76.f03 new file mode 100644 index 0000000..22c0a3e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pdt_76.f03 @@ -0,0 +1,21 @@ +! { dg-do compile } + +! Make sure that pr103414 is fixed. +! +! Contributed by Gerhard Steinmetz <gscfq@t-online.de> +! +function p () + type t(n) + integer, kind :: n + character(n) :: c = '' + end type + type(t(3)) :: x = t(z'1') ! { dg-error "Expected an initialization expression" } +end + +function q () + type t(n) + integer, kind :: n + character(n) :: c = '' + end type + type(t(3)) :: x(1) = [t(z'1')] ! { dg-error "Syntax error in array constructor" } +end |
