OSDN Git Service

2007-08-03 Andrew Pinski <andrew_pinski@playstation.sony.com>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 3 Aug 2007 23:36:05 +0000 (23:36 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 3 Aug 2007 23:36:05 +0000 (23:36 +0000)
        PR middle-end/32935
        * fold-convert.c (fold_negate_expr <NOP_EXPR>): Convert back to the
         correct type the negate expression.

2007-08-03  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR middle-end/32935
        * gfortran.fortran-torture/compile/complex_1.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127190 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.fortran-torture/compile/complex_1.f90 [new file with mode: 0644]

index 5878f50..21f9c3a 100644 (file)
@@ -1,3 +1,9 @@
+2007-08-03  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+       PR middle-end/32935
+       * fold-convert.c (fold_negate_expr <NOP_EXPR>): Convert back to the
+        correct type the negate expression.
+
 2007-08-03  Jan Hubicka  <jh@suse.cz>
 
        * i386.c (setup_incoming_varargs_64): Tolerate 64bit preferred
index 614e55a..be46b23 100644 (file)
@@ -1382,7 +1382,7 @@ fold_negate_expr (tree t)
        {
          tem = strip_float_extensions (t);
          if (tem != t && negate_expr_p (tem))
-           return negate_expr (tem);
+           return fold_convert (type, negate_expr (tem));
        }
       break;
 
index ded4044..7ba9afc 100644 (file)
@@ -1,3 +1,8 @@
+2007-08-03  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+       PR middle-end/32935
+       * gfortran.fortran-torture/compile/complex_1.f90: New test.
+
 2007-08-03  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
 
        PR fortran/32955
diff --git a/gcc/testsuite/gfortran.fortran-torture/compile/complex_1.f90 b/gcc/testsuite/gfortran.fortran-torture/compile/complex_1.f90
new file mode 100644 (file)
index 0000000..605ec66
--- /dev/null
@@ -0,0 +1,5 @@
+program test_gfortran2
+ Complex(8) :: g, zh
+ Real(8)    :: g_q
+ g =   zh - zh/cmplx(0.0_8,-g_q)
+end