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]

[tree-ssa] fold-const.c patch reversion -- egg on my face


I *really* thought this had gone through my tester overnight.  Apparently
not, it causes all kinds of problems for the g77 front-end which assumes
that something like *"blah" won't get folded to 'b'.

	 * fold-const.c (fold, case INDIRECT_REF): Revert last change.

Index: fold-const.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.213.2.42
diff -c -3 -p -r1.213.2.42 fold-const.c
*** fold-const.c	14 Aug 2003 15:32:43 -0000	1.213.2.42
--- fold-const.c	14 Aug 2003 20:39:46 -0000
*************** fold (tree expr)
*** 7675,7697 ****
  	}
        return t;
  
-     case INDIRECT_REF:
-       {
- 	tree exp1 = TREE_OPERAND (expr, 0);
- 	tree index;
- 	tree string = string_constant (exp1, &index);
-                                                                              

- 	/* Try to optimize reads from const strings.  */
- 	if (string
- 	    && TREE_CODE (string) == STRING_CST
- 	    && TREE_CODE (index) == INTEGER_CST
- 	    && compare_tree_int (index, TREE_STRING_LENGTH (string)) < 0)
- 	  return build_int_2 ((TREE_STRING_POINTER (string)
- 			       [TREE_INT_CST_LOW (index)]), 0);
- 	return t;
-       }
- 
- 
      default:
        return t;
      } /* switch (code) */
--- 7675,7680 ----






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