From 2d08d5b6566d4c019a85ee1ea957a1d59d4bc8f6 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Fri, 5 Mar 1993 09:45:15 -0800 Subject: [PATCH] (note_mem_written): QImode varying structure memory accesses can alias scalars. From-SVN: r3654 --- gcc/cse.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; } -- 2.30.2