public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/15908] New: Invalid codegen: long long function
@ 2004-06-09 23:55 dalej at apple dot com
  2004-06-09 23:56 ` [Bug rtl-optimization/15908] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: dalej at apple dot com @ 2004-06-09 23:55 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/15908] Invalid codegen: long long function
  2004-06-09 23:55 [Bug rtl-optimization/15908] New: Invalid codegen: long long function dalej at apple dot com
@ 2004-06-09 23:56 ` pinskia at gcc dot gnu dot org
  2004-06-10  0:00 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-09 23:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-09 23:56 -------
*** Bug 15907 has been marked as a duplicate of this bug. ***

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15908


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/15908] Invalid codegen: long long function
  2004-06-09 23:55 [Bug rtl-optimization/15908] New: Invalid codegen: long long function dalej at apple dot com
  2004-06-09 23:56 ` [Bug rtl-optimization/15908] " pinskia at gcc dot gnu dot org
@ 2004-06-10  0:00 ` pinskia at gcc dot gnu dot org
  2004-06-10  1:02 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-10  0:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-09 23:59 -------
*** Bug 15907 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
           Keywords|                            |wrong-code
   Target Milestone|---                         |lno


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15908


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/15908] Invalid codegen: long long function
  2004-06-09 23:55 [Bug rtl-optimization/15908] New: Invalid codegen: long long function dalej at apple dot com
  2004-06-09 23:56 ` [Bug rtl-optimization/15908] " pinskia at gcc dot gnu dot org
  2004-06-10  0:00 ` pinskia at gcc dot gnu dot org
@ 2004-06-10  1:02 ` pinskia at gcc dot gnu dot org
  2004-06-10 14:21 ` rakdver at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-10  1:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-10 01:02 -------
Adding Zdenek Dvorak because he wrote the rewrite of df.c.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rakdver at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15908


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/15908] Invalid codegen: long long function
  2004-06-09 23:55 [Bug rtl-optimization/15908] New: Invalid codegen: long long function dalej at apple dot com
                   ` (2 preceding siblings ...)
  2004-06-10  1:02 ` pinskia at gcc dot gnu dot org
@ 2004-06-10 14:21 ` rakdver at gcc dot gnu dot org
  2004-06-10 20:03 ` dalej at apple dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2004-06-10 14:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rakdver at gcc dot gnu dot org  2004-06-10 14:21 -------
I don't think this is lno-branch specific (at least I haven't touched this part 
of df.c).  Could you please check whether this reproduces on mainline?

Zdenek

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15908


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/15908] Invalid codegen: long long function
  2004-06-09 23:55 [Bug rtl-optimization/15908] New: Invalid codegen: long long function dalej at apple dot com
                   ` (3 preceding siblings ...)
  2004-06-10 14:21 ` rakdver at gcc dot gnu dot org
@ 2004-06-10 20:03 ` dalej at apple dot com
  2004-06-10 21:07 ` rakdver at atrey dot karlin dot mff dot cuni dot cz
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dalej at apple dot com @ 2004-06-10 20:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dalej at apple dot com  2004-06-10 20:03 -------
Well, it's true the place I changed is also in mainline, but it's being called from the tree loop optimizer 
which isn't there, so I don't get the problem in mainline. 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15908


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/15908] Invalid codegen: long long function
  2004-06-09 23:55 [Bug rtl-optimization/15908] New: Invalid codegen: long long function dalej at apple dot com
                   ` (4 preceding siblings ...)
  2004-06-10 20:03 ` dalej at apple dot com
@ 2004-06-10 21:07 ` rakdver at atrey dot karlin dot mff dot cuni dot cz
  2004-06-10 21:13 ` dalej at apple dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rakdver at atrey dot karlin dot mff dot cuni dot cz @ 2004-06-10 21:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rakdver at atrey dot karlin dot mff dot cuni dot cz  2004-06-10 21:07 -------
Subject: Re:  Invalid codegen: long long function

Hello,

> Well, it's true the place I changed is also in mainline, but it's being called from the tree loop optimizer 

rtl, you mean?

> which isn't there, so I don't get the problem in mainline. 

OK.

Zdenek


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15908


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/15908] Invalid codegen: long long function
  2004-06-09 23:55 [Bug rtl-optimization/15908] New: Invalid codegen: long long function dalej at apple dot com
                   ` (5 preceding siblings ...)
  2004-06-10 21:07 ` rakdver at atrey dot karlin dot mff dot cuni dot cz
@ 2004-06-10 21:13 ` dalej at apple dot com
  2004-07-28 21:36 ` pinskia at gcc dot gnu dot org
  2004-09-24 13:03 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: dalej at apple dot com @ 2004-06-10 21:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dalej at apple dot com  2004-06-10 21:13 -------
Yes, duh.  loop-invariant.c in particular.  We may well be able to demonstrate it in mainline after this is 
merged in.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15908


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/15908] Invalid codegen: long long function
  2004-06-09 23:55 [Bug rtl-optimization/15908] New: Invalid codegen: long long function dalej at apple dot com
                   ` (6 preceding siblings ...)
  2004-06-10 21:13 ` dalej at apple dot com
@ 2004-07-28 21:36 ` pinskia at gcc dot gnu dot org
  2004-09-24 13:03 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-28 21:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-28 21:36 -------
This works now on:
GNU C version 3.5-tree-ssa-lno 20040727 (merged 20040718) (powerpc-apple-darwin7.4.1)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15908


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/15908] Invalid codegen: long long function
  2004-06-09 23:55 [Bug rtl-optimization/15908] New: Invalid codegen: long long function dalej at apple dot com
                   ` (7 preceding siblings ...)
  2004-07-28 21:36 ` pinskia at gcc dot gnu dot org
@ 2004-09-24 13:03 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-24 13:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-09-24 13:03 -------
Closing as fixed as I could not reproduce it.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15908


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-09-24 13:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-09 23:55 [Bug rtl-optimization/15908] New: Invalid codegen: long long function dalej at apple dot com
2004-06-09 23:56 ` [Bug rtl-optimization/15908] " pinskia at gcc dot gnu dot org
2004-06-10  0:00 ` pinskia at gcc dot gnu dot org
2004-06-10  1:02 ` pinskia at gcc dot gnu dot org
2004-06-10 14:21 ` rakdver at gcc dot gnu dot org
2004-06-10 20:03 ` dalej at apple dot com
2004-06-10 21:07 ` rakdver at atrey dot karlin dot mff dot cuni dot cz
2004-06-10 21:13 ` dalej at apple dot com
2004-07-28 21:36 ` pinskia at gcc dot gnu dot org
2004-09-24 13:03 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).