This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Aliasing violation generated by fold_builtin_memcmp?
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: uweigand at de dot ibm dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 29 Sep 05 21:44:28 EDT
- Subject: Re: Aliasing violation generated by fold_builtin_memcmp?
In short, the problem appears to be this code in fold_builtin_memcmp:
/* If len parameter is one, return an expression corresponding to
(*(const unsigned char*)arg1 - (const unsigned char*)arg2). */
if (host_integerp (len, 1) && tree_low_cst (len, 1) == 1)
{
tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0);
tree cst_uchar_ptr_node = build_pointer_type (cst_uchar_node);
Any suggestions how to fix this?
Maybe change the above to
build_pointer_type_for_mode (cst_uchar_node, ptr_mode, true)