public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/19417] New: return value of some functions not properly set (in r3)
@ 2005-01-12 23:46 cort at fsmlabs dot com
  2005-01-12 23:48 ` [Bug c/19417] " cort at fsmlabs dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: cort at fsmlabs dot com @ 2005-01-12 23:46 UTC (permalink / raw)
  To: gcc-bugs

I have included 2 .i and .s files.  One correctly sets the return value (r3) and
one does not.  The addition of the nonleaf() call causes the return value to be
set properly.  If you search the .s files for "cort start return" "cort end
return" you can see it.

It seems that the return value isn't set properly if the function does not call
another function at the out: label.

I'm cross compiling from a 32-bit x86 to a 32-bit PowerPC (of the 6xx/74xx variety).

-- 
           Summary: return value of some functions not properly set (in r3)
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P1
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: cort at fsmlabs dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i386-linux
GCC target triplet: ppc-linux


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


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

* [Bug c/19417] return value of some functions not properly set (in r3)
  2005-01-12 23:46 [Bug c/19417] New: return value of some functions not properly set (in r3) cort at fsmlabs dot com
  2005-01-12 23:48 ` [Bug c/19417] " cort at fsmlabs dot com
@ 2005-01-12 23:48 ` cort at fsmlabs dot com
  2005-01-12 23:49 ` cort at fsmlabs dot com
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cort at fsmlabs dot com @ 2005-01-12 23:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cort at fsmlabs dot com  2005-01-12 23:48 -------
Created an attachment (id=7943)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7943&action=view)
non-working .i


-- 


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


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

* [Bug c/19417] return value of some functions not properly set (in r3)
  2005-01-12 23:46 [Bug c/19417] New: return value of some functions not properly set (in r3) cort at fsmlabs dot com
@ 2005-01-12 23:48 ` cort at fsmlabs dot com
  2005-01-12 23:48 ` cort at fsmlabs dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cort at fsmlabs dot com @ 2005-01-12 23:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cort at fsmlabs dot com  2005-01-12 23:48 -------
Created an attachment (id=7944)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7944&action=view)
working .i file


-- 


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


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

* [Bug c/19417] return value of some functions not properly set (in r3)
  2005-01-12 23:46 [Bug c/19417] New: return value of some functions not properly set (in r3) cort at fsmlabs dot com
                   ` (2 preceding siblings ...)
  2005-01-12 23:49 ` cort at fsmlabs dot com
@ 2005-01-12 23:49 ` cort at fsmlabs dot com
  2005-01-12 23:51 ` cort at fsmlabs dot com
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cort at fsmlabs dot com @ 2005-01-12 23:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cort at fsmlabs dot com  2005-01-12 23:49 -------
Created an attachment (id=7945)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7945&action=view)
working .s file


-- 


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


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

* [Bug c/19417] return value of some functions not properly set (in r3)
  2005-01-12 23:46 [Bug c/19417] New: return value of some functions not properly set (in r3) cort at fsmlabs dot com
  2005-01-12 23:48 ` [Bug c/19417] " cort at fsmlabs dot com
  2005-01-12 23:48 ` cort at fsmlabs dot com
@ 2005-01-12 23:49 ` cort at fsmlabs dot com
  2005-01-12 23:49 ` cort at fsmlabs dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cort at fsmlabs dot com @ 2005-01-12 23:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cort at fsmlabs dot com  2005-01-12 23:49 -------
Created an attachment (id=7946)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7946&action=view)
non-working .s file


-- 


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


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

* [Bug c/19417] return value of some functions not properly set (in r3)
  2005-01-12 23:46 [Bug c/19417] New: return value of some functions not properly set (in r3) cort at fsmlabs dot com
                   ` (3 preceding siblings ...)
  2005-01-12 23:49 ` cort at fsmlabs dot com
@ 2005-01-12 23:51 ` cort at fsmlabs dot com
  2005-01-13  0:02 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cort at fsmlabs dot com @ 2005-01-12 23:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cort at fsmlabs dot com  2005-01-12 23:51 -------
More info - host system info, gcc build flags and compiler flags used to
build the source files.

Script started on Wed 12 Jan 2005 03:42:36 PM MST
cort@host115<rtlinuxpro-2.2>$ /opt/rtldk-2.2/bin/ppc-linux-gcc -v
Reading specs from /opt/rtldk-2.2/bin/../lib/gcc-lib/ppc-linux/3.3.2/specs
Configured with: ../gcc-3.3.2/configure --prefix=/opt/rtldk-2.2/
--target=ppc-linux --enable-languages=c,c++,f77 --disable-nls
--enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit
--enable-shared --enable-c99 --host=i386-linux --enable-altivec
Thread model: posix
gcc version 3.3.2
cort@host115<rtlinuxpro-2.2>$ cat /etc/issue
Fedora Core release 2 (Tettnang)
Kernel \r on an \m

cort@host115<rtlinuxpro-2.2>$ uname -a
Linux host115.fsmlabs.com 2.4.25-rtl #18 SMP Fri May 28 16:51:21 MDT 2004 i686
i686 i386 GNU/Linux
cort@host115<rtlinuxpro-2.2>$ exit

Script done on Wed 12 Jan 2005 03:42:49 PM MST

built with:

/opt/rtldk-2.2/bin/ppc-linux-gcc -D__RTCORE_KERNEL__ -nostdinc -isystem
/opt/rtldk-2.2/bin/../lib/gcc-lib/ppc-linux/3.3.2/include/
-I/sys/rtlinuxpro-2.2/include/app/rtl -I/sys/rtlinuxpro-2.2/linux/include
-I/sys/rtlinuxpro-2.2/linux/arch/ppc  -I/sys/rtlinuxpro-2.2/include -Wall
-Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common
-I/sys/linuxrtl-2.4-synergy-2.2/arch/ppc -fsigned-char -msoft-float -pipe
-ffixed-r2 -Wno-uninitialized -mmultiple -mstring -DMODULE --save-temps -O2  -o
kill.o -c kill.c
ppc-linux-gcc: warning: -pipe ignored because -save-temps specified



-- 


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


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

* [Bug c/19417] return value of some functions not properly set (in r3)
  2005-01-12 23:46 [Bug c/19417] New: return value of some functions not properly set (in r3) cort at fsmlabs dot com
                   ` (4 preceding siblings ...)
  2005-01-12 23:51 ` cort at fsmlabs dot com
@ 2005-01-13  0:02 ` pinskia at gcc dot gnu dot org
  2005-01-13  0:38 ` [Bug middle-end/19417] " pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-13  0:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-13 00:02 -------
I see nothing wrong with the code:
.L139:
#APP
	/* cort start return */

#NO_APP
	mr 3,0
.L137:
--- return
-----
r0 is set before L139

r3 is set before L137:
	li 3,73
	beq- 0,.L137

So no nothing is wrong with the code as far as I can see.

Can you point out where the problem is because I cannot find it?

-- 


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


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

* [Bug middle-end/19417] return value of some functions not properly set (in r3)
  2005-01-12 23:46 [Bug c/19417] New: return value of some functions not properly set (in r3) cort at fsmlabs dot com
                   ` (5 preceding siblings ...)
  2005-01-13  0:02 ` pinskia at gcc dot gnu dot org
@ 2005-01-13  0:38 ` pinskia at gcc dot gnu dot org
  2005-01-13  0:44 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-13  0:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-13 00:38 -------
Oh, now I see the problem, we are using r0 twice which is just wrong.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal
          Component|c                           |middle-end
           Keywords|                            |wrong-code
           Priority|P1                          |P2


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


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

* [Bug middle-end/19417] return value of some functions not properly set (in r3)
  2005-01-12 23:46 [Bug c/19417] New: return value of some functions not properly set (in r3) cort at fsmlabs dot com
                   ` (6 preceding siblings ...)
  2005-01-13  0:38 ` [Bug middle-end/19417] " pinskia at gcc dot gnu dot org
@ 2005-01-13  0:44 ` pinskia at gcc dot gnu dot org
  2005-01-14 23:24 ` [Bug middle-end/19417] [3.3 only] " pinskia at gcc dot gnu dot org
  2005-01-15  0:40 ` dje at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-13  0:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-13 00:44 -------
This works with both 3.4.4 and 4.0.0, I don't know if it is a latent bug or not.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   GCC host triplet|i386-linux                  |
 GCC target triplet|ppc-linux                   |powerpc-*-*
      Known to work|                            |3.4.4 4.0.0


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


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

* [Bug middle-end/19417] [3.3 only] return value of some functions not properly set (in r3)
  2005-01-12 23:46 [Bug c/19417] New: return value of some functions not properly set (in r3) cort at fsmlabs dot com
                   ` (7 preceding siblings ...)
  2005-01-13  0:44 ` pinskia at gcc dot gnu dot org
@ 2005-01-14 23:24 ` pinskia at gcc dot gnu dot org
  2005-01-15  0:40 ` dje at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-14 23:24 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|return value of some        |[3.3 only] return value of
                   |functions not properly set  |some functions not properly
                   |(in r3)                     |set (in r3)
   Target Milestone|---                         |3.3.6


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


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

* [Bug middle-end/19417] [3.3 only] return value of some functions not properly set (in r3)
  2005-01-12 23:46 [Bug c/19417] New: return value of some functions not properly set (in r3) cort at fsmlabs dot com
                   ` (8 preceding siblings ...)
  2005-01-14 23:24 ` [Bug middle-end/19417] [3.3 only] " pinskia at gcc dot gnu dot org
@ 2005-01-15  0:40 ` dje at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: dje at gcc dot gnu dot org @ 2005-01-15  0:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dje at gcc dot gnu dot org  2005-01-15 00:40 -------
The inlined asm rtl_a_set() does not list any outputs or clobbers, so it looks
like the compiler safely can assume that the value is unchanged.  I am not sure
why the compiler can assume that the value is zero, but the asm definitely will
confuse it about the status of the register.  Showing the register as killed in
the asm fixes the code generation.

I am going to mark this as invalid.  Please reopen if you can explain to me why
GCC should behave well with an asm statement that kills the value in a register
but only lists inputs to the data dependency and flow parts of the compiler.

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


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


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

end of thread, other threads:[~2005-01-15  0:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-12 23:46 [Bug c/19417] New: return value of some functions not properly set (in r3) cort at fsmlabs dot com
2005-01-12 23:48 ` [Bug c/19417] " cort at fsmlabs dot com
2005-01-12 23:48 ` cort at fsmlabs dot com
2005-01-12 23:49 ` cort at fsmlabs dot com
2005-01-12 23:49 ` cort at fsmlabs dot com
2005-01-12 23:51 ` cort at fsmlabs dot com
2005-01-13  0:02 ` pinskia at gcc dot gnu dot org
2005-01-13  0:38 ` [Bug middle-end/19417] " pinskia at gcc dot gnu dot org
2005-01-13  0:44 ` pinskia at gcc dot gnu dot org
2005-01-14 23:24 ` [Bug middle-end/19417] [3.3 only] " pinskia at gcc dot gnu dot org
2005-01-15  0:40 ` dje 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).