]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/49220 (ICE in create_pre_exit, at mode-switching.c:401)
authorKaz Kojima <kkojima@gcc.gnu.org>
Wed, 7 Nov 2012 10:48:12 +0000 (10:48 +0000)
committerKaz Kojima <kkojima@gcc.gnu.org>
Wed, 7 Nov 2012 10:48:12 +0000 (10:48 +0000)
PR middle-end/49220
* mode-switching.c (create_pre_exit): Set short_block if there
are no copy insns.

From-SVN: r193289

gcc/ChangeLog
gcc/mode-switching.c

index 0445594efc1a8bbcd18bb411d377a353969cb401..9444adc13324e58972dd651b7ac62497eb5e138f 100644 (file)
@@ -1,3 +1,9 @@
+2012-11-07  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       PR middle-end/49220
+       * mode-switching.c (create_pre_exit): Set short_block if there
+       are no copy insns.
+
 2012-11-07  Martin Jambor  <mjambor@suse.cz>
 
        * lto-cgraph.c: Include tree-pass.h.
index 386f8d1abe9d817d28ccc57d5ba50a7892bf2e3f..2072628805be1de30f4c4170f4da46df1e071d6d 100644 (file)
@@ -322,7 +322,14 @@ create_pre_exit (int n_entities, int *entity_map, const int *num_modes)
                             && GET_CODE (SUBREG_REG (copy_reg)) == REG)
                      copy_start = REGNO (SUBREG_REG (copy_reg));
                    else
-                     break;
+                     {
+                       /* When control reaches end of non-void function,
+                          there are no return copy insns at all.  This
+                          avoids an ice on that invalid function.  */
+                       if (ret_start + nregs == ret_end)
+                         short_block = 1;
+                       break;
+                     }
                    if (copy_start >= FIRST_PSEUDO_REGISTER)
                      {
                        last_insn = return_copy;