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]
Other format: [Raw text]

Re: [tree-ssa] fix Bugs 15109, 15108, 14472 and most likely 14440

On May 10, 2004, at 00:41, Andrew Pinski wrote:

On May 6, 2004, at 20:05, Steven Bosscher wrote:

	* tree-tailcall.c (process_assignment): Look through NOP_EXPRs.
	(find_tail_calls): Likewise.


This is wrong for 32bit big endian targets and long long's.
This fails on powerpc-apple-darwin (and most likely every 32bit
big endian targets):

long long __attribute__((noinline)) t()
  return 0xFF00;

int __attribute__((noinline)) f()
  return t();

int main()
  if (f() != 0xFF00)
  return 0;

I found that this was actually a bug in convert, it was making a NOP_EXPR
when it should have making a CONVERT_EXPR.

Tested on powerpc-apple-darwin with Steven's patch with no regressions.
Tested on i686-pc-linux-gnu without Steven's patch with no regressions.


ChangeLog: * convert.c (convert_to_integer): Make a CONVERT_EXPR when there is a need to generate code instead of a NOP_EXPR.

Index: convert.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/convert.c,v retrieving revision diff -u -p -r1.18.2.14 convert.c --- convert.c 13 Apr 2004 22:33:23 -0000 +++ convert.c 10 May 2004 17:26:54 -0000 @@ -618,7 +618,7 @@ convert_to_integer (tree type, tree expr break; }

-      return build1 (NOP_EXPR, type, expr);
+      return build1 (CONVERT_EXPR, type, expr);

     case REAL_TYPE:
       return build1 (FIX_TRUNC_EXPR, type, expr);

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