[Bug fortran/55852] [4.6/4.7/4.8 regression] internal compiler error: in gfc_build_intrinsic_call, at fortran/expr.c:4647

2013-02-13 Thread burnus at gcc dot gnu.org


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



--- Comment #11 from Tobias Burnus burnus at gcc dot gnu.org 2013-02-13 
14:38:49 UTC ---

(In reply to comment #10)

 The test case fails because the match is too strict.



Should be fixed - for the the trunk only - since 2012-01-09 via

http://gcc.gnu.org/viewcvs?view=revisionrevision=195064


[Bug fortran/55852] [4.6/4.7/4.8 regression] internal compiler error: in gfc_build_intrinsic_call, at fortran/expr.c:4647

2013-02-13 Thread janus at gcc dot gnu.org


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



--- Comment #12 from janus at gcc dot gnu.org 2013-02-13 14:44:13 UTC ---

(In reply to comment #11)

 Should be fixed - for the the trunk only - since 2012-01-09



Ok, so can we close this guy? Or is there need for a backport?


[Bug fortran/55852] [4.6/4.7/4.8 regression] internal compiler error: in gfc_build_intrinsic_call, at fortran/expr.c:4647

2013-02-13 Thread burnus at gcc dot gnu.org


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



--- Comment #13 from Tobias Burnus burnus at gcc dot gnu.org 2013-02-13 
15:09:06 UTC ---

Author: burnus

Date: Wed Feb 13 15:08:59 2013

New Revision: 196016



URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=196016

Log:

2012-02-13   Tobias Burnus  bur...@net-b.de



Backport from mainline

2012-01-09  Uros Bizjak  ubiz...@gmail.com



PR fortran/55852

* gfortran.dg/intrinsic_size_3.f90: Make scan-tree-dump-times

number matching more robust.





Modified:

branches/gcc-4_7-branch/gcc/testsuite/ChangeLog

branches/gcc-4_7-branch/gcc/testsuite/gfortran.dg/intrinsic_size_3.f90


[Bug fortran/55852] [4.6/4.7/4.8 regression] internal compiler error: in gfc_build_intrinsic_call, at fortran/expr.c:4647

2013-02-13 Thread burnus at gcc dot gnu.org


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



--- Comment #14 from Tobias Burnus burnus at gcc dot gnu.org 2013-02-13 
17:51:17 UTC ---

Author: burnus

Date: Wed Feb 13 17:51:11 2013

New Revision: 196020



URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=196020

Log:

2013-02-13  Tobias Burnus  bur...@net-b.de



Backported from mainline

2013-01-07  Tobias Burnus  bur...@net-b.de

Thomas Koenig  tkoe...@gcc.gnu.org

Jakub Jelinek  ja...@redhat.com



PR fortran/55852

* expr.c (gfc_build_intrinsic_call): Avoid clashes

with user's procedures.

* gfortran.h (gfc_build_intrinsic_call): Update prototype.

(GFC_PREFIX): Define.

* simplify.c (gfc_simplify_size): Update call.



2013-02-13  Tobias Burnus  bur...@net-b.de



Backported from mainline

2013-01-07  Tobias Burnus  bur...@net-b.de

Uros Bizjak  ubiz...@gmail.com



PR fortran/55852

* gfortran.dg/intrinsic_size_3.f90: New.





Added:

branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/intrinsic_size_3.f90

Modified:

branches/gcc-4_6-branch/gcc/fortran/ChangeLog

branches/gcc-4_6-branch/gcc/fortran/expr.c

branches/gcc-4_6-branch/gcc/fortran/gfortran.h

branches/gcc-4_6-branch/gcc/fortran/simplify.c

branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


[Bug fortran/55852] [4.6/4.7/4.8 regression] internal compiler error: in gfc_build_intrinsic_call, at fortran/expr.c:4647

2013-02-13 Thread burnus at gcc dot gnu.org


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



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 Status|NEW |RESOLVED

 Resolution||FIXED



--- Comment #15 from Tobias Burnus burnus at gcc dot gnu.org 2013-02-13 
17:52:27 UTC ---

FIXED on the trunk (4.8) and on the 4.6/4.7 branches.



Thanks for the report - and sorry for the regression.


[Bug fortran/55852] [4.6/4.7/4.8 regression] internal compiler error: in gfc_build_intrinsic_call, at fortran/expr.c:4647

2013-02-13 Thread latlon90180+gcc_bugzilla at gmail dot com


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



--- Comment #16 from A. Kasahara latlon90180+gcc_bugzilla at gmail dot com 
2013-02-13 19:21:33 UTC ---

Thank you for the fix!


[Bug fortran/55852] [4.6/4.7/4.8 regression] internal compiler error: in gfc_build_intrinsic_call, at fortran/expr.c:4647

2013-01-08 Thread sch...@linux-m68k.org


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



--- Comment #10 from Andreas Schwab sch...@linux-m68k.org 2013-01-08 16:55:58 
UTC ---

The test case fails because the match is too strict.



$ grep iszs intrinsic_size_3.f90.003t.original 

  integer(kind=2) iszs;

  iszs = (integer(kind=2)) MAX_EXPR (D.854-dim[0].ubound -

D.854-dim[0].lbound) + 1, 0;


[Bug fortran/55852] [4.6/4.7/4.8 regression] internal compiler error: in gfc_build_intrinsic_call, at fortran/expr.c:4647

2013-01-07 Thread burnus at gcc dot gnu.org


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



--- Comment #7 from Tobias Burnus burnus at gcc dot gnu.org 2013-01-07 
11:11:01 UTC ---

Author: burnus

Date: Mon Jan  7 11:10:53 2013

New Revision: 194966



URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=194966

Log:

2013-01-07  Tobias Burnus  bur...@net-b.de

Thomas Koenig  tkoe...@gcc.gnu.org



PR fortran/55852

* expr.c (gfc_build_intrinsic_call): Avoid clashes

with user's procedures.

* gfortran.h (gfc_build_intrinsic_call): Update prototype.

* simplify.c (gfc_simplify_size): Update call.

* class.c (finalization_scalarizer, finalization_get_offset,

finalizer_insert_packed_call, generate_finalization_wrapper):

Clean up by using gfc_build_intrinsic_call.



2013-01-07  Tobias Burnus  bur...@net-b.de



PR fortran/55852

* gfortran.dg/intrinsic_size_3.f90: New.





Added:

trunk/gcc/testsuite/gfortran.dg/intrinsic_size_3.f90

Modified:

trunk/gcc/fortran/ChangeLog

trunk/gcc/fortran/class.c

trunk/gcc/fortran/expr.c

trunk/gcc/fortran/gfortran.h

trunk/gcc/fortran/simplify.c

trunk/gcc/testsuite/ChangeLog


[Bug fortran/55852] [4.6/4.7/4.8 regression] internal compiler error: in gfc_build_intrinsic_call, at fortran/expr.c:4647

2013-01-07 Thread burnus at gcc dot gnu.org


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



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



 CC||slayoo at staszic dot

   ||waw.pl



--- Comment #8 from Tobias Burnus burnus at gcc dot gnu.org 2013-01-07 
15:23:51 UTC ---

*** Bug 54940 has been marked as a duplicate of this bug. ***


[Bug fortran/55852] [4.6/4.7/4.8 regression] internal compiler error: in gfc_build_intrinsic_call, at fortran/expr.c:4647

2013-01-07 Thread burnus at gcc dot gnu.org


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



--- Comment #9 from Tobias Burnus burnus at gcc dot gnu.org 2013-01-07 
19:11:13 UTC ---

Author: burnus

Date: Mon Jan  7 19:11:04 2013

New Revision: 194995



URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=194995

Log:

2013-01-07  Tobias Burnus  bur...@net-b.de

Thomas Koenig  tkoe...@gcc.gnu.org

Jakub Jelinek  ja...@redhat.com



PR fortran/55852

* expr.c (gfc_build_intrinsic_call): Avoid clashes

with user's procedures.

* gfortran.h (gfc_build_intrinsic_call): Update prototype.

(GFC_PREFIX): Define.

* simplify.c (gfc_simplify_size): Update call.



2013-01-07  Tobias Burnus  bur...@net-b.de



PR fortran/55852

* gfortran.dg/intrinsic_size_3.f90: New.





Added:

branches/gcc-4_7-branch/gcc/testsuite/gfortran.dg/intrinsic_size_3.f90

Modified:

branches/gcc-4_7-branch/gcc/fortran/ChangeLog

branches/gcc-4_7-branch/gcc/fortran/expr.c

branches/gcc-4_7-branch/gcc/fortran/gfortran.h

branches/gcc-4_7-branch/gcc/fortran/simplify.c

branches/gcc-4_7-branch/gcc/testsuite/ChangeLog


[Bug fortran/55852] [4.6/4.7/4.8 regression] internal compiler error: in gfc_build_intrinsic_call, at fortran/expr.c:4647

2013-01-06 Thread tkoenig at gcc dot gnu.org


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



Thomas Koenig tkoenig at gcc dot gnu.org changed:



   What|Removed |Added



 CC||tkoenig at gcc dot gnu.org



--- Comment #5 from Thomas Koenig tkoenig at gcc dot gnu.org 2013-01-06 
20:56:20 UTC ---

The problem is that gfc_get_sym_tree is asked to

get size, but that is not available in the current

namespace.



The ICE goes away if intrinsic:: size is added.



We could simply remove the assert, but that would

be a bad idea in case the user specifies something

called size for something else.



So, we need to generate a different name, like in the

frontend optimization pass, where we use __internal_foo

for an intrinsic named foo.


[Bug fortran/55852] [4.6/4.7/4.8 regression] internal compiler error: in gfc_build_intrinsic_call, at fortran/expr.c:4647

2013-01-06 Thread tkoenig at gcc dot gnu.org


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



--- Comment #6 from Thomas Koenig tkoenig at gcc dot gnu.org 2013-01-06 
21:59:13 UTC ---

This patch works (not regression-tested yet), but the method

using the state variable seems hackish and error-prone.



What do you think?



Index: expr.c

===

--- expr.c  (Revision 194850)

+++ expr.c  (Arbeitskopie)

@@ -4623,7 +4623,8 @@

want to add arguments but with a NULL-expression.  */



 gfc_expr*

-gfc_build_intrinsic_call (const char* name, locus where, unsigned numarg, ...)

+gfc_build_intrinsic_call (const char* name, const char *symtree_name,

+ locus where, unsigned numarg, ...)

 {

   gfc_expr* result;

   gfc_actual_arglist* atail;

@@ -4641,11 +4642,17 @@

   result-value.function.name = name;

   result-value.function.isym = isym;



-  result-symtree = gfc_find_symtree (gfc_current_ns-sym_root, name);

-  gcc_assert (result-symtree

-  (result-symtree-n.sym-attr.flavor == FL_PROCEDURE

- || result-symtree-n.sym-attr.flavor == FL_UNKNOWN));

+  if (symtree_name == NULL)

+{

+  result-symtree = gfc_find_symtree (gfc_current_ns-sym_root, name);



+  gcc_assert (result-symtree 

+ (result-symtree-n.sym-attr.flavor == FL_PROCEDURE

+  || result-symtree-n.sym-attr.flavor == FL_UNKNOWN));

+}

+  else

+gfc_get_sym_tree (symtree_name, gfc_current_ns, result-symtree, true);

+

   va_start (ap, numarg);

   atail = NULL;

   for (i = 0; i  numarg; ++i)

Index: simplify.c

===

--- simplify.c  (Revision 194850)

+++ simplify.c  (Arbeitskopie)

@@ -33,6 +33,7 @@



 gfc_expr gfc_bad_expr;



+bool artificial_call = false;



 /* Note that 'simplification' is not just transforming expressions.

For functions that are not simplified at compile time, range

@@ -3248,7 +3249,10 @@

  gfc_expr* dim = result;

  mpz_set_si (dim-value.integer, d);



+ artificial_call = true;

  result = gfc_simplify_size (array, dim, kind);

+ artificial_call = false;

+

  gfc_free_expr (dim);

  if (!result)

goto returnNull;

@@ -5512,7 +5516,10 @@

{

  mpz_set_ui (e-value.integer, n + 1);



+ artificial_call = true;

  f = gfc_simplify_size (source, e, NULL);

+ artificial_call = false;

+

  gfc_free_expr (e);

  if (f == NULL)

{

@@ -5584,11 +5591,18 @@

   /* Otherwise, we build a new SIZE call.  This is hopefully at least

 simpler than the original one.  */

   if (!simplified)

-   simplified = gfc_build_intrinsic_call (size, array-where, 3,

-  gfc_copy_expr (replacement),

-  gfc_copy_expr (dim),

-  gfc_copy_expr (kind));

+   {

+ const char *symtree_name;

+ if (artificial_call)

+   symtree_name = __internal_size;

+ else

+   symtree_name = NULL;



+ simplified = gfc_build_intrinsic_call (size, symtree_name,

array-where, 3,

+gfc_copy_expr (replacement),

+gfc_copy_expr (dim),

+gfc_copy_expr (kind));

+   }

   return simplified;

 }



Index: gfortran.h

===

--- gfortran.h  (Revision 194850)

+++ gfortran.h  (Arbeitskopie)

@@ -2797,7 +2797,8 @@

 bool gfc_has_ultimate_allocatable (gfc_expr *);

 bool gfc_has_ultimate_pointer (gfc_expr *);



-gfc_expr* gfc_build_intrinsic_call (const char*, locus, unsigned, ...);

+gfc_expr* gfc_build_intrinsic_call (const char*, const char *, locus,

+   unsigned, ...);

 gfc_try gfc_check_vardef_context (gfc_expr*, bool, bool, bool, const char*);


[Bug fortran/55852] [4.6/4.7/4.8 regression] internal compiler error: in gfc_build_intrinsic_call, at fortran/expr.c:4647

2013-01-04 Thread jakub at gcc dot gnu.org


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



Jakub Jelinek jakub at gcc dot gnu.org changed:



   What|Removed |Added



   Priority|P3  |P4

 CC||jakub at gcc dot gnu.org


[Bug fortran/55852] [4.6/4.7/4.8 regression] internal compiler error: in gfc_build_intrinsic_call, at fortran/expr.c:4647

2013-01-03 Thread janus at gcc dot gnu.org


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



janus at gcc dot gnu.org changed:



   What|Removed |Added



Summary|internal compiler error: in |[4.6/4.7/4.8 regression]

   |gfc_build_intrinsic_call,   |internal compiler error: in

   |at fortran/expr.c:4647  |gfc_build_intrinsic_call,

   ||at fortran/expr.c:4647



--- Comment #2 from janus at gcc dot gnu.org 2013-01-03 09:42:20 UTC ---

Works also with 4.5, which means it's a regression in 4.6.


[Bug fortran/55852] [4.6/4.7/4.8 regression] internal compiler error: in gfc_build_intrinsic_call, at fortran/expr.c:4647

2013-01-03 Thread dominiq at lps dot ens.fr


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



--- Comment #3 from Dominique d'Humieres dominiq at lps dot ens.fr 2013-01-03 
11:01:18 UTC ---

Revision 162456 (2010-07-23) is OK, revision 1635293 (2010-08-24) gives a

segmentation fault.


[Bug fortran/55852] [4.6/4.7/4.8 regression] internal compiler error: in gfc_build_intrinsic_call, at fortran/expr.c:4647

2013-01-03 Thread burnus at gcc dot gnu.org


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



Tobias Burnus burnus at gcc dot gnu.org changed:



   What|Removed |Added



   Keywords||ice-on-valid-code

 CC||burnus at gcc dot gnu.org

   Target Milestone|--- |4.6.4


[Bug fortran/55852] [4.6/4.7/4.8 regression] internal compiler error: in gfc_build_intrinsic_call, at fortran/expr.c:4647

2013-01-03 Thread dominiq at lps dot ens.fr


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



--- Comment #4 from Dominique d'Humieres dominiq at lps dot ens.fr 2013-01-03 
11:13:19 UTC ---

gfc_build_intrinsic_call has been introduced at revision 162648.