OSDN Git Service

* rtl.h (UINTVAL) New.
authorstuart <stuart@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Aug 2006 16:17:53 +0000 (16:17 +0000)
committerstuart <stuart@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Aug 2006 16:17:53 +0000 (16:17 +0000)
* config/rs6000/rs6000.c (SMALL_INT) Use it.
* testsuite/gcc.dg/20060801-1.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115855 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/rtl.h
gcc/testsuite/gcc.dg/20060801-1.c [new file with mode: 0644]

index b8aee3b..8cf2670 100644 (file)
@@ -1,3 +1,9 @@
+2006-08-01  Stuart Hastings  <stuart@apple.com>
+
+       * rtl.h (UINTVAL) New.
+       * config/rs6000/rs6000.c (SMALL_INT) Use it.
+       * testsuite/gcc.dg/20060801-1.c: New.
+       
 2006-08-01  Daniel Jacobowitz  <dan@codesourcery.com>
 
        PR debug/23336
index c42bb9f..c988857 100644 (file)
@@ -18105,7 +18105,7 @@ machopic_output_stub (FILE *file, const char *symb, const char *stub)
    position-independent addresses go into a reg.  This is REG if non
    zero, otherwise we allocate register(s) as necessary.  */
 
-#define SMALL_INT(X) ((unsigned) (INTVAL (X) + 0x8000) < 0x10000)
+#define SMALL_INT(X) ((UINTVAL (X) + 0x8000) < 0x10000)
 
 rtx
 rs6000_machopic_legitimize_pic_address (rtx orig, enum machine_mode mode,
index 42c4db6..75a89b6 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -996,6 +996,7 @@ enum label_kind
 
 /* For a CONST_INT rtx, INTVAL extracts the integer.  */
 #define INTVAL(RTX) XCWINT(RTX, 0, CONST_INT)
+#define UINTVAL(RTX) ((unsigned HOST_WIDE_INT) INTVAL (RTX))
 
 /* For a CONST_DOUBLE:
    For a VOIDmode, there are two integers CONST_DOUBLE_LOW is the
diff --git a/gcc/testsuite/gcc.dg/20060801-1.c b/gcc/testsuite/gcc.dg/20060801-1.c
new file mode 100644 (file)
index 0000000..7181f6b
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile { target { lp64 } } */
+/* { dg-options "-fPIC" } */
+char *ptr = 0;
+char array[100];
+void
+f()
+{
+  ptr = &array[0x100000000ULL];        /* A 33-bit constant.  */
+}