aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>2006-10-04 16:41:55 +0000
committerZack Weinberg <zack@gcc.gnu.org>2006-10-04 16:41:55 +0000
commit9e8265851df1859e0dfc447cb9ac44088bb8cb1c (patch)
tree20a2dfcb81e007f92b06951185a8557d56dfb9bb /gcc
parent2e38371e01e1944f79f4cdec3ead6fae8d31950d (diff)
downloadgcc-9e8265851df1859e0dfc447cb9ac44088bb8cb1c.zip
gcc-9e8265851df1859e0dfc447cb9ac44088bb8cb1c.tar.gz
gcc-9e8265851df1859e0dfc447cb9ac44088bb8cb1c.tar.bz2
Fix bug in constraint-check generator, reported by Rask Ingemann Lambertsen:
Fix bug in constraint-check generator, reported by Rask Ingemann Lambertsen: * genpreds.c (add_constraint): Don't remove anything from the expression here. (write_tm_constrs_h): Detect whether "op" argument is used, and mark it ARG_UNUSED if it isn't. (write_insn_const_int_ok_for_constraint): Skip the part of the expression that would test whether "op" (which is not available here) is a CONST_INT. From-SVN: r117433
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog20
-rw-r--r--gcc/genpreds.c16
2 files changed, 25 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6cb1973..209ab0d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2006-10-04 Zack Weinberg <zackw@panix.com>
+
+ Fix bug in constraint-check generator, reported by Rask Ingemann
+ Lambertsen:
+ * genpreds.c (add_constraint): Don't remove anything from the
+ expression here.
+ (write_tm_constrs_h): Detect whether "op" argument is used, and
+ mark it ARG_UNUSED if it isn't.
+ (write_insn_const_int_ok_for_constraint): Skip the part of the
+ expression that would test whether "op" (which is not available
+ here) is a CONST_INT.
+
2006-10-04 Ryan Mansfield <rmansfield@qnx.com>
PR c++/28448
@@ -42,7 +54,7 @@
2006-10-01 Ryan Mansfield <rmansfield@qnx.com>
PR c/20533
- * doc/extend.texi: Add used variable attribute description.
+ * doc/extend.texi: Add used variable attribute description.
2006-09-30 Joseph S. Myers <joseph@codesourcery.com>
@@ -4040,7 +4052,7 @@
range of a REG_DEAD register.
2006-18-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
- Anatoly Sokolov <aesok@post.ru>
+ Anatoly Sokolov <aesok@post.ru>
* config/avr/avr.c (avr_mcu_types): Add support for attiny261,
attiny461, attiny861, attiny25, attiny45, attiny85, attiny24,
@@ -4157,7 +4169,7 @@
* config/pa/pa-linux.h (STRING_ASM_OP): Prepend and append a tab.
2006-05-19 Daniel Berlin <dberlin@dberlin.org>
- Kenneth Zadeck <zadeck@naturalbridge.com>
+ Kenneth Zadeck <zadeck@naturalbridge.com>
PR rtl-optimization/26855
@@ -6555,7 +6567,7 @@
2006-04-04 Matthias Klose <doko@debian.org>
* Makefile.in (unprotoize.o): Same dependencies as for protoize.o.
-
+
PR bootstrap/26764
PR bootstrap/27334
* Makefile.in (s-macro_list): Conform to POSIX rules in single quoted
diff --git a/gcc/genpreds.c b/gcc/genpreds.c
index adc3e48..535c9dd 100644
--- a/gcc/genpreds.c
+++ b/gcc/genpreds.c
@@ -891,10 +891,6 @@ add_constraint (const char *name, const char *regclass,
have_error = 1;
return;
}
-
- /* Remove the redundant (and (match_code "const_(int|double)")
- from the expression. */
- exp = XEXP (exp, 1);
}
@@ -1078,10 +1074,13 @@ write_tm_constrs_h (void)
bool needs_rval = needs_variable (c->exp, "rval");
bool needs_mode = (needs_variable (c->exp, "mode")
|| needs_hval || needs_lval || needs_rval);
+ bool needs_op = (needs_variable (c->exp, "op")
+ || needs_ival || needs_mode);
printf ("static inline bool\n"
- "satisfies_constraint_%s (rtx op)\n"
- "{\n", c->c_name);
+ "satisfies_constraint_%s (rtx %s)\n"
+ "{\n", c->c_name,
+ needs_op ? "op" : "ARG_UNUSED (op)");
if (needs_mode)
puts ("enum machine_mode mode = GET_MODE (op);");
if (needs_ival)
@@ -1157,7 +1156,10 @@ write_insn_const_int_ok_for_constraint (void)
if (c->is_const_int)
{
printf (" case CONSTRAINT_%s:\n return ", c->c_name);
- write_predicate_expr (c->exp);
+ /* c->exp is guaranteed to be (and (match_code "const_int") (...));
+ we know at this point that we have a const_int, so we need not
+ bother with that part of the test. */
+ write_predicate_expr (XEXP (c->exp, 1));
fputs (";\n\n", stdout);
}