public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rajendiran.public at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/56075] New: [gcc-4.7.1] 64-bit version, -Os eliminate some line of code which working fine in gcc-4.6.2 64-bit version
Date: Tue, 22 Jan 2013 12:20:00 -0000	[thread overview]
Message-ID: <bug-56075-4@http.gcc.gnu.org/bugzilla/> (raw)


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

             Bug #: 56075
           Summary: [gcc-4.7.1] 64-bit version, -Os eliminate some line of
                    code which working fine in gcc-4.6.2 64-bit version
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rajendiran.public@gmail.com


Created attachment 29247
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29247
C source code

With attached sample C codes, assembly code for C code at LINE-1 is not at all
generated in gcc-4.7.1(64-bit) but gcc-4.6.2(64-bit) generate it correctly.

void fun( struct semaphore *s1,struct semaphore *s2)
{
  ...
 { struct semaphore __mutex = { .lock = (spinlock_t ) { { .rlock = { .raw_lock
= { 0 }, .magic = 0xdead4ead, .owner_cpu = -1, .owner = ((void *)-1L), .dep_map
= { .name = "(*(s1)).lock" } } } }, .count = 1, .wait_list = {
&((*(s1)).wait_list), &((*(s1)).wait_list) }, }; *(s1) = __mutex; }; // LINE-1

 { struct semaphore __mutex = { .lock = (spinlock_t ) { { .rlock = { .raw_lock
= { 0 }, .magic = 0xdead4ead, .owner_cpu = -1, .owner = ((void *)-1L), .dep_map
= { .name = "(*(s2)).lock" } } } }, .count = 1, .wait_list = {
&((*(s2)).wait_list), &((*(s2)).wait_list) }, }; *(s2) = __mutex; };  //LINE-2
 ...
}

Source Code Compiling options in GCC-4.7.1
------------------------------------------

gcc -nostdinc -isystem /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.7.1/include
-I/linux-3.1.7-0/kernel/bld/include/
-I/linux-3.1.7-0/kernel/bld/arch/x86/include -Iarch/x86/include/generated
-Iinclude  -include /linux-3.1.7-0/kernel/bld/include/linux/kconfig.h
-D__KERNEL__ -Os -m64 -fno-strict-aliasing -mno-red-zone
-fno-omit-frame-pointer -fconserve-stack -S nv1.c

Source Code Compiling options in GCC-4.6.2
------------------------------------------

gcc -nostdinc -isystem /usr/lib64/gcc/x86_64-suse-linux/4.6/include
-I/linux-3.1.7-0/kernel/bld/include/
-I/linux-3.1.7-0/kernel/bld/arch/x86/include -Iarch/x86/include/generated
-Iinclude  -include /linux-3.1.7-0/kernel/bld/include/linux/kconfig.h
-D__KERNEL__ -Os -m64 -fno-strict-aliasing -mno-red-zone
-fno-omit-frame-pointer -fconserve-stack -S nv1.c


GCC-4.7.1 - Build Config
------------------------

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.7.1/configure --prefix=/tmp/outdir/usr
Thread model: posix
gcc version 4.7.1 (GCC) 



GCC-4.6.2 Build Config
----------------------
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/4.6/lto-wrapper
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.6
--enable-ssp --disable-libssp --disable-plugin
--with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
--disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib
--enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --program-suffix=-4.6
--enable-linux-futex --without-system-libunwind --with-arch-32=i586
--with-tune=generic --build=x86_64-suse-linux
Thread model: posix
gcc version 4.6.2 (SUSE Linux)


             reply	other threads:[~2013-01-22 12:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-22 12:20 rajendiran.public at gmail dot com [this message]
2013-01-23 10:32 ` [Bug tree-optimization/56075] " rajendiran.public at gmail dot com
2013-01-23 11:27 ` jakub at gcc dot gnu.org
2013-01-23 16:35 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-56075-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).