summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-03 23:42:51 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-03 23:42:51 +0000
commit26a7cedebb71587b1391f81842c9c86d4c07c061 (patch)
tree9e3955f385b4f465c28d52da9a6f5639a2b73532
parente2289981f9cee5652ea3cf35c458a86715fe2505 (diff)
downloadppe42-gcc-26a7cedebb71587b1391f81842c9c86d4c07c061.tar.gz
ppe42-gcc-26a7cedebb71587b1391f81842c9c86d4c07c061.zip
PR middle-end/8408
* genrecog.c (preds): Handle ADDRESSOF. (validate_pattern): Mark it as an lvalue. * gcc.c-torture/compile/20021103-1.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58774 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/genrecog.c16
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20021103-1.c10
3 files changed, 25 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3cef1df2466..148d5066aef 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2002-11-03 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR middle-end/8408
+ * genrecog.c (preds): Handle ADDRESSOF.
+ (validate_pattern): Mark it as an lvalue.
+
2002-11-02 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/rs6000.c (rs6000_override_options): Use string
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index 9900b990a66..56b2680eb1f 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -187,22 +187,23 @@ static const struct pred_table
const RTX_CODE codes[NUM_RTX_CODE];
} preds[] = {
{"general_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
- LABEL_REF, SUBREG, REG, MEM}},
+ LABEL_REF, SUBREG, REG, MEM, ADDRESSOF}},
#ifdef PREDICATE_CODES
PREDICATE_CODES
#endif
{"address_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
- LABEL_REF, SUBREG, REG, MEM, PLUS, MINUS, MULT}},
- {"register_operand", {SUBREG, REG}},
- {"pmode_register_operand", {SUBREG, REG}},
+ LABEL_REF, SUBREG, REG, MEM, ADDRESSOF,
+ PLUS, MINUS, MULT}},
+ {"register_operand", {SUBREG, REG, ADDRESSOF}},
+ {"pmode_register_operand", {SUBREG, REG, ADDRESSOF}},
{"scratch_operand", {SCRATCH, REG}},
{"immediate_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
LABEL_REF}},
{"const_int_operand", {CONST_INT}},
{"const_double_operand", {CONST_INT, CONST_DOUBLE}},
- {"nonimmediate_operand", {SUBREG, REG, MEM}},
+ {"nonimmediate_operand", {SUBREG, REG, MEM, ADDRESSOF}},
{"nonmemory_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
- LABEL_REF, SUBREG, REG}},
+ LABEL_REF, SUBREG, REG, ADDRESSOF}},
{"push_operand", {MEM}},
{"pop_operand", {MEM}},
{"memory_operand", {SUBREG, MEM}},
@@ -211,7 +212,7 @@ static const struct pred_table
UNORDERED, ORDERED, UNEQ, UNGE, UNGT, UNLE,
UNLT, LTGT}},
{"mode_independent_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
- LABEL_REF, SUBREG, REG, MEM}}
+ LABEL_REF, SUBREG, REG, MEM, ADDRESSOF}}
};
#define NUM_KNOWN_PREDS ARRAY_SIZE (preds)
@@ -520,6 +521,7 @@ validate_pattern (pattern, insn, set, set_code)
if (c != REG
&& c != SUBREG
&& c != MEM
+ && c != ADDRESSOF
&& c != CONCAT
&& c != PARALLEL
&& c != STRICT_LOW_PART)
diff --git a/gcc/testsuite/gcc.c-torture/compile/20021103-1.c b/gcc/testsuite/gcc.c-torture/compile/20021103-1.c
new file mode 100644
index 00000000000..82802001a5d
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20021103-1.c
@@ -0,0 +1,10 @@
+/* PR middle-end/8408 */
+/* Verify that the recognizer explicitly
+ handles ADDRESSOF operands. */
+
+void foo(void)
+{
+ double d1 = 3.14159, d2;
+ if (&d2 == &d1)
+ ;
+}
OpenPOWER on IntegriCloud