public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/21464] New: assembler code is not generated for uint64_t comparison with -O
@ 2005-05-09  9:31 moonz at kaist dot ac dot kr
  2005-05-09 21:37 ` [Bug rtl-optimization/21464] [3.4 Regression] wassembler " pinskia at gcc dot gnu dot org
  2005-05-19 17:47 ` mmitchel at gcc dot gnu dot org
  0 siblings, 2 replies; 5+ messages in thread
From: moonz at kaist dot ac dot kr @ 2005-05-09  9:31 UTC (permalink / raw)
  To: gcc-bugs

input:
====== a.c =====
#include <stdio.h>
#include <inttypes.h>

int main() {
    uint64_t pos = 1;

    pos = 1;

    if (pos < 1 || pos > 0xffffffffffffffffULL) {
        printf("fail\n");
        return 1;
    }

    printf("ok\n");
    return 0;
}
===== end of a.c =====

command lines:

$ gcc a.c
$ ./a.out
ok

$ gcc -O a.c
$ ./a.out
fail

assembler code for comparison of pos is not generated correctly.

it should test, at least, pos < 1, 
but generated code act like if the condition was true.

if "pos > 0xffffffffffffffffUL" is not present, it runs successfully.
definitely, optimization bug while preevaluating the condition at compile time.

my gcc version information is:

$ gcc -v   
Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/specs
Configured with: /var/tmp/portage/gcc-3.4.3.20050110-r2/work/gcc-3.4.3/configure
--enable-version-specific-runtime-libs --prefix=/usr
--bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.4.3-20050110
--includedir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.3-20050110
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.3-20050110/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.3-20050110/info
--with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/include/g++-v3
--host=i686-pc-linux-gnu --disable-altivec --enable-nls
--without-included-gettext --with-system-zlib --disable-checking
--disable-werror --disable-libunwind-exceptions --disable-multilib
--disable-libgcj --enable-languages=c,c++,f77 --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 3.4.3-20050110 (Gentoo Linux 3.4.3.20050110-r2,
ssp-3.4.3.20050110-0, pie-8.7.7)

-- 
           Summary: assembler code is not generated for uint64_t comparison
                    with -O
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: moonz at kaist dot ac dot kr
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug rtl-optimization/21464] [3.4 Regression] wassembler code is not generated for uint64_t comparison with -O
  2005-05-09  9:31 [Bug c/21464] New: assembler code is not generated for uint64_t comparison with -O moonz at kaist dot ac dot kr
@ 2005-05-09 21:37 ` pinskia at gcc dot gnu dot org
  2005-05-19 17:47 ` mmitchel at gcc dot gnu dot org
  1 sibling, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-09 21:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-09 21:37 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|c                           |rtl-optimization
     Ever Confirmed|                            |1
           Keywords|                            |wrong-code
      Known to fail|                            |3.4.0
      Known to work|                            |3.3.3 4.1.0 4.0.0
   Last reconfirmed|0000-00-00 00:00:00         |2005-05-09 21:37:47
               date|                            |
            Summary|assembler code is not       |[3.4 Regression] wassembler
                   |generated for uint64_t      |code is not generated for
                   |comparison with -O          |uint64_t comparison with -O
   Target Milestone|---                         |3.4.4


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


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

* [Bug rtl-optimization/21464] [3.4 Regression] wassembler code is not generated for uint64_t comparison with -O
  2005-05-09  9:31 [Bug c/21464] New: assembler code is not generated for uint64_t comparison with -O moonz at kaist dot ac dot kr
  2005-05-09 21:37 ` [Bug rtl-optimization/21464] [3.4 Regression] wassembler " pinskia at gcc dot gnu dot org
@ 2005-05-19 17:47 ` mmitchel at gcc dot gnu dot org
  1 sibling, 0 replies; 5+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-05-19 17:47 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.4                       |3.4.5


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


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

* [Bug rtl-optimization/21464] [3.4 Regression] wassembler code is not generated for uint64_t comparison with -O
       [not found] <bug-21464-10599@http.gcc.gnu.org/bugzilla/>
  2005-10-07  4:01 ` gdr at gcc dot gnu dot org
@ 2006-02-28 10:15 ` gdr at gcc dot gnu dot org
  1 sibling, 0 replies; 5+ messages in thread
From: gdr at gcc dot gnu dot org @ 2006-02-28 10:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from gdr at gcc dot gnu dot org  2006-02-28 10:14 -------
won't fix for 3.4.6


-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX


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


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

* [Bug rtl-optimization/21464] [3.4 Regression] wassembler code is not generated for uint64_t comparison with -O
       [not found] <bug-21464-10599@http.gcc.gnu.org/bugzilla/>
@ 2005-10-07  4:01 ` gdr at gcc dot gnu dot org
  2006-02-28 10:15 ` gdr at gcc dot gnu dot org
  1 sibling, 0 replies; 5+ messages in thread
From: gdr at gcc dot gnu dot org @ 2005-10-07  4:01 UTC (permalink / raw)
  To: gcc-bugs



-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.5                       |3.4.6


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


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

end of thread, other threads:[~2006-02-28 10:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-09  9:31 [Bug c/21464] New: assembler code is not generated for uint64_t comparison with -O moonz at kaist dot ac dot kr
2005-05-09 21:37 ` [Bug rtl-optimization/21464] [3.4 Regression] wassembler " pinskia at gcc dot gnu dot org
2005-05-19 17:47 ` mmitchel at gcc dot gnu dot org
     [not found] <bug-21464-10599@http.gcc.gnu.org/bugzilla/>
2005-10-07  4:01 ` gdr at gcc dot gnu dot org
2006-02-28 10:15 ` gdr 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).