This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RTL gensupport - fix warning when using a match_scratch predicate
- From: Graham Stott <graham dot stott at btinternet dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 24 Apr 2013 18:41:09 +0100 (BST)
- Subject: RTL gensupport - fix warning when using a match_scratch predicate
- Reply-to: Graham Stott <graham dot stott at btinternet dot com>
All
Currently using the match_scratch predicate on a destination operand will trigger the warning
"warning: destination operand 0 allows non-lvalue",
This happends because add_predicate_code() will set the pred->allows_non_lvalue when
it encounters a SCRATCH rtx code which subsequently triggers the above genrecog warning/
Graham
gcc/ChangeLog
* gensupport.c:: (add_predicate_code) Also exclude SCRATCH from rtx codes which allow
non-lvalues.
Index: gcc/gensupport.c
=========================================
--- gcc/gensupport.c (revision 198200)
+++ gcc/gensupport.c (working copy)
@@ -2732,7 +2732,8 @@
&& code != MEM
&& code != CONCAT
&& code != PARALLEL
- && code != STRICT_LOW_PART)
+ && code != STRICT_LOW_PART
+ && code != SCRATCH)
pred->allows_non_lvalue = true;
if (pred->num_codes == 1)