[Bug fortran/41044] internal compiler error: in gfc_conv_intrinsic_function

2010-02-06 Thread hjl dot tools at gmail dot com


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

   Target Milestone|--- |4.4.4
Version|unknown |4.3.1


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



[Bug fortran/41044] internal compiler error: in gfc_conv_intrinsic_function

2010-01-30 Thread pault at gcc dot gnu dot org


--- Comment #14 from pault at gcc dot gnu dot org  2010-01-30 21:14 ---
Fixed on trunk and 4.4.

Thanks for the report

Paul


-- 

pault at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug fortran/41044] internal compiler error: in gfc_conv_intrinsic_function

2010-01-30 Thread pault at gcc dot gnu dot org


--- Comment #13 from pault at gcc dot gnu dot org  2010-01-30 21:13 ---
Subject: Bug 41044

Author: pault
Date: Sat Jan 30 21:12:59 2010
New Revision: 156389

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156389
Log:
2010-01-30  Paul Thomas  

PR fortran/41044
PR fortran/41167
* expr.c (remove_subobject_ref): If the constructor is NULL use
the expression as the source.
(simplify_const_ref): Change the type of expression if
there are component references.  Allow for substring to be at
the end of an arbitrarily long chain of references.  If an
element is found that is not in an EXPR_ARRAY, assume that this
is scalar initialization of array. Call remove_subobject_ref in
this case with NULL second argument.

2010-01-30  Paul Thomas  

PR fortran/41044
* gfortran.dg/parameter_array_ref_2.f90 : New test.

PR fortran/41167
* gfortran.dg/char_array_arg_1.f90 : New test.

* gfortran.dg/pr25923.f90 : Remove XFAIL.

Added:
branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/char_array_arg_1.f90
branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/parameter_array_ref_2.f90
Modified:
branches/gcc-4_4-branch/gcc/fortran/ChangeLog
branches/gcc-4_4-branch/gcc/fortran/expr.c
branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


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



[Bug fortran/41044] internal compiler error: in gfc_conv_intrinsic_function

2010-01-24 Thread pault at gcc dot gnu dot org


--- Comment #12 from pault at gcc dot gnu dot org  2010-01-25 07:53 ---
I just posted the patch for this, so could take it with some advantage.  Will
correct 4.4 in a few days.

Paul


-- 

pault at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |pault at gcc dot gnu dot org
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2010-01-16 16:15:29 |2010-01-25 07:53:09
   date||


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



[Bug fortran/41044] internal compiler error: in gfc_conv_intrinsic_function

2010-01-24 Thread pault at gcc dot gnu dot org


--- Comment #11 from pault at gcc dot gnu dot org  2010-01-24 17:00 ---
Subject: Bug 41044

Author: pault
Date: Sun Jan 24 16:59:51 2010
New Revision: 156197

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156197
Log:
2010-01-24  Paul Thomas  

PR fortran/41044
PR fortran/41167
* expr.c (remove_subobject_ref): If the constructor is NULL use
the expression as the source.
(simplify_const_ref): Change the type of expression if
there are component references.  Allow for substring to be at
the end of an arbitrarily long chain of references.  If an
element is found that is not in an EXPR_ARRAY, assume that this
is scalar initialization of array. Call remove_subobject_ref in
this case with NULL second argument.

2010-01-24  Paul Thomas  

PR fortran/41044
* gfortran.dg/parameter_array_ref_2.f90 : New test.

PR fortran/41167
* gfortran.dg/char_array_arg_1.f90 : New test.

* gfortran.dg/pr25923.f90 : Remove XFAIL.

Added:
trunk/gcc/testsuite/gfortran.dg/char_array_arg_1.f90
trunk/gcc/testsuite/gfortran.dg/parameter_array_ref_2.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/expr.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/pr25923.f90


-- 


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



[Bug fortran/41044] internal compiler error: in gfc_conv_intrinsic_function

2010-01-23 Thread jvdelisle at gcc dot gnu dot org


--- Comment #10 from jvdelisle at gcc dot gnu dot org  2010-01-23 14:03 
---
As Paul would say, I am flummoxed. In remove_subobject_ref at line expr.c:1159 
 e->ref = p->ref->next;  p->ref is NULL, resulting in the segfault.  I have
been unable to conjure a solution.


-- 


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



[Bug fortran/41044] internal compiler error: in gfc_conv_intrinsic_function

2010-01-14 Thread jvdelisle at gcc dot gnu dot org


--- Comment #9 from jvdelisle at gcc dot gnu dot org  2010-01-14 13:45 
---
The test case in comment #8 is a separate issue.  The constructor pointer is
coming out of find_component_ref as invalid.  I am still working on it.


-- 


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



[Bug fortran/41044] internal compiler error: in gfc_conv_intrinsic_function

2009-10-12 Thread burnus at gcc dot gnu dot org


--- Comment #8 from burnus at gcc dot gnu dot org  2009-10-12 09:33 ---
> I have further reducd the test code to:
> idx=sum(maxloc(index(pfd%n,pfmt)))-1

Even shorter:
idx = index(pfd%n,pfmt) - 1
(Or any other one/two operator expression except of function calls; idx needs
to be a rank-1 array.)

Another issue (or the same?) is that pfd%n is seen as EXPR_VARIABLE and not as
EXPR_CONSTANT. The following vaguely related gives a segfault:

type t
  integer :: i
end type t
type(t), parameter :: a(1) = t(4)
real(a(1)%i) :: b
end

==27247== Invalid read of size 8
==27247==at 0x4C3CDD: simplify_const_ref (expr.c:1168)

simplify_const_ref (p=) at
/home/tob/projects/gcc/gcc/fortran/expr.c:1559
1559  remove_subobject_ref (p, cons);

Seemingly, the segfault is in remove_subobject_ref, called by
simplify_const_ref (and "cons" being not a valid pointer).
case REF_COMPONENT:
  cons = find_component_ref (p->value.constructor, p->ref);
  remove_subobject_ref (p, cons);


-- 


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



[Bug fortran/41044] internal compiler error: in gfc_conv_intrinsic_function

2009-10-09 Thread burnus at gcc dot gnu dot org


--- Comment #7 from burnus at gcc dot gnu dot org  2009-10-09 21:59 ---
(In reply to comment #6)
> idx=sum(maxloc(index(pfd%n,pfmt)))-1

The problem is that "pfd%n" is simplified to an array constructor [''] of type
expr->value.constructor->ts == CHARACTER(kind=1,len=3).

But this typespec is not propagated to expr->ts while doing the simplification
and thus expr->ts is BT_DERIVED and expr->ts.kind == 0 - which causes the
assert to trigger. If one applies the hack below, one continues a bit further
but ends up having an ICE in gfc_conv_string_parameter's
  gcc_assert (POINTER_TYPE_P (TREE_TYPE (se->expr)))

The proper solutions is presumably to find the spot in array.c or expr.c where
the derived-type constructor is simplified into an character constructor; there
at least updating the expr->ts is missing.


Not working hack (ICE in gfc_conv_string_parameter):

--- trans-intrinsic.c   (Revision 152601)
+++ trans-intrinsic.c   (Arbeitskopie)
@@ -5340,2 +5340,5 @@ gfc_conv_intrinsic_function (gfc_se * se
 case GFC_ISYM_INDEX:
+  if (expr->value.function.actual->expr->expr_type == EXPR_ARRAY)
+   expr->value.function.actual->expr->ts
+ = expr->value.function.actual->expr->value.constructor->expr->ts;
   kind = expr->value.function.actual->expr->ts.kind;


-- 


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



[Bug fortran/41044] internal compiler error: in gfc_conv_intrinsic_function

2009-10-09 Thread ros at rzg dot mpg dot de


--- Comment #6 from ros at rzg dot mpg dot de  2009-10-09 13:51 ---
(In reply to comment #5)
I have further reducd the test code to:
idx=sum(maxloc(index(pfd%n,pfmt)))-1
Program GF_BUG
!
type psfd
  character  :: n*3
end type psfd
character:: pfmt*3=''
type(psfd), parameter:: pfd(1)=[psfd('')]
!
idx=sum(maxloc(index(pfd%n,pfmt)))-1
end

For the error message to appear it is essential
- that the variable 'psfd' is of derived type,
- that the type declaration statement for 'pdf' has the attribute PARAMETER
- and the statement 'idx=sum(maxloc(index(pfd%n,pfmt)))-1' exists in this form.
Splitting up this statement into 
  'idx=sum(maxloc(index(pfd%n,pfmt)))'   and
  'idx=idx-1'
makes the error message disappear!

I hope, this helps for fixing the bug.


-- 

ros at rzg dot mpg dot de changed:

   What|Removed |Added

 CC||ros at rzg dot mpg dot de


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



[Bug fortran/41044] internal compiler error: in gfc_conv_intrinsic_function

2009-09-27 Thread pinskia at gcc dot gnu dot org


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||gcc-bugs at gcc dot gnu dot
   ||org


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