This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/30590] [4.1/4.2/4.3 Regression] tree-nrv optimization clobbers return variable



------- Comment #9 from spark at gcc dot gnu dot org  2007-03-13 18:29 -------
How does this one look ? If it looks reasonable, I'll start the testing with
the mainline.

Index: tree-nrv.c
===================================================================
--- tree-nrv.c  (revision 122871)
+++ tree-nrv.c  (working copy)
@@ -163,6 +163,14 @@ tree_nrv (void)
                                                     result_type))
                return 0;
            }
+         else if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+           {
+             tree addr = get_base_address (GIMPLE_STMT_OPERAND (stmt, 0));
+              /* If there's any MODIFY of component of RESULT,
+                 then bail out.  */
+             if (addr && addr == result)
+               return 0;
+           }
        }
     }


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30590


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]