* [PATCH] Handle BIT_INSERT_EXPR in hashable_expr_equal_p
@ 2017-07-29 18:48 Andrew Pinski
2017-07-31 8:46 ` Richard Biener
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Pinski @ 2017-07-29 18:48 UTC (permalink / raw)
To: GCC Patches, Richard Guenther
[-- Attachment #1: Type: text/plain, Size: 620 bytes --]
Hi,
When I was playing around where lowering of bit-field accesses go in
the pass order, I found that DOM had the same issue as PRE had when it
came to comparing BIT_INSERT_EXPR for equality. The same exact
testcase was showing the wrong code; gcc.dg/tree-ssa/20040324-1.c.
This fixes DOM the same way as I had fixed PRE, by special casing
BIT_INSERT_EXPR due to the implicit operand.
OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions.
Thanks,
Andrew Pinski
ChangeLog:
* tree-ssa-scopedtables.c (hashable_expr_equal_p): Check
BIT_INSERT_EXPR's operand 1
to see if the types precision matches.
[-- Attachment #2: fixdombitinsert.diff.txt --]
[-- Type: text/plain, Size: 934 bytes --]
Index: tree-ssa-scopedtables.c
===================================================================
--- tree-ssa-scopedtables.c (revision 250712)
+++ tree-ssa-scopedtables.c (working copy)
@@ -502,6 +502,16 @@ hashable_expr_equal_p (const struct hash
expr1->ops.ternary.opnd2, 0))
return false;
+ /* BIT_INSERT_EXPR has an implict operand as the type precision
+ of op1. Need to check to make sure they are the same. */
+ if (expr0->ops.ternary.op == BIT_INSERT_EXPR
+ && TREE_CODE (expr0->ops.ternary.opnd1) == INTEGER_CST
+ && TREE_CODE (expr1->ops.ternary.opnd1) == INTEGER_CST
+ && TYPE_PRECISION (TREE_TYPE (expr0->ops.ternary.opnd1))
+ != TYPE_PRECISION (TREE_TYPE (expr1->ops.ternary.opnd1)))
+ return false;
+
+
if (operand_equal_p (expr0->ops.ternary.opnd0,
expr1->ops.ternary.opnd0, 0)
&& operand_equal_p (expr0->ops.ternary.opnd1,
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Handle BIT_INSERT_EXPR in hashable_expr_equal_p
2017-07-29 18:48 [PATCH] Handle BIT_INSERT_EXPR in hashable_expr_equal_p Andrew Pinski
@ 2017-07-31 8:46 ` Richard Biener
0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2017-07-31 8:46 UTC (permalink / raw)
To: Andrew Pinski; +Cc: GCC Patches
On Sat, Jul 29, 2017 at 8:48 PM, Andrew Pinski <apinski@cavium.com> wrote:
> Hi,
> When I was playing around where lowering of bit-field accesses go in
> the pass order, I found that DOM had the same issue as PRE had when it
> came to comparing BIT_INSERT_EXPR for equality. The same exact
> testcase was showing the wrong code; gcc.dg/tree-ssa/20040324-1.c.
>
> This fixes DOM the same way as I had fixed PRE, by special casing
> BIT_INSERT_EXPR due to the implicit operand.
>
> OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions.
Watch excess vertical space:
+ return false;
+
+
if (operand_equal_p (expr0->ops.ternary.opnd0,
Ok with that fixed.
Thanks,
Richard.
> Thanks,
> Andrew Pinski
>
> ChangeLog:
> * tree-ssa-scopedtables.c (hashable_expr_equal_p): Check
> BIT_INSERT_EXPR's operand 1
> to see if the types precision matches.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-31 8:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-29 18:48 [PATCH] Handle BIT_INSERT_EXPR in hashable_expr_equal_p Andrew Pinski
2017-07-31 8:46 ` Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).