From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31697 invoked by alias); 14 May 2005 18:28:15 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 31531 invoked by uid 48); 14 May 2005 18:28:10 -0000 Date: Sat, 14 May 2005 18:28:00 -0000 Message-ID: <20050514182810.31530.qmail@sourceware.org> From: "rguenth at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050512200450.21541.jsm28@gcc.gnu.org> References: <20050512200450.21541.jsm28@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/21541] [4.1 Regression] gcc.c-torture/execute/20031215-1.c compilation fails X-Bugzilla-Reason: CC X-SW-Source: 2005-05/txt/msg01921.txt.bz2 List-Id: ------- Additional Comments From rguenth at gcc dot gnu dot org 2005-05-14 18:28 ------- gimplify_expr calls fold_indirect_ref on *(char *)&ao.ch which happily folds away the cast. Disabling fold_indirect_ref leaves the stripping to STRIP_USELESS_TYPE_CONVERSION, so we end up with const char * D.1237; D.1237 = &ao.ch; *D.1237 = 1; resulting from gimplify_expr ( unit size align 8 symtab 0 alias set -1 precision 8 min max pointer_to_this > unsigned SI size unit size align 32 symtab 0 alias set -1> readonly constant invariant arg 0 unsigned SI size unit size align 32 symtab 0 alias set -1 pointer_to_this > readonly constant invariant arg 0 readonly arg 0 arg 1 >>> ) and tree_ssa_useless_type_conversion_1 tells us that the conversion from unit size align 8 symtab 0 alias set -1 precision 8 min max pointer_to_this > unsigned SI size constant invariant 32> unit size constant invariant 4> align 32 symtab 0 alias set -1 pointer_to_this > to unit size align 8 symtab 0 alias set -1 precision 8 min max pointer_to_this > unsigned SI size constant invariant 32> unit size constant invariant 4> align 32 symtab 0 alias set -1> is useless because c_types_compatible_p in turn thinks "char" and "const char" are compatible because they share the same TYPE_MAIN_VARIANT "char". So we finally strip the NOP_EXPR doing the cast to char* from const char*. If we disable that part of tree_ssa_useless_type_conversion_1, we don't ICE any longer, but alias1 still does not insert V_MAY_DEFs here and dce1 finally deletes the store. Which may be a valid optimization; .t17.alias1: test1 () { char * D.1237; : D.1237_1 = (char *) &ao.ch; # VUSE ; *D.1237_1 = 1; return; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21541