This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/52093] [4.6/4.7 Regression] Extra parenthesis with Size and Shape functions argument cause internal compiler error: Segmentation fault


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52093

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org
   Target Milestone|---                         |4.6.3

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-02 08:28:27 UTC ---
For me (on 4.7), SHAPE and LBOUND work, only SIZE and UBOUND cause an ICE.

The segfault happens for SIZE and UBOUND at:

 Invalid read of size 4
    at 0x5383E0: gfc_simplify_size (simplify.c:5553)

(When patching, remember that UBOUND((X)) and UBOUND(X) are different, it the
lower bound of X is not 1.)


Untested patch:

--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -5543,2 +5543,3 @@ gfc_simplify_size (gfc_expr *array, gfc_expr *dim,
gfc_expr *kind)
          case INTRINSIC_UMINUS:
+         case INTRINSIC_PARENTHESES:
            replacement = array->value.op.op1;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]