From: Jim Wilson Date: Fri, 5 Mar 1993 17:45:15 +0000 (-0800) Subject: (note_mem_written): QImode varying structure memory accesses can alias scalars. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2d08d5b6566d4c019a85ee1ea957a1d59d4bc8f6;p=gcc.git (note_mem_written): QImode varying structure memory accesses can alias scalars. From-SVN: r3654 --- diff --git a/gcc/cse.c b/gcc/cse.c index 4249af65e3b..855242d4c12 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -6885,9 +6885,12 @@ note_mem_written (written, writes_ptr) { /* A varying address that is a sum indicates an array element, and that's just as good as a structure element - in implying that we need not invalidate scalar variables. */ - if (!(MEM_IN_STRUCT_P (written) - || GET_CODE (XEXP (written, 0)) == PLUS)) + in implying that we need not invalidate scalar variables. + However, we must allow QImode aliasing of scalars, because the + ANSI C standard allows character pointers to alias anything. */ + if (! ((MEM_IN_STRUCT_P (written) + || GET_CODE (XEXP (written, 0)) == PLUS) + && GET_MODE (written) != QImode)) writes_ptr->all = 1; writes_ptr->nonscalar = 1; }