public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/43179] ICE invalid if accessing array member of non-array
       [not found] <bug-43179-4@http.gcc.gnu.org/bugzilla/>
@ 2010-12-30  2:40 ` dfranke at gcc dot gnu.org
  2012-02-05 17:37 ` dominiq at lps dot ens.fr
  2013-01-15 21:37 ` mikael at gcc dot gnu.org
  2 siblings, 0 replies; 10+ messages in thread
From: dfranke at gcc dot gnu.org @ 2010-12-30  2:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Daniel Franke <dfranke at gcc dot gnu.org> 2010-12-30 02:39:58 UTC ---
(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #2)
> > > > OK for trunk with the usual embellishments of ChangeLogs and testcase?
> > > 
> > > Yes, if you have an example for EXPR_FUNCTION - otherwise I would claim that
> > > EXPR_VARIABLE is enough.
> > 
> > Paul, any plans to wrap this up? :)
> 
> Another one for Sunday, or thereabouts.

Ping?


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/43179] ICE invalid if accessing array member of non-array
       [not found] <bug-43179-4@http.gcc.gnu.org/bugzilla/>
  2010-12-30  2:40 ` [Bug fortran/43179] ICE invalid if accessing array member of non-array dfranke at gcc dot gnu.org
@ 2012-02-05 17:37 ` dominiq at lps dot ens.fr
  2013-01-15 21:37 ` mikael at gcc dot gnu.org
  2 siblings, 0 replies; 10+ messages in thread
From: dominiq at lps dot ens.fr @ 2012-02-05 17:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2012-02-05 17:37:33 UTC ---
With trunk at revision 183904 or with 4.6.2, I get

pr43179.f90:6.14:

if (allocated(foo(1)%a)) call abort()
              1
Error: 'array' argument of 'allocated' intrinsic at (1) must be a variable

while with 4.5.3 I get an ICE

pr43179.f90: In function 'bar':
pr43179.f90:6:0: internal compiler error: in fold_convert_loc, at
fold-const.c:2792

Is there any plan to backport the fix to 4.5.4 or should this PR closed as
fixed?


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/43179] ICE invalid if accessing array member of non-array
       [not found] <bug-43179-4@http.gcc.gnu.org/bugzilla/>
  2010-12-30  2:40 ` [Bug fortran/43179] ICE invalid if accessing array member of non-array dfranke at gcc dot gnu.org
  2012-02-05 17:37 ` dominiq at lps dot ens.fr
@ 2013-01-15 21:37 ` mikael at gcc dot gnu.org
  2 siblings, 0 replies; 10+ messages in thread
From: mikael at gcc dot gnu.org @ 2013-01-15 21:37 UTC (permalink / raw)
  To: gcc-bugs


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

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |mikael at gcc dot gnu.org
         Resolution|                            |FIXED

--- Comment #10 from Mikael Morin <mikael at gcc dot gnu.org> 2013-01-15 21:36:55 UTC ---
(In reply to comment #9)
> Is there any plan to backport the fix to 4.5.4 or should this PR closed as
> fixed?

No, the 4.5 branch is closed.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/43179] ICE invalid if accessing array member of non-array
  2010-02-25 18:33 [Bug fortran/43179] New: " burnus at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2010-07-15 21:57 ` dfranke at gcc dot gnu dot org
@ 2010-07-18  7:09 ` pault at gcc dot gnu dot org
  6 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2010-07-18  7:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pault at gcc dot gnu dot org  2010-07-18 07:09 -------
(In reply to comment #2)
> (In reply to comment #1)
> > This fixes it and regtests.
> > +   if (array->expr_type != EXPR_VARIABLE && array->expr_type != EXPR_FUNCTION)
> 
> The patch looks OK, but actually I fail to see when an EXPR_FUNCTION is valid
> in this case. If I try:

Try allocatable_scalar_5.f90

Paul


-- 


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/43179] ICE invalid if accessing array member of non-array
  2010-02-25 18:33 [Bug fortran/43179] New: " burnus at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2010-06-24 15:42 ` pault at gcc dot gnu dot org
@ 2010-07-15 21:57 ` dfranke at gcc dot gnu dot org
  2010-07-18  7:09 ` pault at gcc dot gnu dot org
  6 siblings, 0 replies; 10+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-07-15 21:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from dfranke at gcc dot gnu dot org  2010-07-15 21:57 -------
Spin-off: PR44960


-- 


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/43179] ICE invalid if accessing array member of non-array
  2010-02-25 18:33 [Bug fortran/43179] New: " burnus at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2010-05-18 22:44 ` dfranke at gcc dot gnu dot org
@ 2010-06-24 15:42 ` pault at gcc dot gnu dot org
  2010-07-15 21:57 ` dfranke at gcc dot gnu dot org
  2010-07-18  7:09 ` pault at gcc dot gnu dot org
  6 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2010-06-24 15:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pault at gcc dot gnu dot org  2010-06-24 15:42 -------
(In reply to comment #4)
> (In reply to comment #2)
> > > OK for trunk with the usual embellishments of ChangeLogs and testcase?
> > 
> > Yes, if you have an example for EXPR_FUNCTION - otherwise I would claim that
> > EXPR_VARIABLE is enough.
> 
> Paul, any plans to wrap this up? :)
> 

Daniel,

Another one for Sunday, or thereabouts.

Paul


-- 


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/43179] ICE invalid if accessing array member of non-array
  2010-02-25 18:33 [Bug fortran/43179] New: " burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-02-26 10:26 ` burnus at gcc dot gnu dot org
@ 2010-05-18 22:44 ` dfranke at gcc dot gnu dot org
  2010-06-24 15:42 ` pault at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-18 22:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dfranke at gcc dot gnu dot org  2010-05-18 22:44 -------
(In reply to comment #2)
> > OK for trunk with the usual embellishments of ChangeLogs and testcase?
> 
> Yes, if you have an example for EXPR_FUNCTION - otherwise I would claim that
> EXPR_VARIABLE is enough.

Paul, any plans to wrap this up? :)


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/43179] ICE invalid if accessing array member of non-array
  2010-02-25 18:33 [Bug fortran/43179] New: " burnus at gcc dot gnu dot org
  2010-02-26  7:35 ` [Bug fortran/43179] " pault at gcc dot gnu dot org
  2010-02-26  7:54 ` burnus at gcc dot gnu dot org
@ 2010-02-26 10:26 ` burnus at gcc dot gnu dot org
  2010-05-18 22:44 ` dfranke at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-02-26 10:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2010-02-26 10:26 -------
> gfortran already bails out with:
>   Error: Allocate-object at (1) is not a nonprocedure pointer
>   or an allocatable variable

If you are already patching, can you also improve the wording for this old
error message? I think "neither ... nor" is clearer than "not ... or". Thanks!


-- 


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/43179] ICE invalid if accessing array member of non-array
  2010-02-25 18:33 [Bug fortran/43179] New: " burnus at gcc dot gnu dot org
  2010-02-26  7:35 ` [Bug fortran/43179] " pault at gcc dot gnu dot org
@ 2010-02-26  7:54 ` burnus at gcc dot gnu dot org
  2010-02-26 10:26 ` burnus at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-02-26  7:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2010-02-26 07:54 -------
(In reply to comment #1)
> This fixes it and regtests.
> +   if (array->expr_type != EXPR_VARIABLE && array->expr_type != EXPR_FUNCTION)

The patch looks OK, but actually I fail to see when an EXPR_FUNCTION is valid
in this case. If I try:

  allocate(foo())
  contains
    function foo()
      integer, allocatable :: foo
    end function foo
  end

gfortran already bails out with:
  Error: Allocate-object at (1) is not a nonprocedure pointer
  or an allocatable variable

> OK for trunk with the usual embellishments of ChangeLogs and testcase?

Yes, if you have an example for EXPR_FUNCTION - otherwise I would claim that
EXPR_VARIABLE is enough.

Fortran 2008 has:
R631 allocation  is  allocate-object [ ( allocate-shape-spec-list ) ]
                                     [ lbracket allocate-coarray-spec rbracket
]

R632 allocate-object  is  variable-name
                      or  structure-component


-- 


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/43179] ICE invalid if accessing array member of non-array
  2010-02-25 18:33 [Bug fortran/43179] New: " burnus at gcc dot gnu dot org
@ 2010-02-26  7:35 ` pault at gcc dot gnu dot org
  2010-02-26  7:54 ` burnus at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2010-02-26  7:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pault at gcc dot gnu dot org  2010-02-26 07:35 -------
This fixes it and regtests.

Index: gcc/fortran/check.c
===================================================================
*** gcc/fortran/check.c (revision 157061)
--- gcc/fortran/check.c (working copy)
*************** gfc_check_allocated (gfc_expr *array)
*** 537,542 ****
--- 537,550 ----
    if (variable_check (array, 0) == FAILURE)
      return FAILURE;

+   if (array->expr_type != EXPR_VARIABLE && array->expr_type != EXPR_FUNCTION)
+     {
+       gfc_error ("The argument of '%s' intrinsic at %L is not a variable "
+                "or function expression", gfc_current_intrinsic,
+                &array->where);
+       return FAILURE;
+     }
+ 
    attr = gfc_variable_attr (array, NULL);
    if (!attr.allocatable)
      {

OK for trunk with the usual embellishments of ChangeLogs and testcase?
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|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-02-26 07:35:26
               date|                            |


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-01-15 21:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-43179-4@http.gcc.gnu.org/bugzilla/>
2010-12-30  2:40 ` [Bug fortran/43179] ICE invalid if accessing array member of non-array dfranke at gcc dot gnu.org
2012-02-05 17:37 ` dominiq at lps dot ens.fr
2013-01-15 21:37 ` mikael at gcc dot gnu.org
2010-02-25 18:33 [Bug fortran/43179] New: " burnus at gcc dot gnu dot org
2010-02-26  7:35 ` [Bug fortran/43179] " pault at gcc dot gnu dot org
2010-02-26  7:54 ` burnus at gcc dot gnu dot org
2010-02-26 10:26 ` burnus at gcc dot gnu dot org
2010-05-18 22:44 ` dfranke at gcc dot gnu dot org
2010-06-24 15:42 ` pault at gcc dot gnu dot org
2010-07-15 21:57 ` dfranke at gcc dot gnu dot org
2010-07-18  7:09 ` pault at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).