public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/10519: optimization based on SSA "-O2 -fssa" uses wrong register
@ 2003-04-28 12:46 Andrew Pinski
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Pinski @ 2003-04-28 12:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR optimization/10519; it has been noted by GNATS.

From: Andrew Pinski <pinskia@physics.uc.edu>
To: Heinrich.Brand@fujitsu-siemens.com
Cc: gcc-gnats@gcc.gnu.org, Erwin.Unruh@fujitsu-siemens.com
Subject: Re: optimization/10519: optimization based on SSA "-O2 -fssa" uses wrong register
Date: Mon, 28 Apr 2003 08:38:13 -0400

 -fssa is not ready for production use, from  
 <http://gcc.gnu.org/onlinedocs/gcc/Optimize- 
 Options.html#Optimize%20Options>:
   Users should not specify this option, since it is not yet ready for  
 production use.
 
 Since -fssa is going away in favor of something different, do not use  
 this flag.
 
 Thanks,
 Andrew Pinski
 


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

* optimization/10519: optimization based on SSA "-O2 -fssa" uses wrong register
@ 2003-04-28 12:26 Heinrich.Brand
  0 siblings, 0 replies; 2+ messages in thread
From: Heinrich.Brand @ 2003-04-28 12:26 UTC (permalink / raw)
  To: gcc-gnats; +Cc: Erwin.Unruh


>Number:         10519
>Category:       optimization
>Synopsis:       optimization based on SSA "-O2 -fssa" uses wrong register
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 28 12:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Heinrich Brand
>Release:        Release: gcc version 3.3 20030407 (prerelease)
>Organization:
>Environment:
SunOS 5.8 sparc
>Description:
The test below compiles and executes successfully
with -O2 but fails with -O2 -fssa. The  disassembled code
differs in one register in one place. A function should add
2 input registers and return the sum but in the "-O2 -fssa" case
only one register is used in the add instruction.

(Source code is in How-To-Repeat.) 

*******************************************************************
The dissembled code of both cases ("-O2" OK and "-O2 -fssa" wrong) :
*******************************************************************
-O2 :

fy()
           0:  81 c3 e0 08         jmp          %o7 + 8
           4:  90 02 00 09         add          %o0, %o1, %o0


*******************************************************************
-O2 -fssa :

fy()
           0:  81 c3 e0 08         jmp          %o7 + 8
-------------------- wrong register in add: ------------------------ 
           4:  90 02 00 08         add          %o0, %o0, %o0
                                                       

*******************************************************************
both cases (only offsets differ):

main()
           8:  9d e3 bf 90         save         %sp, -112, %sp
           c:  92 10 20 04         mov          4, %o1
          10:  40 00 00 00         call         0x10
          14:  90 10 20 03         mov          3, %o0
          18:  80 a2 20 07         cmp          %o0, 7
...
*******************************************************************
End of the disassembled code.
>How-To-Repeat:
The the test with output FAILED can be repeated by:
Compile following source code 
with gcc 3.3 20030407 -O2 -fssa
and
execute resulting program 

int printf(const char *format, ...);
int f(int a, int b){
        int *xa,*xb;
        xa=&a;xb=&b;
        return *xa+*(xb);
}
int main(){
  if( f(3,4)==7 )
    printf("SUCCESSFUL\n");
  else
   printf("FAILED\n");
  return 0;
}
>Fix:
Do not use "-O2 -fssa" . 
>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2003-04-28 12:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-28 12:46 optimization/10519: optimization based on SSA "-O2 -fssa" uses wrong register Andrew Pinski
  -- strict thread matches above, loose matches on Subject: below --
2003-04-28 12:26 Heinrich.Brand

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).