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] optabs.c: Fix abs-related failures.


Hi,

Attached is a patch to fix abs-related failures caused by

  http://gcc.gnu.org/ml/gcc-cvs/2003-06/msg00123.html

When expand_abs was split into two pieces, expand_abs and
expand_abs_nojump, expand_abs lost the if statement addressed in the
patch, causing negv to be used, which in turn caused link errors
because H8 does have negv.

This fixes the following failures:

  execute/builtins/abs-1.c
  execute/950612-1.c
  execute/arith-rand-ll.c
  execute/arith-rand.c
  execute/builtin-abs-1.c
  execute/builtin-abs-2.c

Tested on h8300 port.  OK to apply?

Kazu Hirata

2003-06-07  Kazu Hirata  <kazu@cs.umass.edu>

	* optabs.c (expand_abs): Set result_unsignedp to 1 if
	flag_trav is zero.

Index: optabs.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/optabs.c,v
retrieving revision 1.176
diff -u -r1.176 optabs.c
--- optabs.c	5 Jun 2003 16:31:47 -0000	1.176
+++ optabs.c	7 Jun 2003 23:37:05 -0000
@@ -2901,6 +2901,9 @@
 {
   rtx temp, op1;
 
+  if (! flag_trapv)
+    result_unsignedp = 1;
+
   temp = expand_abs_nojump (mode, op0, target, result_unsignedp);
   if (temp != 0)
     return temp;


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