This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/54945] Too strong non-aliasing analysis?
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 18 Oct 2012 10:19:20 +0000
- Subject: [Bug middle-end/54945] Too strong non-aliasing analysis?
- Auto-submitted: auto-generated
- References: <bug-54945-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54945
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-10-18 10:19:20 UTC ---
(In reply to comment #6)
> i_6 = (intptr_t) &MEM[(void *)&x + 4B];
> j_7 = (intptr_t) &y;
> _8 = i_6 == j_7;
>
> forwprop will call fold with (intptr_t) &MEM[(void *)&x + 4B] == (intptr_t) &y
> But a pointer -> signed/unsigned is not a sign-changing comparison really.
Yeah, that is why I think fold_sign_changed_comparison should just punt on
pointer-changes altogether, not allow them for NE_EXPR/EQ_EXPR.
So
if (TYPE_UNSIGNED (inner_type) != TYPE_UNSIGNED (outer_type)
&& code != NE_EXPR
&& code != EQ_EXPR)
return NULL_TREE;
if (POINTER_TYPE_P (inner_type) != POINTER_TYPE_P (outer_type))
return NULL_TREE;