public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug regression/26180]  New: optimization regression on x86-SunOS
@ 2006-02-08 21:00 kminola at eng dot umd dot edu
  2006-02-09  0:55 ` [Bug tree-optimization/26180] [4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: kminola at eng dot umd dot edu @ 2006-02-08 21:00 UTC (permalink / raw)
  To: gcc-bugs

/*
% gcc -v
Using built-in specs.
Target: i386-pc-solaris2.9
Configured with: /usr/local/gcc-4.0.2/src/gcc-4.0.2/configure
--enable-languages=c --with-gnu-as
--with-as=/usr/local/binutils-2.16.1/x86-SunOS-gcc-4.0.1/bin/as
--with-gnu-ld
--with-ld=/usr/local/binutils-2.16.1/x86-SunOS-gcc-4.0.1/bin/ld
--prefix=/usr/local/gcc-4.0.2/x86-SunOS-gnu-as-ld
Thread model: posix
gcc version 4.0.2
%
% gcc -O0 -o foo foo.c
% foo
z= 1
%
% gcc -O2 -o foo foo.c
% foo
z= 1
%
%
% gcc-4.1 -v
Using built-in specs.
Target: i386-pc-solaris2.9
Configured with: /home/kate/gcc-4.1-20060203/src/gcc-4.1-20060203/configure
--enable-languages=c --with-gnu-as
--with-as=/usr/local/binutils-2.16.1/x86-SunOS-gcc-4.0.1/bin/as
--with-gnu-ld
--with-ld=/usr/local/binutils-2.16.1/x86-SunOS-gcc-4.0.1/bin/ld
--prefix=/home/kate/gcc-4.1-20060203/x86-SunOS-gnu-as-ld
Thread model: posix
gcc version 4.1.0 20060203 (prerelease)
%
%
% gcc-4.1 -O0 -o foo foo.c
z = 1
%
% gcc-4.1 -O2 -o foo foo.c
z = -1
%

*/
#include <stdio.h>

int bar(x, y)
int x, y;
{
    int x1, y1;
    int x2, y2;
    unsigned int x3, y3, w;
    int z;

    x1 = (x < (1 << 30));
    y1 = (y < (1 << 30));
    if (x1 && y1) {
        x2 = ((x > 0)? (x): -(x));
        y2 = ((y > 0)? (y): -(y));

        x3 = x2;
        y3 = y2;
        w = x3 * y3;

        if (w >= (1 << 30)) {
          z = 1;
        } else    {
          z = -1;
        }
    }

        return z;
}


int main()
{
  int x, y, z;
  x = 536870912;  /* 2^29 */
  y = 2;
  z = bar(x, y);
printf("z= %d\n", z);
}


-- 
           Summary: optimization regression on x86-SunOS
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: regression
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kminola at eng dot umd dot edu
 GCC build triplet: i386-pc-solaris2.9
  GCC host triplet: i386-pc-solaris2.9
GCC target triplet: i386-pc-solaris2.9


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


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

end of thread, other threads:[~2006-02-09 13:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-08 21:00 [Bug regression/26180] New: optimization regression on x86-SunOS kminola at eng dot umd dot edu
2006-02-09  0:55 ` [Bug tree-optimization/26180] [4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
2006-02-09  4:20 ` [Bug tree-optimization/26180] [4.1/4.2 Regression] wrong code due to VRP and unsigned multiplies with wraps dnovillo at gcc dot gnu dot org
2006-02-09 12:38 ` dnovillo at gcc dot gnu dot org
2006-02-09 12:42 ` dnovillo at gcc dot gnu dot org
2006-02-09 13:38 ` [Bug tree-optimization/26180] [4.1 " pinskia at gcc dot gnu dot org
2006-02-09 13:38 ` pinskia at gcc dot gnu dot org
2006-02-09 13:40 ` dnovillo at gcc dot gnu dot org
2006-02-09 13:41 ` dnovillo 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).