public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/48702] New: optimization regression with gcc-4.6 on x86_64-unknown-linux-gnu
@ 2011-04-20 14:12 mariah.lenox at gmail dot com
  2011-04-20 14:29 ` [Bug rtl-optimization/48702] " rguenth at gcc dot gnu.org
                   ` (30 more replies)
  0 siblings, 31 replies; 32+ messages in thread
From: mariah.lenox at gmail dot com @ 2011-04-20 14:12 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: optimization regression with gcc-4.6 on
                    x86_64-unknown-linux-gnu
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mariah.lenox@gmail.com


/* optimization regression with gcc-4.6.0 on x86_64-unknown-linux-gnu

% gcc-4.6.0 -O2 -o foo foo.c
% foo
% 1
%
% gcc-4.6.0 -O1 -o foo foo.c
% foo
% 4
%
% gcc-4.5.1 -O2 -o foo foo.c
% foo
% 4

% gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc-4.6.0/x86_64-Linux-core2-fc/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /usr/local/gcc-4.6.0/src/gcc-4.6.0/configure
--enable-languages=c,c++,fortran --with-gnu-as
--with-gnu-as=/usr/local/binutils-2.21/x86_64-Linux-core2-fc-gcc-4.5.1-rh/bin/as
--with-gnu-ld
--with-ld=/usr/local/binutils-2.21/x86_64-Linux-core2-fc-gcc-4.5.1-rh/bin/ld
--with-gmp=/usr/local/mpir-2.3.0/x86_64-Linux-core2-fc-gcc-4.5.1-rh
--with-mpfr=/usr/local/mpfr-3.0.0/x86_64-Linux-core2-fc-mpir-2.3.0-gcc-4.5.1-rh
--with-mpc=/usr/local/mpc-0.9/x86_64-Linux-core2-fc-mpir-2.3.0-mpfr-3.0.0-gcc-4.5.1-rh
--prefix=/usr/local/gcc-4.6.0/x86_64-Linux-core2-fc
Thread model: posix
gcc version 4.6.0 (GCC) 
%

*/

#include  <stdio.h>

#define LEN 4  

void unpack(int  array[LEN])
{
int ii, val;

val = 1;
for (ii = 0; ii < LEN; ii++) {
  array[ii] = val % 2;
  val = val / 2;
}

return;
}

int  pack(int  array[LEN])
{
int ans, ii;

ans = 0;
for (ii = LEN-1; ii >= 0; ii--) {
  ans = 2 * ans + array[ii];
}

return ans;
}

int  foo()
{
int temp, ans;
int array[LEN];

unpack(array);
temp = array[0];
array[0] = array[2];
array[2] = temp;
ans = pack(array);
return ans;
}

int main(void)
{
int val;

val = foo();
printf("%d\n", val);

return 0; 
}


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

end of thread, other threads:[~2011-06-06 10:20 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-20 14:12 [Bug rtl-optimization/48702] New: optimization regression with gcc-4.6 on x86_64-unknown-linux-gnu mariah.lenox at gmail dot com
2011-04-20 14:29 ` [Bug rtl-optimization/48702] " rguenth at gcc dot gnu.org
2011-04-20 14:32 ` [Bug rtl-optimization/48702] [4.6 Regression] " rguenth at gcc dot gnu.org
2011-04-20 14:39 ` rguenth at gcc dot gnu.org
2011-04-20 15:08 ` [Bug rtl-optimization/48702] [4.6/4.7 " rguenth at gcc dot gnu.org
2011-04-21 10:48 ` rguenth at gcc dot gnu.org
2011-04-21 11:06 ` [Bug tree-optimization/48702] " rguenth at gcc dot gnu.org
2011-04-21 11:50 ` rakdver at gcc dot gnu.org
2011-04-21 12:32 ` rguenth at gcc dot gnu.org
2011-04-21 12:39 ` rguenth at gcc dot gnu.org
2011-04-21 12:58 ` rakdver at kam dot mff.cuni.cz
2011-04-21 13:06 ` rguenther at suse dot de
2011-04-21 13:35 ` rakdver at kam dot mff.cuni.cz
2011-04-21 16:22 ` xinliangli at gmail dot com
2011-05-12 12:10 ` rguenth at gcc dot gnu.org
2011-05-17 17:40 ` xinliangli at gmail dot com
2011-05-17 19:42 ` rakdver at kam dot mff.cuni.cz
2011-05-17 20:43 ` xinliangli at gmail dot com
2011-05-17 20:53 ` rakdver at kam dot mff.cuni.cz
2011-05-17 21:29 ` xinliangli at gmail dot com
2011-05-18  9:18 ` rguenther at suse dot de
2011-05-18 16:17 ` xinliangli at gmail dot com
2011-05-19  5:30 ` xinliangli at gmail dot com
2011-05-25 11:03 ` rguenth at gcc dot gnu.org
2011-05-25 11:06 ` rguenth at gcc dot gnu.org
2011-05-25 14:00 ` rguenth at gcc dot gnu.org
2011-05-26 10:05 ` rguenth at gcc dot gnu.org
2011-05-26 11:14 ` rguenth at gcc dot gnu.org
2011-05-26 13:03 ` rguenth at gcc dot gnu.org
2011-05-26 13:23 ` [Bug tree-optimization/48702] [4.6 " rguenth at gcc dot gnu.org
2011-06-06 10:14 ` rguenth at gcc dot gnu.org
2011-06-06 10:20 ` rguenth at gcc dot gnu.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).