public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/18912] New: FW: gcc 3.3.1 for Powerpc optimzation flag -Os generates bad code
@ 2004-12-09 21:29 atul dot sabharwal at tek dot com
  2004-12-09 21:33 ` [Bug target/18912] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: atul dot sabharwal at tek dot com @ 2004-12-09 21:29 UTC (permalink / raw)
  To: gcc-bugs

I have been trying to run busybox-1.00  ( also rc3)   on my powerpc board (MPC 
8540 processor ) and about half
the applets do not run and die with the message "Illegal instruction".  I have 
ppc_82xx-gcc Montavista compiler 
for the power pc board.  These compilers are cross compiled version of gcc 
3.3.1 compiler.  We are using the 
cross compiled glibc-2.3.2.
 
Some critical applets which are failing with Illegal instruction message are :
 
ar ash bunzip2 bzcat cat chgrp chown cmp cp cpio crond install ln ls mkdir tty 
wc cut date df du
egrep env expr fgrep find modprobe mount  rm rmdir route uname wget ftpget 
ftpput grep gunzip
halt head httpd id ifconfig inetd sh sort syslogd uniq xargs tee telnetd touch 
tr vi yes zcat.
 
About half the commands are broken.  When I compile with no optimization or 
optimize for speed i.e. -O2
instead for size -Os, everything works fine. 

Seems like an optimzation bug to me.

--
Atul

The configure command for cross compiling gcc was as below ( output of
ppc_82xx-gcc -v ) ::

Reading specs from /opt/montavista/pro/devkit/ppc/82xx/bin/../lib/gcc-
lib/powerpc-hardhat-linux/3.3.1/specs
Configured with: ../configure --host=i686-pc-linux-gnu --target=powerpc-
hardhat-linux 
--prefix=/opt/montavista/devkit/ppc/82xx --exec-
prefix=/opt/montavista/devkit/ppc/82xx 
--bindir=/opt/montavista/devkit/ppc/82xx/bin --
sbindir=/opt/montavista/devkit/ppc/82xx/sbin 
--sysconfdir=/opt/montavista/devkit/ppc/82xx/etc --
datadir=/opt/montavista/devkit/ppc/82xx/share 
--includedir=/opt/montavista/devkit/ppc/82xx/include --
libdir=/opt/montavista/devkit/ppc/82xx/lib 
--libexecdir=/opt/montavista/devkit/ppc/82xx/libexec --
localstatedir=/opt/montavista/devkit/ppc/82xx/var 
--sharedstatedir=/opt/montavista/devkit/ppc/82xx/share --
mandir=/opt/montavista/devkit/ppc/82xx/man 
--infodir=/opt/montavista/devkit/ppc/82xx/info --program-transform-
name=s,^,ppc_82xx-, --enable-cross 
--with-sysroot=/opt/montavista/devkit/ppc/82xx/target --enable-shared --enable-
languages=c,c++ --enable-__cxa_atexit 
--enable-threads=posix --disable-multilib --with-gxx-include-
dir='$'{gcc_tooldir}/../target/usr/include/c++/3.3.1 
--with-cpu=603
Thread model: posix
gcc version 3.3.1 (MontaVista 3.3.1-3.0.10.0300532 2003-12-24)

-- 
           Summary: FW: gcc 3.3.1 for Powerpc optimzation flag -Os generates
                    bad code
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: atul dot sabharwal at tek dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug target/18912] FW: gcc 3.3.1 for Powerpc optimzation flag -Os generates bad code
  2004-12-09 21:29 [Bug c/18912] New: FW: gcc 3.3.1 for Powerpc optimzation flag -Os generates bad code atul dot sabharwal at tek dot com
@ 2004-12-09 21:33 ` pinskia at gcc dot gnu dot org
  2004-12-09 22:01 ` atul dot sabharwal at exgate dot tek dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-09 21:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-09 21:33 -------
Hmm, you compiled for cpu=603 but the 82xx processor is not fully the same, also do you have a 
simple testcase?  read <http://gcc.gnu.org/bugs.html> also.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal
             Status|UNCONFIRMED                 |WAITING
          Component|c                           |target


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


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

* [Bug target/18912] FW: gcc 3.3.1 for Powerpc optimzation flag -Os generates bad code
  2004-12-09 21:29 [Bug c/18912] New: FW: gcc 3.3.1 for Powerpc optimzation flag -Os generates bad code atul dot sabharwal at tek dot com
  2004-12-09 21:33 ` [Bug target/18912] " pinskia at gcc dot gnu dot org
@ 2004-12-09 22:01 ` atul dot sabharwal at exgate dot tek dot com
  2004-12-09 22:03 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: atul dot sabharwal at exgate dot tek dot com @ 2004-12-09 22:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From atul dot sabharwal at exgate dot tek dot com  2004-12-09 22:01 -------
Subject: RE:  FW: gcc 3.3.1 for Powerpc optimzation flag
	 -Os generates bad code

I do not have a simple test case at this point which triggers this flaw.
A simple busybox applet e.g ls  causes "Illegal instruction".
Its about 1000 lines of code with comments. It has some libraries 
too.

If I am able to isolate further would notify you.
--
Atul

-----Original Message-----
From: pinskia at gcc dot gnu dot org [mailto:gcc-bugzilla@gcc.gnu.org] 
Sent: Thursday, December 09, 2004 1:33 PM
To: atul.sabharwal@tek.com
Subject: [Bug target/18912] FW: gcc 3.3.1 for Powerpc optimzation flag -Os
generates bad code



------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-09
21:33 -------
Hmm, you compiled for cpu=603 but the 82xx processor is not fully the same,
also do you have a 
simple testcase?  read <http://gcc.gnu.org/bugs.html> also.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal
             Status|UNCONFIRMED                 |WAITING
          Component|c                           |target


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

------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.


-- 


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


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

* [Bug target/18912] FW: gcc 3.3.1 for Powerpc optimzation flag -Os generates bad code
  2004-12-09 21:29 [Bug c/18912] New: FW: gcc 3.3.1 for Powerpc optimzation flag -Os generates bad code atul dot sabharwal at tek dot com
  2004-12-09 21:33 ` [Bug target/18912] " pinskia at gcc dot gnu dot org
  2004-12-09 22:01 ` atul dot sabharwal at exgate dot tek dot com
@ 2004-12-09 22:03 ` pinskia at gcc dot gnu dot org
  2004-12-09 22:28 ` atul dot sabharwal at exgate dot tek dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-09 22:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-09 22:03 -------
Also does -mcpu=8540 fix the problem then when compiling?

-- 


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


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

* [Bug target/18912] FW: gcc 3.3.1 for Powerpc optimzation flag -Os generates bad code
  2004-12-09 21:29 [Bug c/18912] New: FW: gcc 3.3.1 for Powerpc optimzation flag -Os generates bad code atul dot sabharwal at tek dot com
                   ` (2 preceding siblings ...)
  2004-12-09 22:03 ` pinskia at gcc dot gnu dot org
@ 2004-12-09 22:28 ` atul dot sabharwal at exgate dot tek dot com
  2004-12-14 17:53 ` atul dot sabharwal at tek dot com
  2004-12-14 17:55 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: atul dot sabharwal at exgate dot tek dot com @ 2004-12-09 22:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From atul dot sabharwal at exgate dot tek dot com  2004-12-09 22:28 -------
Subject: RE:  FW: gcc 3.3.1 for Powerpc optimzation flag
	 -Os generates bad code

I tried -mpcu=8540 and it does not fix the problem. Commands like ls or ash
still fail. I checked the build scripts and its using this new flag.

--
Atul

-----Original Message-----
From: pinskia at gcc dot gnu dot org [mailto:gcc-bugzilla@gcc.gnu.org] 
Sent: Thursday, December 09, 2004 2:04 PM
To: atul.sabharwal@tek.com
Subject: [Bug target/18912] FW: gcc 3.3.1 for Powerpc optimzation flag -Os
generates bad code



------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-09
22:03 -------
Also does -mcpu=8540 fix the problem then when compiling?



-- 


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


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

* [Bug target/18912] FW: gcc 3.3.1 for Powerpc optimzation flag -Os generates bad code
  2004-12-09 21:29 [Bug c/18912] New: FW: gcc 3.3.1 for Powerpc optimzation flag -Os generates bad code atul dot sabharwal at tek dot com
                   ` (3 preceding siblings ...)
  2004-12-09 22:28 ` atul dot sabharwal at exgate dot tek dot com
@ 2004-12-14 17:53 ` atul dot sabharwal at tek dot com
  2004-12-14 17:55 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: atul dot sabharwal at tek dot com @ 2004-12-14 17:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From atul dot sabharwal at tek dot com  2004-12-14 17:53 -------
This bug is fixed in 3.4.1 version of gcc. I received a cross compiled version 
of gcc for MPC8540 platform with the 3.4.1 gcc based tool chain and all 
busybox apps work correctly.

-- 


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


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

* [Bug target/18912] FW: gcc 3.3.1 for Powerpc optimzation flag -Os generates bad code
  2004-12-09 21:29 [Bug c/18912] New: FW: gcc 3.3.1 for Powerpc optimzation flag -Os generates bad code atul dot sabharwal at tek dot com
                   ` (4 preceding siblings ...)
  2004-12-14 17:53 ` atul dot sabharwal at tek dot com
@ 2004-12-14 17:55 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-14 17:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-14 17:55 -------
Closing as fixed then.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.4.1


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


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

end of thread, other threads:[~2004-12-14 17:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-09 21:29 [Bug c/18912] New: FW: gcc 3.3.1 for Powerpc optimzation flag -Os generates bad code atul dot sabharwal at tek dot com
2004-12-09 21:33 ` [Bug target/18912] " pinskia at gcc dot gnu dot org
2004-12-09 22:01 ` atul dot sabharwal at exgate dot tek dot com
2004-12-09 22:03 ` pinskia at gcc dot gnu dot org
2004-12-09 22:28 ` atul dot sabharwal at exgate dot tek dot com
2004-12-14 17:53 ` atul dot sabharwal at tek dot com
2004-12-14 17:55 ` 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).