gcc-2.95.1 (Intel) & Stepanov Benchmark failures

H.J. Lu hjl@lucon.org
Tue Oct 19 08:02:00 GMT 1999


> FYI, this testcase does not trigger the problem -- it never does any stacking

I never said the compiler would dump core. It is a run-time error
and there is no main (). 

> operations, at least at -O2.  But between this code and your explanation I

I can show you a testcase which will be miscompiled at -O2. But this
one is the smallest one I can get.

> understand the problem and I believe it will be fixed for gcc-2.95.2 using
> a patch that is basically equivalent to yours.

Thanks. This verion may be a little faster since it is possible that
more functions may look like

double foo (...)

stead of

struct bar
{
  double x;
}

struct bar foo (...)

That may be one reason why this bug hasn't shown up more often.

Thanks.


-- 
H.J. Lu (hjl@gnu.org)
---
--- ../../../import/gcc-2.95.x/egcs/gcc/reg-stack.c	Tue Oct 19 07:38:49 1999
+++ ./reg-stack.c	Tue Oct 19 07:57:31 1999
@@ -1186,19 +1186,14 @@ static rtx
 stack_result (decl)
      tree decl;
 {
-  rtx result;
+  rtx result = DECL_RTL (DECL_RESULT (decl));
 
   /* If the value is supposed to be returned in memory, then clearly
-     it is not returned in a stack register.  */
-  if (aggregate_value_p (DECL_RESULT (decl)))
-    return 0;
-
-  result = DECL_RTL (DECL_RESULT (decl));
-  /* ?!?  What is this code supposed to do?  Can this code actually
-     trigger if we kick out aggregates above?  */
+     it is not returned in a stack register. */
   if (result != 0
       && ! (GET_CODE (result) == REG
-	    && REGNO (result) < FIRST_PSEUDO_REGISTER))
+	    && REGNO (result) < FIRST_PSEUDO_REGISTER)
+      && !aggregate_value_p (DECL_RESULT (decl)))
     {
 #ifdef FUNCTION_OUTGOING_VALUE
       result


More information about the Gcc-bugs mailing list