https://gcc.gnu.org/g:9adb420e4826a63bf5ca7290ede553f13181252e

commit r17-6056-g9adb420e4826a63bf5ca7290ede553f13181252e
Author: Paul Thomas <[email protected]>
Date:   Mon Nov 9 11:04:01 2026 +0000

    Fortran: trans-expr.cc:11560: 2 * always true expression [PR124975]
    
    This patch was contributed by David Binderman <[email protected]>
    
    2026-09-11  Paul Thomas  <[email protected]>
    
    gcc/fortran
            PR fortran/124975
            * trans-expr.cc (gfc_trans_pointer_assignment): Correct logic
            in conditions for remap start and end resolution.

Diff:
---
 gcc/fortran/trans-expr.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index ec67f9802615..92e42195256e 100644
--- a/gcc/fortran/trans-expr.cc
+++ b/gcc/fortran/trans-expr.cc
@@ -12173,10 +12173,10 @@ gfc_trans_pointer_assignment (gfc_expr * expr1, 
gfc_expr * expr2)
                  gcc_assert (remap->u.ar.start[dim] && remap->u.ar.end[dim]);
 
                  if (remap->u.ar.start[dim]->expr_type != EXPR_CONSTANT
-                     || remap->u.ar.start[dim]->expr_type != EXPR_VARIABLE)
+                     && remap->u.ar.start[dim]->expr_type != EXPR_VARIABLE)
                    gfc_resolve_expr (remap->u.ar.start[dim]);
                  if (remap->u.ar.end[dim]->expr_type != EXPR_CONSTANT
-                     || remap->u.ar.end[dim]->expr_type != EXPR_VARIABLE)
+                     && remap->u.ar.end[dim]->expr_type != EXPR_VARIABLE)
                    gfc_resolve_expr (remap->u.ar.end[dim]);
 
                  /* Convert declared bounds.  */

Reply via email to