cse.c (cse_insn): Check that the tentative replacement was successfully forced to...
authorEric Botcazou <ebotcazou@libertysurf.fr>
Sat, 18 Oct 2003 07:32:08 +0000 (09:32 +0200)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 18 Oct 2003 07:32:08 +0000 (07:32 +0000)
* cse.c (cse_insn) [src_folded]: Check that the tentative replacement
was successfully forced to memory before using the result.

From-SVN: r72635

gcc/ChangeLog
gcc/cse.c

index b89036c3639331ab43b89af22ebae9a321a7bca6..3fd42ab28c33d5d25e4b44d175a841be6e3ca289 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-18  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * cse.c (cse_insn) [src_folded]: Check that the tentative replacement
+       was successfully forced to memory before using the result.
+
 2003-10-18  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        PR optimization/8178
index 7cdc72f6506291034500557288b44a5a6c581eb9..7612a5a7ed526ae6c7f13dae96296b9e6b8edd35 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -5416,7 +5416,11 @@ cse_insn (rtx insn, rtx libcall_insn)
            {
              trial = src_folded, src_folded_cost = MAX_COST;
              if (src_folded_force_flag)
-               trial = force_const_mem (mode, trial);
+               {
+                 rtx forced = force_const_mem (mode, trial);
+                 if (forced)
+                   trial = forced;
+               }
            }
          else if (src
                   && preferrable (src_cost, src_regcost,