Do not consider COMPLEX_TYPE as fold_convertible_p
authorMartin Liska <mliska@suse.cz>
Fri, 8 Jul 2016 07:52:03 +0000 (09:52 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Fri, 8 Jul 2016 07:52:03 +0000 (07:52 +0000)
PR middle-end/71606
* fold-const.c (fold_convertible_p): As COMPLEX_TYPE
folding produces SAVE_EXPRs, thus return false for the type.
* gcc.dg/torture/pr71606.c: New test.

From-SVN: r238157

gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr71606.c [new file with mode: 0644]

index c3d6327577504eb9d52d703b527e5629711f54dd..afd022ed7f347208171d065acae0a55cf249fac1 100644 (file)
@@ -1,3 +1,9 @@
+2016-07-08  Martin Liska  <mliska@suse.cz>
+
+       PR middle-end/71606
+       * fold-const.c (fold_convertible_p): As COMPLEX_TYPE
+       folding produces SAVE_EXPRs, thus return false for the type.
+
 2016-07-07  Martin Liska  <mliska@suse.cz>
 
        * file-find.c (remove_prefix): New function.
index f97b8bf6978d3cf69c21991d0b95619fa4108a82..ac051ff96ef619499e7c010af89e1c4b0ebd0000 100644 (file)
@@ -2192,7 +2192,6 @@ fold_convertible_p (const_tree type, const_tree arg)
 
     case REAL_TYPE:
     case FIXED_POINT_TYPE:
-    case COMPLEX_TYPE:
     case VECTOR_TYPE:
     case VOID_TYPE:
       return TREE_CODE (type) == TREE_CODE (orig);
index 22a4a5888030f978b2623ca976f8600e54075324..8a4dc1d5b3d088509c6496b3a48a900c24ee53ec 100644 (file)
@@ -1,3 +1,7 @@
+2016-07-08  Martin Liska  <mliska@suse.cz>
+
+       * gcc.dg/torture/pr71606.c: New test.
+
 2016-07-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR fortran/71764
diff --git a/gcc/testsuite/gcc.dg/torture/pr71606.c b/gcc/testsuite/gcc.dg/torture/pr71606.c
new file mode 100644 (file)
index 0000000..b0cc26a
--- /dev/null
@@ -0,0 +1,11 @@
+_Complex a;
+void fn1 ();
+
+int main () {
+  fn1 (a);
+  return 0;
+}
+
+void fn1 (__complex__ long double p1) {
+  __imag__ p1 = 6.0L;
+}