public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/47425] New: Array constructor with type-spec: Fails with more complicated length type expr
@ 2011-01-24  0:57 burnus at gcc dot gnu.org
  2011-06-30 19:42 ` [Bug fortran/47425] " dominiq at lps dot ens.fr
  2013-07-15 20:33 ` burnus at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-01-24  0:57 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Array constructor with type-spec: Fails with more
                    complicated length type expr
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/397b3520a4dd1a9f#

James Van Buskirk found an example for an Array constructor with type-spec,
which fails at gimpling. Full example: See c.l.f. Short example:

subroutine sub1(L,s,e)
   implicit none
   character(*) L
   integer s,e
   if(any(L(s:e+1) == [character(len(L(s:e))+1)::'that','those'])) then
   end if
end subroutine sub1

Gives:

test.f90:5:0: error: size of variable 'A.1' is too large

Looking at the dump, one sees that the character length is strangely optimized
away into two uninitialized variables. The dump has:


sub1 (character(kind=1)[1:_l] & restrict l, integer(kind=4) & restrict s,
integer(kind=4) & restrict e, integer(kind=4) _l)
{
  bit_size_type D.1546;
  <unnamed-unsigned:64> D.1547;

  D.1546 = (bit_size_type) ((<unnamed-unsigned:64>) _l * 8);
  D.1547 = (<unnamed-unsigned:64>) (_l + -1) + 1;
  {
    static character(kind=1) A.1[2][1:MAX_EXPR <(D.1541 - D.1540) + 1, 0> + 1]
= {"that", "those"};

and only much later:

    D.1540 = *s;
    D.1541 = *e;


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

end of thread, other threads:[~2013-07-15 20:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-24  0:57 [Bug fortran/47425] New: Array constructor with type-spec: Fails with more complicated length type expr burnus at gcc dot gnu.org
2011-06-30 19:42 ` [Bug fortran/47425] " dominiq at lps dot ens.fr
2013-07-15 20:33 ` burnus at gcc dot gnu.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).