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 middle-end/31531] A microoptimization of isnegative of signed integer



------- Comment #3 from pinskia at gcc dot gnu dot org  2007-04-10 19:20 -------
A quick patch like:
Index: expr.c
===================================================================
--- expr.c      (revision 123691)
+++ expr.c      (working copy)
@@ -6828,7 +6828,7 @@
   tree type;
   int unsignedp;
   enum machine_mode mode;
-  enum tree_code code = TREE_CODE (exp);
+  enum tree_code code;
   optab this_optab;
   rtx subtarget, original_target;
   int ignore;
@@ -6840,6 +6840,9 @@
                                                                  type)   \
                                 : (expr))

+  if (TREE_CODE (exp) != COND_EXPR && !GIMPLE_TUPLE_P (exp))
+    exp = fold (exp);
+  code = TREE_CODE(exp);
   if (GIMPLE_STMT_P (exp))
     {
       type = void_type_node;



Makes all functions emit the same code.


-- 


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


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