This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/15908] New: Invalid codegen: long long function
- From: "dalej at apple dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Jun 2004 23:55:09 -0000
- Subject: [Bug rtl-optimization/15908] New: Invalid codegen: long long function
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following fails on Darwin with -O2. (analysis afterwards)
extern long long xx(int) __attribute__((noinline));
long long array[60];
int foo() {
int i;
for (i=0; i<60; i++)
array[i] = xx(i);
}
long long xx(int i)
{
return ((long long)i)<<32;
}
int main() {
foo();
if (array[7] != ((long long)7)<<32)
abort();
}
Basic problem is that Darwin uses DImode Parallel for long long function returns, which falls through
the cracks in df.c:df_def_record_1(). I'm pretty sure the following patch is right for ppc, but I'm not
sure what non-BLKmode parallel is used for on other targets....
Index: df.c
===============================================================
====
RCS file: /cvs/gcc/gcc/gcc/df.c,v
retrieving revision 1.32.2.16.2.3
diff -u -d -b -w -c -3 -p -r1.32.2.16.2.3 df.c
cvs diff: conflicting specifications of output style
*** df.c 7 Jun 2004 17:04:49 -0000 1.32.2.16.2.3
--- df.c 9 Jun 2004 23:53:17 -0000
*************** df_def_record_1 (struct df *df, rtx x, b
*** 888,896 ****
loc = &SET_DEST (x);
dst = *loc;
! /* Some targets place small structures in registers for
return values of functions. */
! if (GET_CODE (dst) == PARALLEL && GET_MODE (dst) == BLKmode)
{
int i;
--- 888,896 ----
loc = &SET_DEST (x);
dst = *loc;
! /* Some targets place small structures or 64-bit ints in registers for
return values of functions. */
! if (GET_CODE (dst) == PARALLEL)
{
int i;
--
Summary: Invalid codegen: long long function
Product: gcc
Version: lno
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: rtl-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dalej at apple dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: powerpc-apple-darwin7.3.0
GCC host triplet: powerpc-apple-darwin7.3.0
GCC target triplet: powerpc-apple-darwin7.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15908