[gcc(refs/users/mikael/heads/refactor_descriptor_v206.01)] Ajout assertion type pointeur

Mikael Morin via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:fe5bb5942c96973e7a2ed9eb35fa802d8f858a87

commit fe5bb5942c96973e7a2ed9eb35fa802d8f858a87
Author: Mikael Morin <[email protected]>
Date:   Thu Aug 20 20:36:50 2026 +0200

    Ajout assertion type pointeur
    
    fortran: array descriptor: Factor scalar descriptor init 1/2 [PR122521]
    
    TODO: FAIL unlimited_polymorphic_{1,32}.f03, intent_out_19.f90, associate_66.f90
    
    -- >8 --
    
    The two functions gfc_set_descriptor_from_scalar and
    gfc_set_descriptor_from_scalar_class have very similar code, except only the
    former has support for coarrays and absent optional variables.  Make
    gfc_set_descriptor_from_scalar_class call it.
    
            PR fortran/122521
    
    gcc/fortran/ChangeLog:
    
            * trans-descriptor.cc (gfc_set_descriptor_from_scalar_class):
            Replace inline code with a call to gfc_set_descriptor_from_scalar.
    
    Revert "Modifs"
    
    This reverts commit 1888319bd1b533da45f199adfbeebd9fa463843c.
    
    Sauvegarde
    
    Correction supplémentaire class_optional_2 PASS
    
    Sauvegarde
    
    Correction ICE
    
    Correction ICE
    
    Correction ICE
    
    Correction segfault
    
    Correction segfault
    
    Revert "Sauvegarde"
    
    This reverts commit b1999d7ab66c11552c6a1a1eb07cba60b2eb167c.
    
    Revert partiel "fortran: array descriptor: Factor scalar descriptor init 1/2 [PR122521]"
    
    This reverts commit cbdb2674099bb33d286c64639d0625c2a28f916f.
    
    Revert "Correction macro assertion"
    
    This reverts commit de4a4febcdce8b1484413a46732880a39167e2cf.
    
    Revert "Sauvegarde"
    
    This reverts commit 048416529cbf9e478c3171cea2a470c12dbb7434.
    
    Revert partiel "fortran: array descriptor: Factor scalar descriptor init 1/2 [PR122521]"
    
    This reverts commit 7870438652beeec98c692a8f47c147d7df259d09.
    
    Revert partiel "Revert partiel "fortran: array descriptor: Factor scalar descriptor init 1/2 [PR122521]""
    
    This reverts commit 83c7f3bc739847a7559cac40b9d393c1ae5ced34.
    
    Modif réduction différences
    
    Revert "Sauvegarde refactoring"
    
    This reverts commit 0582144d342683296d477a68447501b0a6da418d.
    
    Correction ajout assertion
    
    Revert "Ajout assertion type pointeur"
    
    This reverts commit e4f4e30bdd916ef863b45597d843080501fa8ced.

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

diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc
index 743ed60dc8c9..29f2c07b8c89 100644
--- a/gcc/fortran/trans-descriptor.cc
+++ b/gcc/fortran/trans-descriptor.cc
@@ -876,10 +876,8 @@ void
 gfc_set_descriptor_from_scalar (stmtblock_t *block, tree descr,
 				tree scalar, tree cond_presence)
 {
-  tree scalar_type = TREE_TYPE (scalar);
-  tree etype = POINTER_TYPE_P (scalar_type)
-	       ? TREE_TYPE (scalar_type)
-	       : scalar_type;
+  gcc_checking_assert (POINTER_TYPE_P (TREE_TYPE (scalar)));
+  tree etype = TREE_TYPE (TREE_TYPE (scalar));
   set_descriptor_from_scalar (block, descr, etype, scalar, cond_presence);
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.