diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index cb564c1e196a4963ef88962dc57e4bc3c8faee4a..6d2303a10e5ba6787fcb26bb4a61c8f2f3a5aba7 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-11-17  Steve Ellcey  <sje@cup.hp.com>
+
+	PR middle-end/31490
+	* gcc.dg/pr31490.c: New test.
+
 2010-11-17  Uros Bizjak  <ubizjak@gmail.com>
 
 	* gcc.dg/nop.h: Move from ...
diff --git a/gcc/testsuite/gcc.dg/pr31490.c b/gcc/testsuite/gcc.dg/pr31490.c
new file mode 100644
index 0000000000000000000000000000000000000000..966a1b4a50f07e5826552eac7edce1f286cf2398
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr31490.c
@@ -0,0 +1,6 @@
+/* PR middle-end/31490 */
+/* { dg-do compile } */
+/* { dg-require-named-sections "" } */
+int cpu (void *attr) {}
+const unsigned long x __attribute__((section("foo"))) =  (unsigned long)&cpu;
+const unsigned long g __attribute__((section("foo"))) = 0;