This is the mail archive of the gcc-patches@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]

[patch] fold-const.c (fold): Remove redundant cases.


Hi,

Attached is a patch to remove redundant cases.

At the beginning of fold(), we have

  if (kind == 'c')
    return t;

At the end, we have

    default:
      return t;

So all these cases are redundant.

I'd like to seek for an approval in case somebody wants to keep these
for documentation purposes.

Bootstrapped on i686-pc-linux-gnu.  OK to apply?

Kazu Hirata

2004-03-20  Kazu Hirata  <kazu@cs.umass.edu>

	* fold-const.c (fold): Remove cases for INTEGER_CST, REAL_CST,
	VECTOR_CST, STRING_CST, COMPLEX_CST, and CONSTRUCTOR.

Index: fold-const.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.353
diff -u -r1.353 fold-const.c
--- fold-const.c	20 Mar 2004 20:29:26 -0000	1.353
+++ fold-const.c	20 Mar 2004 20:57:36 -0000
@@ -5620,14 +5620,6 @@
 
   switch (code)
     {
-    case INTEGER_CST:
-    case REAL_CST:
-    case VECTOR_CST:
-    case STRING_CST:
-    case COMPLEX_CST:
-    case CONSTRUCTOR:
-      return t;
-
     case CONST_DECL:
       return fold (DECL_INITIAL (t));
 


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