aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>1998-12-29 03:35:06 -0800
committerRichard Henderson <rth@gcc.gnu.org>1998-12-29 03:35:06 -0800
commit8f8e7de31b408c5eab2d07cf753bd35a84875c09 (patch)
tree5af3cfa50c047178f3e2a25b4d12c7c2567b0f74
parent67211fa1fc863b62e0744db71ce6c15e95c7d3be (diff)
downloadgcc-8f8e7de31b408c5eab2d07cf753bd35a84875c09.zip
gcc-8f8e7de31b408c5eab2d07cf753bd35a84875c09.tar.gz
gcc-8f8e7de31b408c5eab2d07cf753bd35a84875c09.tar.bz2
bcp-1.c (bad10): Rename from opt3.
* gcc.c-torture/execute/bcp-1.c (bad10): Rename from opt3. (opt3): Rename from opt4 and disable. From-SVN: r24437
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/bcp-1.c24
2 files changed, 23 insertions, 6 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3978ce3..4dc1279 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+Tue Dec 29 11:33:25 1998 Richard Henderson <rth@cygnus.com>
+
+ * gcc.c-torture/execute/bcp-1.c (bad10): Rename from opt3.
+ (opt3): Rename from opt4 and disable.
+
1998-12-20 Alexandre Oliva <oliva@dcc.unicamp.br>
* g++.old-deja/g++.pt/ptrmem5.C: New test.
diff --git a/gcc/testsuite/gcc.c-torture/execute/bcp-1.c b/gcc/testsuite/gcc.c-torture/execute/bcp-1.c
index 1eafec5..38b1d3e 100644
--- a/gcc/testsuite/gcc.c-torture/execute/bcp-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/bcp-1.c
@@ -11,6 +11,7 @@ inline int bad6(int x) { return __builtin_constant_p(x+1); }
int bad7(void) { return __builtin_constant_p(abort()); }
int bad8(void) { char buf[10]; return __builtin_constant_p(buf); }
int bad9(const char *x) { return __builtin_constant_p(x[123456]); }
+int bad10(void) { return __builtin_constant_p(&global); }
/* These must pass, or we've broken gcc2 functionality. */
int good0(void) { return __builtin_constant_p(1); }
@@ -20,14 +21,25 @@ int good2(void) { return __builtin_constant_p((1234 + 45) & ~7); }
/* These are extensions to gcc2. Failure indicates an optimization
regression. */
int opt0(void) { return bad3(1); }
-int opt1(void) { return bad4("hi"); }
-int opt2(void) { return bad6(1); }
-int opt3(void) { return __builtin_constant_p(&global); }
-int opt4(void) { return __builtin_constant_p("hi"[0]); }
+int opt1(void) { return bad6(1); }
+int opt2(void) { return __builtin_constant_p("hi"[0]); }
+
+/*
+ * Opt3 is known to fail. It is one of the important cases that glibc
+ * was interested in though, so keep this around as a reminder.
+ *
+ * The solution is to add bits to recover bytes from constant pool
+ * elements given nothing but a constant pool label and an offset.
+ * When we can do that, and we can simplify strlen after the fact,
+ * then we can enable recognition of constant pool labels as constants.
+ */
+
+/* int opt3(void) { return bad4("hi"); } */
+
/* Call through tables so -finline-functions can't screw with us. */
int (*bad_t0[])(void) = {
- bad0, bad1, bad5, bad7, bad8
+ bad0, bad1, bad5, bad7, bad8, bad10
};
int (*bad_t1[])(int x) = {
@@ -43,7 +55,7 @@ int (*good_t0[])(void) = {
};
int (*opt_t0[])(void) = {
- opt0, opt1, opt2, opt3, opt4
+ opt0, opt1, opt2 /* , opt3 */
};
#define N(arr) (sizeof(arr)/sizeof(*arr))