aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2004-02-18 12:33:18 +0000
committerPaul Brook <pbrook@gcc.gnu.org>2004-02-18 12:33:18 +0000
commite978d62ee6039fd2daa8a0f1acdcef80d441cec6 (patch)
tree102a24438e32c9cd6fd53076e943e238b32fe3c6
parent5c1c8a03a695dd26ef22b969e5d2d93f68ce8b36 (diff)
downloadgcc-e978d62ee6039fd2daa8a0f1acdcef80d441cec6.zip
gcc-e978d62ee6039fd2daa8a0f1acdcef80d441cec6.tar.gz
gcc-e978d62ee6039fd2daa8a0f1acdcef80d441cec6.tar.bz2
rtlanal.c (rtx_varies_p): Return 0 for NULL_RTX
* rtlanal.c (rtx_varies_p): Return 0 for NULL_RTX testsuite/ * gcc.c-torture/compile/libcall-1.c: New test. From-SVN: r78027
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/rtlanal.c6
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/libcall-1.c14
4 files changed, 27 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4e4dcd7..8b1e566 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2004-02-18 Paul Brook <paul@codesourcery.com>
+ * rtlanal.c (rtx_varies_p): Return 0 for NULL_RTX
+
+2004-02-18 Paul Brook <paul@codesourcery.com>
+
PR debug/12934
* dwarf2out.c (loc_descriptor_from_tree): Handle
EXPR_WITH_FILE_LOCATION.
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index c408521..f643dfe 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -134,10 +134,14 @@ rtx_unstable_p (rtx x)
int
rtx_varies_p (rtx x, int for_alias)
{
- RTX_CODE code = GET_CODE (x);
+ RTX_CODE code;
int i;
const char *fmt;
+ if (!x)
+ return 0;
+
+ code = GET_CODE (x);
switch (code)
{
case MEM:
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c343a64..3bacb3b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2004-02-18 Paul Brook <paul@codesourcery.com>
+ * gcc.c-torture/compile/libcall-1.c: New test.
+
+2004-02-18 Paul Brook <paul@codesourcery.com>
+
PR debug/12934
* gcc.dg/debug/debug-7.c: New test.
diff --git a/gcc/testsuite/gcc.c-torture/compile/libcall-1.c b/gcc/testsuite/gcc.c-torture/compile/libcall-1.c
new file mode 100644
index 0000000..c1b1cfc
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/libcall-1.c
@@ -0,0 +1,14 @@
+/* Failed on ARM because rtx_varies_p didn't like the REG_EQUAL notes
+ generated for libcalls.
+ http://gcc.gnu.org/ml/gcc-patches/2004-02/msg01518.html */
+static const char digs[] = "0123456789ABCDEF";
+int __attribute__((pure)) bar();
+
+int foo (int i)
+{
+ int len;
+ if (i)
+ return 0;
+ len = bar();
+ return digs[len];
+}