public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/43843]  New: Wrong-code due to missing temporary with user-defined operatator
@ 2010-04-21 21:25 burnus at gcc dot gnu dot org
  2010-04-21 21:52 ` [Bug fortran/43843] " dominiq at lps dot ens dot fr
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-04-21 21:25 UTC (permalink / raw)
  To: gcc-bugs

Reported by Kyle Horne at http://gcc.gnu.org/ml/fortran/2010-04/msg00215.html

There is a missing temporary for user-defined operators:

   type(polar_t),dimension(3)::b
   b = polar_t(1.0,0.5)
   b(:) = b(:)/b(1)

The latter is translated into:
    struct polar_t * D.1551;
    D.1551 = &b[0];

      S.5 = 1;
      while (1)
        {
          if (S.5 > 3) goto L.3;
          b[S.5 + -1] = div_pp (&b[S.5 + -1], D.1551);
          S.5 = S.5 + 1;
        }
      L.3:;

but that fails as one overrides *D.1551 alias b[0] alias B(1) in the first
iteration instead of evaluating first all of the RHS before assigning to the
LHS.

Work with ifort and NAG, fails with GCC 4.1, 4.2, 4.3, 4.4, 4.5, and 4.6


-- 
           Summary: Wrong-code due to missing temporary with user-defined
                    operatator
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


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

* [Bug fortran/43843] Wrong-code due to missing temporary with user-defined operatator
  2010-04-21 21:25 [Bug fortran/43843] New: Wrong-code due to missing temporary with user-defined operatator burnus at gcc dot gnu dot org
@ 2010-04-21 21:52 ` dominiq at lps dot ens dot fr
  2010-04-22  8:25 ` dfranke at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dominiq at lps dot ens dot fr @ 2010-04-21 21:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dominiq at lps dot ens dot fr  2010-04-21 21:49 -------
It looks like a duplicate of PR 43841.


-- 


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


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

* [Bug fortran/43843] Wrong-code due to missing temporary with user-defined operatator
  2010-04-21 21:25 [Bug fortran/43843] New: Wrong-code due to missing temporary with user-defined operatator burnus at gcc dot gnu dot org
  2010-04-21 21:52 ` [Bug fortran/43843] " dominiq at lps dot ens dot fr
@ 2010-04-22  8:25 ` dfranke at gcc dot gnu dot org
  2010-04-24  9:29 ` pault at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-04-22  8:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dfranke at gcc dot gnu dot org  2010-04-22 08:25 -------


*** This bug has been marked as a duplicate of 43841 ***


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

* [Bug fortran/43843] Wrong-code due to missing temporary with user-defined operatator
  2010-04-21 21:25 [Bug fortran/43843] New: Wrong-code due to missing temporary with user-defined operatator burnus at gcc dot gnu dot org
  2010-04-21 21:52 ` [Bug fortran/43843] " dominiq at lps dot ens dot fr
  2010-04-22  8:25 ` dfranke at gcc dot gnu dot org
@ 2010-04-24  9:29 ` pault at gcc dot gnu dot org
  2010-06-27 16:15 ` pault at gcc dot gnu dot org
  2010-06-27 16:22 ` pault at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu dot org @ 2010-04-24  9:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pault at gcc dot gnu dot org  2010-04-24 09:28 -------
Subject: Bug 43843

Author: pault
Date: Sat Apr 24 09:28:32 2010
New Revision: 158683

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158683
Log:
2010-04-24  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/43841
        PR fortran/43843
        * trans-expr.c (gfc_conv_expr): Supply an address expression for
        GFC_SS_REFERENCE.
        (gfc_conv_expr_reference): Call gfc_conv_expr and return for
        GFC_SS_REFERENCE.
        * trans-array.c (gfc_add_loop_ss_code): Store the value rather
        than the address of a GFC_SS_REFERENCE.
        * trans.h : Change comment on GFC_SS_REFERENCE. 

2010-04-24  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/43841
        PR fortran/43843
        * gfortran.dg/elemental_scalar_args_1.f90 : New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/elemental_scalar_args_1.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-array.c
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/fortran/trans.h
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/43843] Wrong-code due to missing temporary with user-defined operatator
  2010-04-21 21:25 [Bug fortran/43843] New: Wrong-code due to missing temporary with user-defined operatator burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-04-24  9:29 ` pault at gcc dot gnu dot org
@ 2010-06-27 16:15 ` pault at gcc dot gnu dot org
  2010-06-27 16:22 ` pault at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu dot org @ 2010-06-27 16:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pault at gcc dot gnu dot org  2010-06-27 16:15 -------
Subject: Bug 43843

Author: pault
Date: Sun Jun 27 16:14:55 2010
New Revision: 161471

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161471
Log:
2010-06-27  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/43841
        PR fortran/43843
        * trans-expr.c (gfc_conv_expr): Supply an address expression for
        GFC_SS_REFERENCE.
        (gfc_conv_expr_reference): Call gfc_conv_expr and return for
        GFC_SS_REFERENCE.
        * trans-array.c (gfc_add_loop_ss_code): Store the value rather
        than the address of a GFC_SS_REFERENCE.
        * trans.h : Change comment on GFC_SS_REFERENCE. 

2010-06-27  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/43841
        PR fortran/43843
        * gfortran.dg/elemental_scalar_args_1.f90 : New test.


Added:
   
branches/gcc-4_5-branch/gcc/testsuite/gfortran.dg/elemental_scalar_args_1.f90
Modified:
    branches/gcc-4_5-branch/gcc/fortran/ChangeLog
    branches/gcc-4_5-branch/gcc/fortran/trans-array.c
    branches/gcc-4_5-branch/gcc/fortran/trans-expr.c
    branches/gcc-4_5-branch/gcc/fortran/trans.h
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/43843] Wrong-code due to missing temporary with user-defined operatator
  2010-04-21 21:25 [Bug fortran/43843] New: Wrong-code due to missing temporary with user-defined operatator burnus at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2010-06-27 16:15 ` pault at gcc dot gnu dot org
@ 2010-06-27 16:22 ` pault at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu dot org @ 2010-06-27 16:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pault at gcc dot gnu dot org  2010-06-27 16:22 -------
Subject: Bug 43843

Author: pault
Date: Sun Jun 27 16:22:27 2010
New Revision: 161472

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161472
Log:
2010-06-27  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/43841
        PR fortran/43843
        * trans-expr.c (gfc_conv_expr): Supply an address expression for
        GFC_SS_REFERENCE.
        (gfc_conv_expr_reference): Call gfc_conv_expr and return for
        GFC_SS_REFERENCE.
        * trans-array.c (gfc_add_loop_ss_code): Store the value rather
        than the address of a GFC_SS_REFERENCE.
        * trans.h : Change comment on GFC_SS_REFERENCE. 

2010-06-27  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/43841
        PR fortran/43843
        * gfortran.dg/elemental_scalar_args_1.f90 : New test.


Added:
   
branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/elemental_scalar_args_1.f90
Modified:
    branches/gcc-4_4-branch/gcc/fortran/ChangeLog
    branches/gcc-4_4-branch/gcc/fortran/trans-array.c
    branches/gcc-4_4-branch/gcc/fortran/trans-expr.c
    branches/gcc-4_4-branch/gcc/fortran/trans.h
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


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


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

end of thread, other threads:[~2010-06-27 16:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-21 21:25 [Bug fortran/43843] New: Wrong-code due to missing temporary with user-defined operatator burnus at gcc dot gnu dot org
2010-04-21 21:52 ` [Bug fortran/43843] " dominiq at lps dot ens dot fr
2010-04-22  8:25 ` dfranke at gcc dot gnu dot org
2010-04-24  9:29 ` pault at gcc dot gnu dot org
2010-06-27 16:15 ` pault at gcc dot gnu dot org
2010-06-27 16:22 ` 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).