From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2916 invoked by alias); 18 Mar 2008 00:05:21 -0000 Received: (qmail 23342 invoked by uid 48); 18 Mar 2008 00:04:37 -0000 Date: Tue, 18 Mar 2008 00:05:00 -0000 Subject: [Bug target/35620] New: ICE passing dereferenced pointer to _Decimal32 X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "janis at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-03/txt/msg01453.txt.bz2 This source code, compiled on powerpc-linux with -O1, results in an internal compiler error since Peter Bergner's change to pass SDmode arguments in floating point registers: extern void bar (_Decimal32); _Decimal32 *p; void foo (void) { bar (*p); } The error message: elm3b145% /opt/gcc-nightly/trunk/bin/gcc -c -O1 bug.c bug.c: In function ‘foo’: bug.c:8: internal compiler error: in rs6000_secondary_memory_needed_rtx, at config/rs6000/rs6000.c:11204 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. It compiles cleanly with "-O1 -fno-tree-ter". The problem is that TER removes a temporary added to dereference "p" and instead passes *p directly. Code in rs6000_check_sdmode, a function Peter added to determine whether a function needs a stack slot for passing SDmode arguments, doesn't look for a dereference and so the temporary stack slot isn't created. This might fix it, but rather than jumping in and testing it thoroughly I'll talk to Peter about it when he returns from vacation. Index: rs6000.c =================================================================== --- rs6000.c (revision 133292) +++ rs6000.c (working copy) @@ -11230,6 +11230,7 @@ rs6000_check_sdmode (tree *tp, int *walk case FIELD_DECL: case RESULT_DECL: case REAL_CST: + case INDIRECT_REF: if (TYPE_MODE (TREE_TYPE (*tp)) == SDmode) return *tp; break; This is a regression in GCC 4.3 (where the previous code didn't comply with the ABI) and on mainline. -- Summary: ICE passing dereferenced pointer to _Decimal32 Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: janis at gcc dot gnu dot org GCC target triplet: powerpc-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35620