public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/22347] New: Return value register not correctly computed for indirect function call
@ 2005-07-07 12:19 rguenth at gcc dot gnu dot org
  2005-07-07 12:20 ` [Bug middle-end/22347] " rguenth at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-07-07 12:19 UTC (permalink / raw)
  To: gcc-bugs

double __attribute__((sseregparm)) mysin(double);
double __attribute__((sseregparm)) (*mysinfp)(double) = mysin;
double bar(double x)
{
  return mysinfp(x);
}

results in mysinfp as sibling call inside bar, wrongly thinking we
return on the FP stack from mysinfp.  This may happen in other
cases / on other targets in similar situations, but I couldn't come
up with a testcase that does not use sseregparm to change the
return value ABI.

rth kindly suggested how to possibly fix this:
http://gcc.gnu.org/ml/gcc/2005-07/msg00255.html

-- 
           Summary: Return value register not correctly computed for
                    indirect function call
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: i686-unknown-linux-gnu


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


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

* [Bug middle-end/22347] Return value register not correctly computed for indirect function call
  2005-07-07 12:19 [Bug middle-end/22347] New: Return value register not correctly computed for indirect function call rguenth at gcc dot gnu dot org
@ 2005-07-07 12:20 ` rguenth at gcc dot gnu dot org
  2005-07-11 14:28 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-07-07 12:20 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-07-07 12:20:01
               date|                            |


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


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

* [Bug middle-end/22347] Return value register not correctly computed for indirect function call
  2005-07-07 12:19 [Bug middle-end/22347] New: Return value register not correctly computed for indirect function call rguenth at gcc dot gnu dot org
  2005-07-07 12:20 ` [Bug middle-end/22347] " rguenth at gcc dot gnu dot org
@ 2005-07-11 14:28 ` rguenth at gcc dot gnu dot org
  2005-07-12  8:26 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-07-11 14:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at gcc dot gnu dot org  2005-07-11 14:27 -------
One problem seems to be that we place the attribute for mysinfp on the decl and
not on the type.  Why we do have both, and they can mis-match is a mystery to
me anyway ;)



-- 


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


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

* [Bug middle-end/22347] Return value register not correctly computed for indirect function call
  2005-07-07 12:19 [Bug middle-end/22347] New: Return value register not correctly computed for indirect function call rguenth at gcc dot gnu dot org
  2005-07-07 12:20 ` [Bug middle-end/22347] " rguenth at gcc dot gnu dot org
  2005-07-11 14:28 ` rguenth at gcc dot gnu dot org
@ 2005-07-12  8:26 ` rguenth at gcc dot gnu dot org
  2005-07-14  7:46 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-07-12  8:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at gcc dot gnu dot org  2005-07-12 08:02 -------
I have a fix for the target dependent parts.  Only tree-tailcall stomps on
our feet yet.  I.e.

double __attribute__((sseregparm)) mysin(double);
double __attribute__((sseregparm)) (*mysinfp)(double) = mysin;
double bar(double x)
{
  return 1.0+mysinfp(x);
}

is fixed at -O0 and -O2, the original testcase passes at -O0 but fails at
-O2.

http://gcc.gnu.org/ml/gcc-patches/2005-07/msg00817.html

-- 


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


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

* [Bug middle-end/22347] Return value register not correctly computed for indirect function call
  2005-07-07 12:19 [Bug middle-end/22347] New: Return value register not correctly computed for indirect function call rguenth at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-07-12  8:26 ` rguenth at gcc dot gnu dot org
@ 2005-07-14  7:46 ` rguenth at gcc dot gnu dot org
  2005-07-14  8:45 ` cvs-commit at gcc dot gnu dot org
  2005-07-14 13:16 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-07-14  7:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at gcc dot gnu dot org  2005-07-14 07:46 -------
Fixed.

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


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


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

* [Bug middle-end/22347] Return value register not correctly computed for indirect function call
  2005-07-07 12:19 [Bug middle-end/22347] New: Return value register not correctly computed for indirect function call rguenth at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-07-14  7:46 ` rguenth at gcc dot gnu dot org
@ 2005-07-14  8:45 ` cvs-commit at gcc dot gnu dot org
  2005-07-14 13:16 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-07-14  8:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-07-14 07:46 -------
Subject: Bug 22347

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rguenth@gcc.gnu.org	2005-07-14 07:46:23

Modified files:
	gcc            : ChangeLog 
	gcc/config/i386: i386-protos.h i386.c i386.h 
Added files:
	gcc/testsuite/gcc.target/i386: sseregparm-3.c sseregparm-4.c 
	                               sseregparm-5.c sseregparm-6.c 
	                               sseregparm-7.c 

Log message:
	2005-07-14  Richard Guenther  <rguenther@suse.de>
	
	PR middle-end/22347
	* config/i386/i386-protos.h (ix86_function_value): Change
	prototype to match new target hook.
	* config/i386/i386.c (ix86_value_regno): Change prototype
	to take extra type argument.
	(TARGET_FUNCTION_VALUE): Define.
	(ix86_function_ok_for_sibcall): Pass extra argument to
	ix86_value_regno, check return slot rtx for exact match.
	(ix86_function_value): Take extra parameter.  Dispatch to
	ix86_value_regno with fndecl/fntype as provided.
	(ix86_value_regno): Handle extra type argument.
	* config/i386/i386.h (FUNCTION_VALUE): No longer define.
	
	* testsuite/gcc.target/i386/sseregparm-3.c: New testcase.
	* testsuite/gcc.target/i386/sseregparm-4.c: New testcase.
	* testsuite/gcc.target/i386/sseregparm-5.c: New testcase.
	* testsuite/gcc.target/i386/sseregparm-6.c: New testcase.
	* testsuite/gcc.target/i386/sseregparm-7.c: New testcase.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9442&r2=2.9443
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386-protos.h.diff?cvsroot=gcc&r1=1.143&r2=1.144
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.c.diff?cvsroot=gcc&r1=1.841&r2=1.842
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.h.diff?cvsroot=gcc&r1=1.440&r2=1.441
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.target/i386/sseregparm-3.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.target/i386/sseregparm-4.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.target/i386/sseregparm-5.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.target/i386/sseregparm-6.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.target/i386/sseregparm-7.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug middle-end/22347] Return value register not correctly computed for indirect function call
  2005-07-07 12:19 [Bug middle-end/22347] New: Return value register not correctly computed for indirect function call rguenth at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2005-07-14  8:45 ` cvs-commit at gcc dot gnu dot org
@ 2005-07-14 13:16 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-14 13:16 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.1.0


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


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

end of thread, other threads:[~2005-07-14 13:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-07 12:19 [Bug middle-end/22347] New: Return value register not correctly computed for indirect function call rguenth at gcc dot gnu dot org
2005-07-07 12:20 ` [Bug middle-end/22347] " rguenth at gcc dot gnu dot org
2005-07-11 14:28 ` rguenth at gcc dot gnu dot org
2005-07-12  8:26 ` rguenth at gcc dot gnu dot org
2005-07-14  7:46 ` rguenth at gcc dot gnu dot org
2005-07-14  8:45 ` cvs-commit at gcc dot gnu dot org
2005-07-14 13:16 ` 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).