public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pault at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/55618] [4.6/4.7/4.8 Regression] Failures with ISO_Varying_String test suite
Date: Sun, 06 Jan 2013 18:48:00 -0000	[thread overview]
Message-ID: <bug-55618-4-VZP24C99Tc@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55618-4@http.gcc.gnu.org/bugzilla/>


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

--- Comment #4 from Paul Thomas <pault at gcc dot gnu.org> 2013-01-06 18:48:07 UTC ---
Created attachment 29089
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29089
modified version of one of the failing tests

Confirmed

This is a failure of the scalarizer, which is why I have bumped up its
importance.

The final invocation of SPLIT, from within a scalarizer loop, is passing the
character argument CHAR(set) as a pointer to a pointer.

Replacing this call with one to a contained function foo (see attachment),
results in success for 'choice' 0 or 2 (explicit loop or passing VST, rather
than character)
subroutine foo (choice)
  integer :: choice
  if (choice == 1) then
    CALL SPLIT(strar,wrdar,CHAR(set),separ)
  else if (choice == 2) then
    CALL SPLIT(strar,wrdar,set,separ)
  else
    DO i=1,ndim
      DO j=1,ndim
        CALL SPLIT(strar(i,j),wrdar(i,j),CHAR(set),separ(i,j))
      end do
    end do
  end if
end subroutine 

The code produced by this appears below and is the reason for my assertion that
this is a scalarizer problem.  I suspect from inspection that VST30/31 fail for
the same reason.

I have added Mikael in copy, hoping that his more recent exposure to the
scalarizer will help identify the root cause more quickly.

Cheers

Paul

foo (integer(kind=4) & restrict choice)
{
  if (*choice == 1)
    {
      {
        character(kind=1)[1:MAX_EXPR <D.2015, 0>] * D.2020;
        void * restrict D.2018;
        integer(kind=4) D.2017;
        character(kind=1)[1:MAX_EXPR <D.2015, 0>] * pstr.26;
        integer(kind=4) D.2015;
        struct varying_string * D.2014;

        D.2014 = &set;
        D.2015 = len_ (D.2014);
        D.2017 = MAX_EXPR <D.2015, 0> * 64;
        D.2018 = (void * restrict) __builtin_malloc (MAX_EXPR <(unsigned long)
D.2017, 1>);
        pstr.26 = (character(kind=1)[1:MAX_EXPR <D.2015, 0>] *) D.2018;
        char_auto (pstr.26, MAX_EXPR <D.2015, 0>, D.2014);
        D.2020 = pstr.26;
        {
          integer(kind=8) S.27;

          S.27 = 1;
          while (1)
            {
              if (S.27 > 2) goto L.10;
              {
                integer(kind=8) D.2025;
                integer(kind=8) D.2024;
                integer(kind=8) D.2023;
                integer(kind=8) S.28;

                D.2023 = S.27 * 2 + -3;
                D.2024 = S.27 * 2 + -3;
                D.2025 = S.27 * 2 + -3;
                S.28 = 1;
                while (1)
                  {
                    if (S.28 > 2) goto L.9;
                    split_ch (&strar[S.28 + D.2023], &wrdar[S.28 + D.2024],
&D.2020, &separ[S.28 + D.2025], 0B, MAX_EXPR <D.2015, 0>);
                    S.28 = S.28 + 1;
                  }
                L.9:;
              }
              S.27 = S.27 + 1;
            }
          L.10:;
        }
        {
          void * D.2019;

          D.2019 = (void *) pstr.26;
          if (D.2019 != 0B)
            {
              __builtin_free (D.2019);
            }
        }
      }
    }
  else
    {
      if (*choice == 2)
        {
          {
            struct varying_string D.2029;

            D.2029 = set;
            {
              integer(kind=8) S.29;

              S.29 = 1;
              while (1)
                {
                  if (S.29 > 2) goto L.12;
                  {
                    integer(kind=8) D.2034;
                    integer(kind=8) D.2033;
                    integer(kind=8) D.2032;
                    integer(kind=8) S.30;

                    D.2032 = S.29 * 2 + -3;
                    D.2033 = S.29 * 2 + -3;
                    D.2034 = S.29 * 2 + -3;
                    S.30 = 1;
                    while (1)
                      {
                        if (S.30 > 2) goto L.11;
                        split_vs (&strar[S.30 + D.2032], &wrdar[S.30 + D.2033],
&D.2029, &separ[S.30 + D.2034], 0B);
                        S.30 = S.30 + 1;
                      }
                    L.11:;
                  }
                  S.29 = S.29 + 1;
                }
              L.12:;
            }
          }
        }
      else
        {
          i = 1;
          if (i <= 2)
            {
              while (1)
                {
                  {
                    logical(kind=4) D.2049;

                    j = 1;
                    if (j <= 2)
                      {
                        while (1)
                          {
                            {
                              logical(kind=4) D.2048;

                              {
                                void * restrict D.2046;
                                integer(kind=4) D.2045;
                                character(kind=1)[1:MAX_EXPR <D.2043, 0>] *
pstr.31;
                                integer(kind=4) D.2043;
                                struct varying_string * D.2042;

                                D.2042 = &set;
                                D.2043 = len_ (D.2042);
                                D.2045 = MAX_EXPR <D.2043, 0> * 64;
                                D.2046 = (void * restrict) __builtin_malloc
(MAX_EXPR <(unsigned long) D.2045, 1>);
                                pstr.31 = (character(kind=1)[1:MAX_EXPR
<D.2043, 0>] *) D.2046;
                                char_auto (pstr.31, MAX_EXPR <D.2043, 0>,
D.2042);
                                split_ch (&strar[((integer(kind=8)) j * 2 +
(integer(kind=8)) i) + -3], &wrdar[((integer(kind=8)) j * 2 + (integer(kind=8))
i) + -3], pstr.31, &separ[((integer(kind=8)) j * 2 + (integer(kind=8)) i) +
-3], 0B, MAX_EXPR <D.2043, 0>);
                                {
                                  void * D.2047;

                                  D.2047 = (void *) pstr.31;
                                  if (D.2047 != 0B)
                                    {
                                      __builtin_free (D.2047);
                                    }
                                }
                              }
                              L.15:;
                              D.2048 = j == 2;
                              j = j + 1;
                              if (D.2048) goto L.16;
                            }
                          }
                      }
                    L.16:;
                    L.13:;
                    D.2049 = i == 2;
                    i = i + 1;
                    if (D.2049) goto L.14;
                  }
                }
            }
          L.14:;
        }
    }
  L.8:;
}


  parent reply	other threads:[~2013-01-06 18:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-07 19:14 [Bug fortran/55618] New: " burnus at gcc dot gnu.org
2012-12-07 21:14 ` [Bug fortran/55618] " burnus at gcc dot gnu.org
2012-12-10  9:46 ` burnus at gcc dot gnu.org
2012-12-10 11:43 ` burnus at gcc dot gnu.org
2013-01-06 18:48 ` pault at gcc dot gnu.org [this message]
2013-01-06 21:12 ` pault at gcc dot gnu.org
2013-01-07 23:42 ` dominiq at lps dot ens.fr
2013-01-08  6:14 ` pault at gcc dot gnu.org
2013-01-13  7:51 ` [Bug fortran/55618] [4.6/4.7 " pault at gcc dot gnu.org
2013-01-14 17:59 ` [Bug fortran/55618] [4.6 " pault at gcc dot gnu.org
2013-01-14 18:45 ` [Bug fortran/55618] [4.6, 4.7, 4.8 " pault at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-55618-4-VZP24C99Tc@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).