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

Re: Optimizer bug related to function pointers

On Fri, Sep 08, 2000 at 12:09:22AM -0700, Kevin Buettner wrote:
> I have this ChangeLog entry in my sources.  Also, I updated and
> rebuilt earlier in the week.  So, unless I'm doing something really
> stupid, my guess is that it's a different bug.

You're right, it is a different bug.  This appears to be fallout from 

2000-09-06  Bernd Schmidt  <>

        * cse.c: Include "basic-block.h".
        (struct table_elt): New field REGCOST.
        (CHEAP_REG): Delete macro.
        (COST): Return 0 for REGs.

as far as I can tell, function symbols were only accidentally not
cse'd previously.  Certainly nothing actively prevented it.

This fixes the test case on ia64.  I'm interested in opinions on
whether this is the best solution.

static void message (char *);

static void
init (void (**fp)(char *))
  *fp = message;
  message ("from init");
	* cse.c (fold_rtx): Enforce NO_FUNCTION_CSE on CALL patterns.

Index: cse.c
RCS file: /cvs/gcc/egcs/gcc/cse.c,v
retrieving revision 1.156
diff -c -p -d -r1.156 cse.c
*** cse.c	2000/09/06 09:20:37	1.156
--- cse.c	2000/09/08 08:41:16
*************** fold_rtx (x, insn)
*** 3611,3616 ****
--- 3611,3623 ----
  	return x;
+     case CALL:
+       if (CONSTANT_P (XEXP (XEXP (x, 0), 0)))
+ 	return x;
+       break;
+ #endif
      case ASM_OPERANDS:
        for (i = ASM_OPERANDS_INPUT_LENGTH (x) - 1; i >= 0; i--)
  	validate_change (insn, &ASM_OPERANDS_INPUT (x, i),

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