]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/57904 (Bogus(?) "invokes undefined behavior" warning with Fortran...
authorJeff Law <law@redhat.com>
Fri, 17 Jan 2014 17:50:10 +0000 (10:50 -0700)
committerJeff Law <law@gcc.gnu.org>
Fri, 17 Jan 2014 17:50:10 +0000 (10:50 -0700)
PR middle-end/57904
* passes.def: Reorder pass_copy_prop, pass_unrolli, pass_ccp sequence
so that pass_ccp runs first.

        PR middle-end/57904
* gfortran.dg/pr57904.f90: New test.

From-SVN: r206723

gcc/ChangeLog
gcc/passes.def
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr57904.f90 [new file with mode: 0644]

index 9a2160d11686f09935cdc9a0a3e3d3f28ec40b15..76f5c6e0c2702965aefcb9992b6aec223649cca3 100644 (file)
@@ -1,3 +1,9 @@
+2014-01-17  Jeff Law  <law@redhat.com>
+
+       PR middle-end/57904
+       * passes.def: Reorder pass_copy_prop, pass_unrolli, pass_ccp sequence
+       so that pass_ccp runs first.
+
 2014-01-17  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/i386/i386.c (ix86_lea_outperforms): Use TARGET_XXX.
index 95ea8cecb2e816af7217745c2cb7646831032197..c98b048eafce33c5656a6fb74ed5f98615cb50d1 100644 (file)
@@ -132,11 +132,11 @@ along with GCC; see the file COPYING3.  If not see
         They ensure memory accesses are not indirect wherever possible.  */
       NEXT_PASS (pass_strip_predict_hints);
       NEXT_PASS (pass_rename_ssa_copies);
-      NEXT_PASS (pass_copy_prop);
-      NEXT_PASS (pass_complete_unrolli);
       NEXT_PASS (pass_ccp);
       /* After CCP we rewrite no longer addressed locals into SSA
         form if possible.  */
+      NEXT_PASS (pass_copy_prop);
+      NEXT_PASS (pass_complete_unrolli);
       NEXT_PASS (pass_phiprop);
       NEXT_PASS (pass_forwprop);
       NEXT_PASS (pass_object_sizes);
index 98bc5280293064ad40e752ced57bde9831dbfe3b..5d80c8e9237b8a42ca60f0520cfb99591d7b6528 100644 (file)
@@ -1,3 +1,8 @@
+2014-01-17  Jeff Law  <law@redhat.com>
+
+        PR middle-end/57904
+       * gfortran.dg/pr57904.f90: New test.
+
 2014-01-17  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/59269
diff --git a/gcc/testsuite/gfortran.dg/pr57904.f90 b/gcc/testsuite/gfortran.dg/pr57904.f90
new file mode 100644 (file)
index 0000000..69fa7ed
--- /dev/null
@@ -0,0 +1,22 @@
+! { dg-do compile }
+! { dg-options "-O2" }
+
+program test
+  call test2 ()
+contains
+  subroutine test2 ()
+    type t
+      integer, allocatable :: x
+    end type t
+
+    type t2
+      class(t), allocatable :: a
+    end type t2
+
+    type(t2) :: one, two
+
+    allocate (two%a)
+    one = two
+  end subroutine test2
+end program test
+