public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/61999] [4.8/4.9/4.10 Regression] `gfc_simplify_dot_product` causes ICE for constant arguments
       [not found] <bug-61999-4@http.gcc.gnu.org/bugzilla/>
@ 2014-08-02 22:49 ` dominiq at lps dot ens.fr
  2014-08-03 14:24 ` dominiq at lps dot ens.fr
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-08-02 22:49 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-08-02
      Known to work|                            |4.4.7
            Summary|`gfc_simplify_dot_product`  |[4.8/4.9/4.10 Regression]
                   |causes ICE for constant     |`gfc_simplify_dot_product`
                   |arguments                   |causes ICE for constant
                   |                            |arguments
     Ever confirmed|0                           |1
      Known to fail|                            |4.10.0, 4.5.4, 4.6.4,
                   |                            |4.7.4, 4.8.3, 4.9.1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
The test compiles and gives 8.0 at run time with gfortran 4.4.7.


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

* [Bug fortran/61999] [4.8/4.9/4.10 Regression] `gfc_simplify_dot_product` causes ICE for constant arguments
       [not found] <bug-61999-4@http.gcc.gnu.org/bugzilla/>
  2014-08-02 22:49 ` [Bug fortran/61999] [4.8/4.9/4.10 Regression] `gfc_simplify_dot_product` causes ICE for constant arguments dominiq at lps dot ens.fr
@ 2014-08-03 14:24 ` dominiq at lps dot ens.fr
  2014-08-09 14:28 ` dominiq at lps dot ens.fr
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-08-03 14:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
The ICE is due to the line

  gcc_assert (gfc_compare_types (&vector_a->ts, &vector_b->ts));

i.e., gfc_simplify_dot_product works only if the two vectors have the same
type. Replacing the assert with

--- ../_clean/gcc/fortran/simplify.c    2014-07-26 13:13:21.000000000 +0200
+++ gcc/fortran/simplify.c    2014-08-03 15:43:35.000000000 +0200
@@ -1883,7 +1883,8 @@ gfc_expr*
 gfc_simplify_dot_product (gfc_expr *vector_a, gfc_expr *vector_b)
 {
   if (!is_constant_array_expr (vector_a)
-      || !is_constant_array_expr (vector_b))
+      || !is_constant_array_expr (vector_b)
+      || !gfc_compare_types (&vector_a->ts, &vector_b->ts))
     return NULL;

   gcc_assert (vector_a->rank == 1);

fixes the problem. Indeed this prevents the dot product to be computed at
compile time. A better solution will be to do the type conversion, but I don't
know how to do it.


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

* [Bug fortran/61999] [4.8/4.9/4.10 Regression] `gfc_simplify_dot_product` causes ICE for constant arguments
       [not found] <bug-61999-4@http.gcc.gnu.org/bugzilla/>
  2014-08-02 22:49 ` [Bug fortran/61999] [4.8/4.9/4.10 Regression] `gfc_simplify_dot_product` causes ICE for constant arguments dominiq at lps dot ens.fr
  2014-08-03 14:24 ` dominiq at lps dot ens.fr
@ 2014-08-09 14:28 ` dominiq at lps dot ens.fr
  2014-08-09 22:39 ` tkoenig at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-08-09 14:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Looks good! thanks.


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

* [Bug fortran/61999] [4.8/4.9/4.10 Regression] `gfc_simplify_dot_product` causes ICE for constant arguments
       [not found] <bug-61999-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2014-08-09 14:28 ` dominiq at lps dot ens.fr
@ 2014-08-09 22:39 ` tkoenig at gcc dot gnu.org
  2014-08-10 11:26 ` tkoenig at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2014-08-09 22:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Author: tkoenig
Date: Sat Aug  9 22:38:46 2014
New Revision: 213782

URL: https://gcc.gnu.org/viewcvs?rev=213782&root=gcc&view=rev
Log:
2014-08-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/61999
    * simplify.c (gfc_simplify_dot_product): Convert types of
    vectors before calculating the result.

2014-08-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/61999
    * gfortran.dg/dot_product_3.f90:  New test case.


Added:
    trunk/gcc/testsuite/gfortran.dg/dot_product_3.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/simplify.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/61999] [4.8/4.9/4.10 Regression] `gfc_simplify_dot_product` causes ICE for constant arguments
       [not found] <bug-61999-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2014-08-09 22:39 ` tkoenig at gcc dot gnu.org
@ 2014-08-10 11:26 ` tkoenig at gcc dot gnu.org
  2014-08-10 14:20 ` tkoenig at gcc dot gnu.org
  2014-08-10 14:20 ` tkoenig at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2014-08-10 11:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Author: tkoenig
Date: Sun Aug 10 11:25:24 2014
New Revision: 213788

URL: https://gcc.gnu.org/viewcvs?rev=213788&root=gcc&view=rev
Log:
2014-08-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

    Backport from trunk
    PR fortran/61999
    * simplify.c (gfc_simplify_dot_product): Convert types of
    vectors before calculating the result.

2014-08-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

    Backport from trunk
    PR fortran/61999
    * gfortran.dg/dot_product_3.f90:  New test case.


Added:
    branches/gcc-4_9-branch/gcc/testsuite/gfortran.dg/dot_product_3.f90
Modified:
    branches/gcc-4_9-branch/gcc/fortran/ChangeLog
    branches/gcc-4_9-branch/gcc/fortran/simplify.c
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog


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

* [Bug fortran/61999] [4.8/4.9/4.10 Regression] `gfc_simplify_dot_product` causes ICE for constant arguments
       [not found] <bug-61999-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2014-08-10 14:20 ` tkoenig at gcc dot gnu.org
@ 2014-08-10 14:20 ` tkoenig at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2014-08-10 14:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Author: tkoenig
Date: Sun Aug 10 14:19:18 2014
New Revision: 213789

URL: https://gcc.gnu.org/viewcvs?rev=213789&root=gcc&view=rev
Log:
2014-08-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

    Backport from trunk
    PR fortran/61999
    * simplify.c (gfc_simplify_dot_product): Convert types of
    vectors before calculating the result.

2014-08-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

    Backport from trunk
    PR fortran/61999
    * gfortran.dg/dot_product_3.f90:  New test case.

Added:
    branches/gcc-4_8-branch/gcc/testsuite/gfortran.dg/dot_product_3.f90
Modified:
    branches/gcc-4_8-branch/gcc/fortran/ChangeLog
    branches/gcc-4_8-branch/gcc/fortran/simplify.c
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog


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

* [Bug fortran/61999] [4.8/4.9/4.10 Regression] `gfc_simplify_dot_product` causes ICE for constant arguments
       [not found] <bug-61999-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2014-08-10 11:26 ` tkoenig at gcc dot gnu.org
@ 2014-08-10 14:20 ` tkoenig at gcc dot gnu.org
  2014-08-10 14:20 ` tkoenig at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2014-08-10 14:20 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Fixed on all open branches, closing.

Thanks for the bug report!


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

end of thread, other threads:[~2014-08-10 14:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-61999-4@http.gcc.gnu.org/bugzilla/>
2014-08-02 22:49 ` [Bug fortran/61999] [4.8/4.9/4.10 Regression] `gfc_simplify_dot_product` causes ICE for constant arguments dominiq at lps dot ens.fr
2014-08-03 14:24 ` dominiq at lps dot ens.fr
2014-08-09 14:28 ` dominiq at lps dot ens.fr
2014-08-09 22:39 ` tkoenig at gcc dot gnu.org
2014-08-10 11:26 ` tkoenig at gcc dot gnu.org
2014-08-10 14:20 ` tkoenig at gcc dot gnu.org
2014-08-10 14:20 ` tkoenig 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).