public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/49636] New: Associate construct confused with slightly complicated case
@ 2011-07-04 22:59 fkrogh#gcc at mathalacarte dot com
  2011-07-04 23:21 ` [Bug fortran/49636] " fkrogh#gcc at mathalacarte dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: fkrogh#gcc at mathalacarte dot com @ 2011-07-04 22:59 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Associate construct confused with slightly complicated
                    case
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: fkrogh#gcc@mathalacarte.com


Created attachment 24684
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24684
Fails test, with minor change works

The attached 16 line fortran program shows the problem.  The Intel (11.1)
compiler works on this example.


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

* [Bug fortran/49636] Associate construct confused with slightly complicated case
  2011-07-04 22:59 [Bug fortran/49636] New: Associate construct confused with slightly complicated case fkrogh#gcc at mathalacarte dot com
@ 2011-07-04 23:21 ` fkrogh#gcc at mathalacarte dot com
  2011-07-05  9:06 ` burnus at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: fkrogh#gcc at mathalacarte dot com @ 2011-07-04 23:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Fred Krogh <fkrogh#gcc at mathalacarte dot com> 2011-07-04 23:21:21 UTC ---
Sorry failed to include the output of the program.  Here it is.

i_good=         1         3         5
 i_bad=         1   4197184         3


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

* [Bug fortran/49636] Associate construct confused with slightly complicated case
  2011-07-04 22:59 [Bug fortran/49636] New: Associate construct confused with slightly complicated case fkrogh#gcc at mathalacarte dot com
  2011-07-04 23:21 ` [Bug fortran/49636] " fkrogh#gcc at mathalacarte dot com
@ 2011-07-05  9:06 ` burnus at gcc dot gnu.org
  2014-02-10  9:33 ` [Bug fortran/49636] [F03] ASSOCIATE " dominiq at lps dot ens.fr
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-07-05  9:06 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
                 CC|                            |burnus at gcc dot gnu.org
         Depends on|                            |37577

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-07-05 09:05:46 UTC ---
I think this is one of the bugs, which depend on a new array descriptor (cf.
http://gcc.gnu.org/wiki/ArrayDescriptorUpdate).

The problem is that for
    associate (i=>t2%j%i)
the array
      i(1:3)
is not contiguous in memory. In the current array descriptor implementation,
only arrays with strides which are multiples of the block are possible - that's
fine grained enough if there is only "integer :: i" but no longer if there is
also another element ("integer :: k"). In that case, one needs to have strides
which are byte-based ("stride multiplier")

It is rather high on the to-do list of gfortran, but as the patch will be
invasive and will have to be done at once as it breaks the ABI (i.e. the
downward compatibility), it is still pending. The idea is that one will use a
descriptor which is compatible with the upcomming TR 29113. (TR = Technical
Report, small standard extension which will be also integrated in the next
Fortran standard.)

Cf. http://gcc.gnu.org/wiki/ArrayDescriptorUpdate

Given some other larger on-going projects, the lack of time of some core
developers and given that GCC 4.7 will probably already branched in September
combined with the need for ABI breakage [which should happen only once], I fear
it won't be fixed for 4.7 but only later. :-(


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

* [Bug fortran/49636] [F03] ASSOCIATE construct confused with slightly complicated case
  2011-07-04 22:59 [Bug fortran/49636] New: Associate construct confused with slightly complicated case fkrogh#gcc at mathalacarte dot com
  2011-07-04 23:21 ` [Bug fortran/49636] " fkrogh#gcc at mathalacarte dot com
  2011-07-05  9:06 ` burnus at gcc dot gnu.org
@ 2014-02-10  9:33 ` dominiq at lps dot ens.fr
  2014-02-10 22:14 ` pault at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-02-10  9:33 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-02-10
                 CC|                            |pault at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed on 4.7, 4.8, and trunk (4.9 r207643). At r207649, compiling the test
gives the following ICE:

pr49636.f90:14:0: internal compiler error: in gfc_get_element_type, at
fortran/trans-types.c:1183
     print '(" i_bad=", 3I10)', i(1:3)

It is caused by r207646

Author:    pault
Date:    Sun Feb 9 20:50:21 2014 UTC (12 hours, 41 minutes ago)
Changed paths:    5
Log Message:    
2014-02-09  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/57522
    * resolve.c (resolve_assoc_var): Set the subref_array_pointer
    attribute for the 'associate-name' if necessary.
    * trans-stmt.c (trans_associate_var): If the 'associate-name'
    is a subref_array_pointer, assign the element size of the
    associate variable to 'span'.

2014-02-09  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/57522
    * gfortran.dg/associated_target_5.f03 : New test


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

* [Bug fortran/49636] [F03] ASSOCIATE construct confused with slightly complicated case
  2011-07-04 22:59 [Bug fortran/49636] New: Associate construct confused with slightly complicated case fkrogh#gcc at mathalacarte dot com
                   ` (2 preceding siblings ...)
  2014-02-10  9:33 ` [Bug fortran/49636] [F03] ASSOCIATE " dominiq at lps dot ens.fr
@ 2014-02-10 22:14 ` pault at gcc dot gnu.org
  2014-02-11 23:40 ` dominiq at lps dot ens.fr
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu.org @ 2014-02-10 22:14 UTC (permalink / raw)
  To: gcc-bugs

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

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |pault at gcc dot gnu.org

--- Comment #4 from Paul Thomas <pault at gcc dot gnu.org> ---
Created attachment 32098
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32098&action=edit
A fix for this problem

I am sure that this trick will fix pr57019 too.  This latter is claimed to be a
regression but I am sure that it never worked :-)  Nonetheless, I will take
advantage of the regression label!

I will work on it tomorrow night.

By the way, this patch regtests OK on trunk.  I have to make sure that
substrings of character arrays work OK with ASSOCIATE.

Thanks for the heads-up Dominique!

Cheers

Paul


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

* [Bug fortran/49636] [F03] ASSOCIATE construct confused with slightly complicated case
  2011-07-04 22:59 [Bug fortran/49636] New: Associate construct confused with slightly complicated case fkrogh#gcc at mathalacarte dot com
                   ` (3 preceding siblings ...)
  2014-02-10 22:14 ` pault at gcc dot gnu.org
@ 2014-02-11 23:40 ` dominiq at lps dot ens.fr
  2014-02-12  9:20 ` paul.richard.thomas at gmail dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-02-11 23:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Created attachment 32098 [details]
> A fix for this problem

AFAICT it fixes the problem for 64 bit mode only. In 32 bit mode the ICE is
gone, but I get at run time

i_good=         1         3         5
 i_bad=         1**********         3

> I am sure that this trick will fix pr57019 too.  This latter is claimed 
> to be a regression but I am sure that it never worked :-)  Nonetheless, 
> I will take advantage of the regression label!
>
> I will work on it tomorrow night.
>
> By the way, this patch regtests OK on trunk.  I have to make sure 
> that substrings of character arrays work OK with ASSOCIATE.

Did you regtest with -m32? I see gfortran.dg/associated_target_5.f03 failing at
execution time with -m32, as well as the first test in pr57522

           0           1           2           3
           0           4           1           5


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

* [Bug fortran/49636] [F03] ASSOCIATE construct confused with slightly complicated case
  2011-07-04 22:59 [Bug fortran/49636] New: Associate construct confused with slightly complicated case fkrogh#gcc at mathalacarte dot com
                   ` (4 preceding siblings ...)
  2014-02-11 23:40 ` dominiq at lps dot ens.fr
@ 2014-02-12  9:20 ` paul.richard.thomas at gmail dot com
  2015-09-08  9:29 ` dominiq at lps dot ens.fr
  2015-10-18  9:21 ` pault at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: paul.richard.thomas at gmail dot com @ 2014-02-12  9:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from paul.richard.thomas at gmail dot com <paul.richard.thomas at gmail dot com> ---
 Dear Dominique,

Thanks for the heads-up about -m32 - I thought that the code would be
immune to word length changes ***sigh***

Cheers

Paul

On 12 February 2014 00:40, dominiq at lps dot ens.fr
<gcc-bugzilla@gcc.gnu.org> wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49636
>
> --- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
>> Created attachment 32098 [details]
>> A fix for this problem
>
> AFAICT it fixes the problem for 64 bit mode only. In 32 bit mode the ICE is
> gone, but I get at run time
>
> i_good=         1         3         5
>  i_bad=         1**********         3
>
>> I am sure that this trick will fix pr57019 too.  This latter is claimed
>> to be a regression but I am sure that it never worked :-)  Nonetheless,
>> I will take advantage of the regression label!
>>
>> I will work on it tomorrow night.
>>
>> By the way, this patch regtests OK on trunk.  I have to make sure
>> that substrings of character arrays work OK with ASSOCIATE.
>
> Did you regtest with -m32? I see gfortran.dg/associated_target_5.f03 failing at
> execution time with -m32, as well as the first test in pr57522
>
>            0           1           2           3
>            0           4           1           5
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
> You are the assignee for the bug.


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

* [Bug fortran/49636] [F03] ASSOCIATE construct confused with slightly complicated case
  2011-07-04 22:59 [Bug fortran/49636] New: Associate construct confused with slightly complicated case fkrogh#gcc at mathalacarte dot com
                   ` (5 preceding siblings ...)
  2014-02-12  9:20 ` paul.richard.thomas at gmail dot com
@ 2015-09-08  9:29 ` dominiq at lps dot ens.fr
  2015-10-18  9:21 ` pault at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-09-08  9:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49636

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |20585

--- Comment #7 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Ping!


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=20585
[Bug 20585] [meta-bug] Fortran 2003 support


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

* [Bug fortran/49636] [F03] ASSOCIATE construct confused with slightly complicated case
  2011-07-04 22:59 [Bug fortran/49636] New: Associate construct confused with slightly complicated case fkrogh#gcc at mathalacarte dot com
                   ` (6 preceding siblings ...)
  2015-09-08  9:29 ` dominiq at lps dot ens.fr
@ 2015-10-18  9:21 ` pault at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu.org @ 2015-10-18  9:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49636

--- Comment #8 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #7)
> Ping!

I am just going through the PRs assigned to me and tying to draw up a priority
list.

***sigh*** there are quite a lot fo which there are partial fixes!

Paul


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

end of thread, other threads:[~2015-10-18  9:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-04 22:59 [Bug fortran/49636] New: Associate construct confused with slightly complicated case fkrogh#gcc at mathalacarte dot com
2011-07-04 23:21 ` [Bug fortran/49636] " fkrogh#gcc at mathalacarte dot com
2011-07-05  9:06 ` burnus at gcc dot gnu.org
2014-02-10  9:33 ` [Bug fortran/49636] [F03] ASSOCIATE " dominiq at lps dot ens.fr
2014-02-10 22:14 ` pault at gcc dot gnu.org
2014-02-11 23:40 ` dominiq at lps dot ens.fr
2014-02-12  9:20 ` paul.richard.thomas at gmail dot com
2015-09-08  9:29 ` dominiq at lps dot ens.fr
2015-10-18  9:21 ` pault 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).